aboutsummaryrefslogtreecommitdiff
path: root/test/MC/Mips/mips-jump-instructions.s
blob: bc2d720398188175d587cd240095d1662db48941 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# RUN: llvm-mc %s -triple=mipsel-unknown-linux -show-encoding -mcpu=mips32r2 | FileCheck %s
# Check that the assembler can handle the documented syntax
# for jumps and branches.
# CHECK: .section __TEXT,__text,regular,pure_instructions
#------------------------------------------------------------------------------
# Branch instructions
#------------------------------------------------------------------------------
# CHECK:   b 1332                 # encoding: [0x34,0x05,0x00,0x10]
# CHECK:   nop                    # encoding: [0x00,0x00,0x00,0x00]
# CHECK:   bc1f 1332              # encoding: [0x34,0x05,0x00,0x45]
# CHECK:   nop                    # encoding: [0x00,0x00,0x00,0x00]
# CHECK:   bc1t 1332              # encoding: [0x34,0x05,0x01,0x45]
# CHECK:   nop                    # encoding: [0x00,0x00,0x00,0x00]
# CHECK:   beq $9, $6, 1332       # encoding: [0x34,0x05,0x26,0x11]
# CHECK:   nop                    # encoding: [0x00,0x00,0x00,0x00]
# CHECK:   bgez $6, 1332          # encoding: [0x34,0x05,0xc1,0x04]
# CHECK:   nop                    # encoding: [0x00,0x00,0x00,0x00]
# CHECK:   bgezal $6, 1332        # encoding: [0x34,0x05,0xd1,0x04]
# CHECK:   nop                    # encoding: [0x00,0x00,0x00,0x00]
# CHECK:   bgtz $6, 1332          # encoding: [0x34,0x05,0xc0,0x1c]
# CHECK:   nop                    # encoding: [0x00,0x00,0x00,0x00]
# CHECK:   blez $6, 1332          # encoding: [0x34,0x05,0xc0,0x18]
# CHECK:   nop                    # encoding: [0x00,0x00,0x00,0x00]
# CHECK:   bne $9, $6, 1332       # encoding: [0x34,0x05,0x26,0x15]
# CHECK:   nop                    # encoding: [0x00,0x00,0x00,0x00]
# CHECK:   bal     1332           # encoding: [0x34,0x05,0x11,0x04]
# CHECK:   nop                    # encoding: [0x00,0x00,0x00,0x00]
         b 1332
         nop
         bc1f 1332
         nop
         bc1t 1332
         nop
         beq $9,$6,1332
         nop
         bgez $6,1332
         nop
         bgezal $6,1332
         nop
         bgtz $6,1332
         nop
         blez $6,1332
         nop
         bne $9,$6,1332
         nop
         bal 1332
         nop

end_of_code:
#------------------------------------------------------------------------------
# Jump instructions
#------------------------------------------------------------------------------
# CHECK:   j 1328               # encoding: [0x30,0x05,0x00,0x08]
# CHECK:   nop                  # encoding: [0x00,0x00,0x00,0x00]
# CHECK:   jal 1328             # encoding: [0x30,0x05,0x00,0x0c]
# CHECK:   nop                  # encoding: [0x00,0x00,0x00,0x00]
# CHECK:   jalr $6              # encoding: [0x09,0xf8,0xc0,0x00]
# CHECK:   nop                  # encoding: [0x00,0x00,0x00,0x00]
# CHECK:   jalr $25             # encoding: [0x09,0xf8,0x20,0x03]
# CHECK:   nop                  # encoding: [0x00,0x00,0x00,0x00]
# CHECK:   jalr $10, $11        # encoding: [0x09,0x50,0x60,0x01]
# CHECK:   nop                  # encoding: [0x00,0x00,0x00,0x00]
# CHECK:   jr $7                # encoding: [0x08,0x00,0xe0,0x00]
# CHECK:   nop                  # encoding: [0x00,0x00,0x00,0x00]
# CHECK:   jr $7                # encoding: [0x08,0x00,0xe0,0x00]


   j 1328
   nop
   jal 1328
   nop
   jalr $6
   nop
   jalr $31, $25
   nop
   jalr $10, $11
   nop
   jr $7
   nop
   j $7