1 # RUN: llvm-mc %s -triple=mipsel -show-encoding -mattr=micromips \ 2 # RUN: | FileCheck %s -check-prefix=CHECK-EL 3 # RUN: llvm-mc %s -triple=mips -show-encoding -mattr=micromips \ 4 # RUN: | FileCheck %s -check-prefix=CHECK-EB 5 # Check that the assembler can handle the documented syntax 6 # for arithmetic and logical instructions. 7 #------------------------------------------------------------------------------ 8 # Branch Instructions 9 #------------------------------------------------------------------------------ 10 # Little endian 11 #------------------------------------------------------------------------------ 12 # CHECK-EL: b 1332 # encoding: [0x00,0x94,0x9a,0x02] 13 # CHECK-EL: nop # encoding: [0x00,0x00,0x00,0x00] 14 # CHECK-EL: beq $9, $6, 1332 # encoding: [0xc9,0x94,0x9a,0x02] 15 # CHECK-EL: nop # encoding: [0x00,0x00,0x00,0x00] 16 # CHECK-EL: bgez $6, 1332 # encoding: [0x46,0x40,0x9a,0x02] 17 # CHECK-EL: nop # encoding: [0x00,0x00,0x00,0x00] 18 # CHECK-EL: bgezal $6, 1332 # encoding: [0x66,0x40,0x9a,0x02] 19 # CHECK-EL: nop # encoding: [0x00,0x00,0x00,0x00] 20 # CHECK-EL: bltzal $6, 1332 # encoding: [0x26,0x40,0x9a,0x02] 21 # CHECK-EL: nop # encoding: [0x00,0x00,0x00,0x00] 22 # CHECK-EL: bgtz $6, 1332 # encoding: [0xc6,0x40,0x9a,0x02] 23 # CHECK-EL: nop # encoding: [0x00,0x00,0x00,0x00] 24 # CHECK-EL: blez $6, 1332 # encoding: [0x86,0x40,0x9a,0x02] 25 # CHECK-EL: nop # encoding: [0x00,0x00,0x00,0x00] 26 # CHECK-EL: bne $9, $6, 1332 # encoding: [0xc9,0xb4,0x9a,0x02] 27 # CHECK-EL: nop # encoding: [0x00,0x00,0x00,0x00] 28 # CHECK-EL: bal 1332 # encoding: [0x60,0x40,0x9a,0x02] 29 # CHECK-EL: nop # encoding: [0x00,0x00,0x00,0x00] 30 # CHECK-EL: bltz $6, 1332 # encoding: [0x06,0x40,0x9a,0x02] 31 # CHECK-EL: nop # encoding: [0x00,0x00,0x00,0x00] 32 #------------------------------------------------------------------------------ 33 # Big endian 34 #------------------------------------------------------------------------------ 35 # CHECK-EB: b 1332 # encoding: [0x94,0x00,0x02,0x9a] 36 # CHECK-EB: nop # encoding: [0x00,0x00,0x00,0x00] 37 # CHECK-EB: beq $9, $6, 1332 # encoding: [0x94,0xc9,0x02,0x9a] 38 # CHECK-EB: nop # encoding: [0x00,0x00,0x00,0x00] 39 # CHECK-EB: bgez $6, 1332 # encoding: [0x40,0x46,0x02,0x9a] 40 # CHECK-EB: nop # encoding: [0x00,0x00,0x00,0x00] 41 # CHECK-EB: bgezal $6, 1332 # encoding: [0x40,0x66,0x02,0x9a] 42 # CHECK-EB: nop # encoding: [0x00,0x00,0x00,0x00] 43 # CHECK-EB: bltzal $6, 1332 # encoding: [0x40,0x26,0x02,0x9a] 44 # CHECK-EB: nop # encoding: [0x00,0x00,0x00,0x00] 45 # CHECK-EB: bgtz $6, 1332 # encoding: [0x40,0xc6,0x02,0x9a] 46 # CHECK-EB: nop # encoding: [0x00,0x00,0x00,0x00] 47 # CHECK-EB: blez $6, 1332 # encoding: [0x40,0x86,0x02,0x9a] 48 # CHECK-EB: nop # encoding: [0x00,0x00,0x00,0x00] 49 # CHECK-EB: bne $9, $6, 1332 # encoding: [0xb4,0xc9,0x02,0x9a] 50 # CHECK-EB: nop # encoding: [0x00,0x00,0x00,0x00] 51 # CHECK-EB: bal 1332 # encoding: [0x40,0x60,0x02,0x9a] 52 # CHECK-EB: nop # encoding: [0x00,0x00,0x00,0x00] 53 # CHECK-EB: bltz $6, 1332 # encoding: [0x40,0x06,0x02,0x9a] 54 # CHECK-EB: nop # encoding: [0x00,0x00,0x00,0x00] 55 56 b 1332 57 beq $9,$6,1332 58 bgez $6,1332 59 bgezal $6,1332 60 bltzal $6,1332 61 bgtz $6,1332 62 blez $6,1332 63 bne $9,$6,1332 64 bal 1332 65 bltz $6,1332 66