xref: /aosp_15_r20/external/llvm/test/MC/Mips/micromips-jump-instructions.s (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker# RUN: llvm-mc %s -triple=mipsel -show-encoding -mattr=micromips \
2*9880d681SAndroid Build Coastguard Worker# RUN: | FileCheck %s -check-prefix=CHECK-EL
3*9880d681SAndroid Build Coastguard Worker# RUN: llvm-mc %s -triple=mips -show-encoding -mattr=micromips \
4*9880d681SAndroid Build Coastguard Worker# RUN: | FileCheck %s -check-prefix=CHECK-EB
5*9880d681SAndroid Build Coastguard Worker# Check that the assembler can handle the documented syntax
6*9880d681SAndroid Build Coastguard Worker# for jump and branch instructions.
7*9880d681SAndroid Build Coastguard Worker#------------------------------------------------------------------------------
8*9880d681SAndroid Build Coastguard Worker# Jump instructions
9*9880d681SAndroid Build Coastguard Worker#------------------------------------------------------------------------------
10*9880d681SAndroid Build Coastguard Worker# Little endian
11*9880d681SAndroid Build Coastguard Worker#------------------------------------------------------------------------------
12*9880d681SAndroid Build Coastguard Worker# CHECK-EL: j 1328      # encoding: [0x00,0xd4,0x98,0x02]
13*9880d681SAndroid Build Coastguard Worker# CHECK-EL: nop         # encoding: [0x00,0x00,0x00,0x00]
14*9880d681SAndroid Build Coastguard Worker# CHECK-EL: jal 1328    # encoding: [0x00,0xf4,0x98,0x02]
15*9880d681SAndroid Build Coastguard Worker# CHECK-EL: nop         # encoding: [0x00,0x00,0x00,0x00]
16*9880d681SAndroid Build Coastguard Worker# CHECK-EL: jalr $ra, $6 # encoding: [0xe6,0x03,0x3c,0x0f]
17*9880d681SAndroid Build Coastguard Worker# CHECK-EL: nop         # encoding: [0x00,0x00,0x00,0x00]
18*9880d681SAndroid Build Coastguard Worker# CHECK-EL: jr $7       # encoding: [0x07,0x00,0x3c,0x0f]
19*9880d681SAndroid Build Coastguard Worker# CHECK-EL: nop         # encoding: [0x00,0x00,0x00,0x00]
20*9880d681SAndroid Build Coastguard Worker# CHECK-EL: jr $7       # encoding: [0x07,0x00,0x3c,0x0f]
21*9880d681SAndroid Build Coastguard Worker# CHECK-EL: nop         # encoding: [0x00,0x00,0x00,0x00]
22*9880d681SAndroid Build Coastguard Worker# CHECK-EL: jalx 1328   # encoding: [0x00,0xf0,0x4c,0x01]
23*9880d681SAndroid Build Coastguard Worker# CHECK-EL: nop         # encoding: [0x00,0x00,0x00,0x00]
24*9880d681SAndroid Build Coastguard Worker# CHECK-EL: jals 1328         # encoding: [0x00,0x74,0x98,0x02]
25*9880d681SAndroid Build Coastguard Worker# CHECK-EL: nop               # encoding: [0x00,0x0c]
26*9880d681SAndroid Build Coastguard Worker# CHECK-EL: jalrs $ra, $6     # encoding: [0xe6,0x03,0x3c,0x4f]
27*9880d681SAndroid Build Coastguard Worker# CHECK-EL: nop               # encoding: [0x00,0x0c]
28*9880d681SAndroid Build Coastguard Worker# CHECK-EL: jalr $25          # encoding: [0xd9,0x45]
29*9880d681SAndroid Build Coastguard Worker# CHECK-EL: nop               # encoding: [0x00,0x00,0x00,0x00]
30*9880d681SAndroid Build Coastguard Worker# CHECK-EL: jalr $4, $25      # encoding: [0x99,0x00,0x3c,0x0f]
31*9880d681SAndroid Build Coastguard Worker# CHECK-EL: nop               # encoding: [0x00,0x00,0x00,0x00]
32*9880d681SAndroid Build Coastguard Worker#------------------------------------------------------------------------------
33*9880d681SAndroid Build Coastguard Worker# Big endian
34*9880d681SAndroid Build Coastguard Worker#------------------------------------------------------------------------------
35*9880d681SAndroid Build Coastguard Worker# CHECK-EB: j 1328      # encoding: [0xd4,0x00,0x02,0x98]
36*9880d681SAndroid Build Coastguard Worker# CHECK-EB: nop         # encoding: [0x00,0x00,0x00,0x00]
37*9880d681SAndroid Build Coastguard Worker# CHECK-EB: jal 1328    # encoding: [0xf4,0x00,0x02,0x98]
38*9880d681SAndroid Build Coastguard Worker# CHECK-EB: nop         # encoding: [0x00,0x00,0x00,0x00]
39*9880d681SAndroid Build Coastguard Worker# CHECK-EB: jalr $ra, $6 # encoding: [0x03,0xe6,0x0f,0x3c]
40*9880d681SAndroid Build Coastguard Worker# CHECK-EB: nop         # encoding: [0x00,0x00,0x00,0x00]
41*9880d681SAndroid Build Coastguard Worker# CHECK-EB: jr $7       # encoding: [0x00,0x07,0x0f,0x3c]
42*9880d681SAndroid Build Coastguard Worker# CHECK-EB: nop         # encoding: [0x00,0x00,0x00,0x00]
43*9880d681SAndroid Build Coastguard Worker# CHECK-EB: jr $7       # encoding: [0x00,0x07,0x0f,0x3c]
44*9880d681SAndroid Build Coastguard Worker# CHECK-EB: nop         # encoding: [0x00,0x00,0x00,0x00]
45*9880d681SAndroid Build Coastguard Worker# CHECK-EB: jalx 1328   # encoding: [0xf0,0x00,0x01,0x4c]
46*9880d681SAndroid Build Coastguard Worker# CHECK-EB: nop         # encoding: [0x00,0x00,0x00,0x00]
47*9880d681SAndroid Build Coastguard Worker# CHECK-EB: jals 1328         # encoding: [0x74,0x00,0x02,0x98]
48*9880d681SAndroid Build Coastguard Worker# CHECK-EB: nop               # encoding: [0x0c,0x00]
49*9880d681SAndroid Build Coastguard Worker# CHECK-EB: jalrs $ra, $6     # encoding: [0x03,0xe6,0x4f,0x3c]
50*9880d681SAndroid Build Coastguard Worker# CHECK-EB: nop               # encoding: [0x0c,0x00]
51*9880d681SAndroid Build Coastguard Worker# CHECK-EB: jalr $25          # encoding: [0x45,0xd9]
52*9880d681SAndroid Build Coastguard Worker# CHECK-EB: nop               # encoding: [0x00,0x00,0x00,0x00]
53*9880d681SAndroid Build Coastguard Worker# CHECK-EB: jalr $4, $25      # encoding: [0x00,0x99,0x0f,0x3c]
54*9880d681SAndroid Build Coastguard Worker# CHECK-EB: nop               # encoding: [0x00,0x00,0x00,0x00]
55*9880d681SAndroid Build Coastguard Worker
56*9880d681SAndroid Build Coastguard Worker     j 1328
57*9880d681SAndroid Build Coastguard Worker     jal 1328
58*9880d681SAndroid Build Coastguard Worker     jalr $ra, $6
59*9880d681SAndroid Build Coastguard Worker     jr $7
60*9880d681SAndroid Build Coastguard Worker     j $7
61*9880d681SAndroid Build Coastguard Worker     jalx 1328
62*9880d681SAndroid Build Coastguard Worker     jals 1328
63*9880d681SAndroid Build Coastguard Worker     jalrs $ra, $6
64*9880d681SAndroid Build Coastguard Worker     jal $25
65*9880d681SAndroid Build Coastguard Worker     jal $4, $25
66