1*9880d681SAndroid Build Coastguard Worker# RUN: llvm-mc %s -triple=mipsel -show-encoding -mattr=micromips \ 2*9880d681SAndroid Build Coastguard Worker# RUN: | FileCheck -check-prefix=CHECK-EL %s 3*9880d681SAndroid Build Coastguard Worker# RUN: llvm-mc %s -triple=mips -show-encoding -mattr=micromips \ 4*9880d681SAndroid Build Coastguard Worker# RUN: | FileCheck -check-prefix=CHECK-EB %s 5*9880d681SAndroid Build Coastguard Worker# Check that the assembler can handle the documented syntax 6*9880d681SAndroid Build Coastguard Worker# for load and store instructions. 7*9880d681SAndroid Build Coastguard Worker#------------------------------------------------------------------------------ 8*9880d681SAndroid Build Coastguard Worker# Load and Store 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: lb $5, 8($4) # encoding: [0xa4,0x1c,0x08,0x00] 13*9880d681SAndroid Build Coastguard Worker# CHECK-EL: lbu $6, 8($4) # encoding: [0xc4,0x14,0x08,0x00] 14*9880d681SAndroid Build Coastguard Worker# CHECK-EL: lh $2, 8($4) # encoding: [0x44,0x3c,0x08,0x00] 15*9880d681SAndroid Build Coastguard Worker# CHECK-EL: lhu $4, 8($2) # encoding: [0x82,0x34,0x08,0x00] 16*9880d681SAndroid Build Coastguard Worker# CHECK-EL: lw $6, 4($5) # encoding: [0xc5,0xfc,0x04,0x00] 17*9880d681SAndroid Build Coastguard Worker# CHECK-EL: lw $6, 123($sp) # encoding: [0xdd,0xfc,0x7b,0x00] 18*9880d681SAndroid Build Coastguard Worker# CHECK-EL: sb $5, 8($4) # encoding: [0xa4,0x18,0x08,0x00] 19*9880d681SAndroid Build Coastguard Worker# CHECK-EL: sh $2, 8($4) # encoding: [0x44,0x38,0x08,0x00] 20*9880d681SAndroid Build Coastguard Worker# CHECK-EL: sw $5, 4($6) # encoding: [0xa6,0xf8,0x04,0x00] 21*9880d681SAndroid Build Coastguard Worker# CHECK-EL: sw $5, 123($sp) # encoding: [0xbd,0xf8,0x7b,0x00] 22*9880d681SAndroid Build Coastguard Worker# CHECK-EL: sw $3, 32($gp) # encoding: [0x7c,0xf8,0x20,0x00] 23*9880d681SAndroid Build Coastguard Worker# CHECK-EL: ll $2, 8($4) # encoding: [0x44,0x60,0x08,0x30] 24*9880d681SAndroid Build Coastguard Worker# CHECK-EL: sc $2, 8($4) # encoding: [0x44,0x60,0x08,0xb0] 25*9880d681SAndroid Build Coastguard Worker# CHECK-EL: lwu $2, 8($4) # encoding: [0x44,0x60,0x08,0xe0] 26*9880d681SAndroid Build Coastguard Worker# CHECK-EL: lwxs $2, $3($4) # encoding: [0x64,0x00,0x18,0x11] 27*9880d681SAndroid Build Coastguard Worker# CHECK-EL: lwm32 $16, $17, 8($4) # encoding: [0x44,0x20,0x08,0x50] 28*9880d681SAndroid Build Coastguard Worker# CHECK-EL: lwm32 $16, $17, $18, $19, 8($4) # encoding: [0x84,0x20,0x08,0x50] 29*9880d681SAndroid Build Coastguard Worker# CHECK-EL: lwm32 $16, $17, $18, $19, $20, $21, $22, $23, $fp, 8($4) # encoding: [0x24,0x21,0x08,0x50] 30*9880d681SAndroid Build Coastguard Worker# CHECK-EL: lwm32 $16, $17, $18, $19, $ra, 8($4) # encoding: [0x84,0x22,0x08,0x50] 31*9880d681SAndroid Build Coastguard Worker# CHECK-EL: lwm32 $16, $17, $18, $19, $20, $21, $22, $23, $fp, $ra, 8($4) # encoding: [0x24,0x23,0x08,0x50] 32*9880d681SAndroid Build Coastguard Worker# CHECK-EL: lwm32 $16, $17, $18, $19, $20, $21, $22, $23, $fp, $ra, 8($4) # encoding: [0x24,0x23,0x08,0x50] 33*9880d681SAndroid Build Coastguard Worker# CHECK-EL: swm32 $16, $17, 8($4) # encoding: [0x44,0x20,0x08,0xd0] 34*9880d681SAndroid Build Coastguard Worker# CHECK-EL: swm32 $16, $17, $18, $19, 8($4) # encoding: [0x84,0x20,0x08,0xd0] 35*9880d681SAndroid Build Coastguard Worker# CHECK-EL: lwm16 $16, $17, $ra, 8($sp) # encoding: [0x12,0x45] 36*9880d681SAndroid Build Coastguard Worker# CHECK-EL: swm16 $16, $17, $ra, 8($sp) # encoding: [0x52,0x45] 37*9880d681SAndroid Build Coastguard Worker# CHECK-EL: lwm16 $16, $17, $ra, 8($sp) # encoding: [0x12,0x45] 38*9880d681SAndroid Build Coastguard Worker# CHECK-EL: lwm32 $16, $17, $ra, 64($sp) # encoding: [0x5d,0x22,0x40,0x50] 39*9880d681SAndroid Build Coastguard Worker# CHECK-EL: lwm32 $16, $17, $ra, 8($4) # encoding: [0x44,0x22,0x08,0x50] 40*9880d681SAndroid Build Coastguard Worker# CHECK-EL: lwm32 $16, $17, 8($sp) # encoding: [0x5d,0x20,0x08,0x50] 41*9880d681SAndroid Build Coastguard Worker# CHECK-EL: swm16 $16, $17, $ra, 8($sp) # encoding: [0x52,0x45] 42*9880d681SAndroid Build Coastguard Worker# CHECK-EL: swm32 $16, $17, $ra, 64($sp) # encoding: [0x5d,0x22,0x40,0xd0] 43*9880d681SAndroid Build Coastguard Worker# CHECK-EL: swm32 $16, $17, $ra, 8($4) # encoding: [0x44,0x22,0x08,0xd0] 44*9880d681SAndroid Build Coastguard Worker# CHECK-EL: swm32 $16, $17, 8($sp) # encoding: [0x5d,0x20,0x08,0xd0] 45*9880d681SAndroid Build Coastguard Worker# CHECK-EL: swp $16, 8($4) # encoding: [0x04,0x22,0x08,0x90] 46*9880d681SAndroid Build Coastguard Worker# CHECK-EL: lwp $16, 8($4) # encoding: [0x04,0x22,0x08,0x10] 47*9880d681SAndroid Build Coastguard Worker# CHECK-EL: lhue $4, 8($2) # encoding: [0x82,0x60,0x08,0x62] 48*9880d681SAndroid Build Coastguard Worker# CHECK-EL: lbe $4, 8($2) # encoding: [0x82,0x60,0x08,0x68] 49*9880d681SAndroid Build Coastguard Worker# CHECK-EL: lbue $4, 8($2) # encoding: [0x82,0x60,0x08,0x60] 50*9880d681SAndroid Build Coastguard Worker# CHECK-EL: lhe $4, 8($2) # encoding: [0x82,0x60,0x08,0x6a] 51*9880d681SAndroid Build Coastguard Worker# CHECK-EL: lwe $4, 8($2) # encoding: [0x82,0x60,0x08,0x6e] 52*9880d681SAndroid Build Coastguard Worker# CHECK-EL: sbe $5, 8($4) # encoding: [0xa4,0x60,0x08,0xa8] 53*9880d681SAndroid Build Coastguard Worker# CHECK-EL: she $5, 8($4) # encoding: [0xa4,0x60,0x08,0xaa] 54*9880d681SAndroid Build Coastguard Worker# CHECK-EL: swe $5, 8($4) # encoding: [0xa4,0x60,0x08,0xae] 55*9880d681SAndroid Build Coastguard Worker#------------------------------------------------------------------------------ 56*9880d681SAndroid Build Coastguard Worker# Big endian 57*9880d681SAndroid Build Coastguard Worker#------------------------------------------------------------------------------ 58*9880d681SAndroid Build Coastguard Worker# CHECK-EB: lb $5, 8($4) # encoding: [0x1c,0xa4,0x00,0x08] 59*9880d681SAndroid Build Coastguard Worker# CHECK-EB: lbu $6, 8($4) # encoding: [0x14,0xc4,0x00,0x08] 60*9880d681SAndroid Build Coastguard Worker# CHECK-EB: lh $2, 8($4) # encoding: [0x3c,0x44,0x00,0x08] 61*9880d681SAndroid Build Coastguard Worker# CHECK-EB: lhu $4, 8($2) # encoding: [0x34,0x82,0x00,0x08] 62*9880d681SAndroid Build Coastguard Worker# CHECK-EB: lw $6, 4($5) # encoding: [0xfc,0xc5,0x00,0x04] 63*9880d681SAndroid Build Coastguard Worker# CHECK-EB: lw $6, 123($sp) # encoding: [0xfc,0xdd,0x00,0x7b] 64*9880d681SAndroid Build Coastguard Worker# CHECK-EB: sb $5, 8($4) # encoding: [0x18,0xa4,0x00,0x08] 65*9880d681SAndroid Build Coastguard Worker# CHECK-EB: sh $2, 8($4) # encoding: [0x38,0x44,0x00,0x08] 66*9880d681SAndroid Build Coastguard Worker# CHECK-EB: sw $5, 4($6) # encoding: [0xf8,0xa6,0x00,0x04] 67*9880d681SAndroid Build Coastguard Worker# CHECK-EB: sw $5, 123($sp) # encoding: [0xf8,0xbd,0x00,0x7b] 68*9880d681SAndroid Build Coastguard Worker# CHECK-EB: sw $3, 32($gp) # encoding: [0xf8,0x7c,0x00,0x20] 69*9880d681SAndroid Build Coastguard Worker# CHECK-EB: ll $2, 8($4) # encoding: [0x60,0x44,0x30,0x08] 70*9880d681SAndroid Build Coastguard Worker# CHECK-EB: sc $2, 8($4) # encoding: [0x60,0x44,0xb0,0x08] 71*9880d681SAndroid Build Coastguard Worker# CHECK-EB: lwu $2, 8($4) # encoding: [0x60,0x44,0xe0,0x08] 72*9880d681SAndroid Build Coastguard Worker# CHECK-EB: lwxs $2, $3($4) # encoding: [0x00,0x64,0x11,0x18] 73*9880d681SAndroid Build Coastguard Worker# CHECK-EB: lwm32 $16, $17, 8($4) # encoding: [0x20,0x44,0x50,0x08] 74*9880d681SAndroid Build Coastguard Worker# CHECK-EB: lwm32 $16, $17, $18, $19, 8($4) # encoding: [0x20,0x84,0x50,0x08] 75*9880d681SAndroid Build Coastguard Worker# CHECK-EB: lwm32 $16, $17, $18, $19, $20, $21, $22, $23, $fp, 8($4) # encoding: [0x21,0x24,0x50,0x08] 76*9880d681SAndroid Build Coastguard Worker# CHECK-EB: lwm32 $16, $17, $18, $19, $ra, 8($4) # encoding: [0x22,0x84,0x50,0x08] 77*9880d681SAndroid Build Coastguard Worker# CHECK-EB: lwm32 $16, $17, $18, $19, $20, $21, $22, $23, $fp, $ra, 8($4) # encoding: [0x23,0x24,0x50,0x08] 78*9880d681SAndroid Build Coastguard Worker# CHECK-EB: lwm32 $16, $17, $18, $19, $20, $21, $22, $23, $fp, $ra, 8($4) # encoding: [0x23,0x24,0x50,0x08] 79*9880d681SAndroid Build Coastguard Worker# CHECK-EB: swm32 $16, $17, 8($4) # encoding: [0x20,0x44,0xd0,0x08] 80*9880d681SAndroid Build Coastguard Worker# CHECK-EB: swm32 $16, $17, $18, $19, 8($4) # encoding: [0x20,0x84,0xd0,0x08] 81*9880d681SAndroid Build Coastguard Worker# CHECK-EB: lwm16 $16, $17, $ra, 8($sp) # encoding: [0x45,0x12] 82*9880d681SAndroid Build Coastguard Worker# CHECK-EB: swm16 $16, $17, $ra, 8($sp) # encoding: [0x45,0x52] 83*9880d681SAndroid Build Coastguard Worker# CHECK-EB: lwm16 $16, $17, $ra, 8($sp) # encoding: [0x45,0x12] 84*9880d681SAndroid Build Coastguard Worker# CHECK-EB: lwm32 $16, $17, $ra, 64($sp) # encoding: [0x22,0x5d,0x50,0x40] 85*9880d681SAndroid Build Coastguard Worker# CHECK-EB: lwm32 $16, $17, $ra, 8($4) # encoding: [0x22,0x44,0x50,0x08] 86*9880d681SAndroid Build Coastguard Worker# CHECK-EB: lwm32 $16, $17, 8($sp) # encoding: [0x20,0x5d,0x50,0x08] 87*9880d681SAndroid Build Coastguard Worker# CHECK-EB: swm16 $16, $17, $ra, 8($sp) # encoding: [0x45,0x52] 88*9880d681SAndroid Build Coastguard Worker# CHECK-EB: swm32 $16, $17, $ra, 64($sp) # encoding: [0x22,0x5d,0xd0,0x40] 89*9880d681SAndroid Build Coastguard Worker# CHECK-EB: swm32 $16, $17, $ra, 8($4) # encoding: [0x22,0x44,0xd0,0x08] 90*9880d681SAndroid Build Coastguard Worker# CHECK-EB: swm32 $16, $17, 8($sp) # encoding: [0x20,0x5d,0xd0,0x08] 91*9880d681SAndroid Build Coastguard Worker# CHECK-EB: swp $16, 8($4) # encoding: [0x22,0x04,0x90,0x08] 92*9880d681SAndroid Build Coastguard Worker# CHECK-EB: lwp $16, 8($4) # encoding: [0x22,0x04,0x10,0x08] 93*9880d681SAndroid Build Coastguard Worker# CHECK-EB: lhue $4, 8($2) # encoding: [0x60,0x82,0x62,0x08] 94*9880d681SAndroid Build Coastguard Worker# CHECK-EB: lbe $4, 8($2) # encoding: [0x60,0x82,0x68,0x08] 95*9880d681SAndroid Build Coastguard Worker# CHECK-EB: lbue $4, 8($2) # encoding: [0x60,0x82,0x60,0x08] 96*9880d681SAndroid Build Coastguard Worker# CHECK-EB: lhe $4, 8($2) # encoding: [0x60,0x82,0x6a,0x08] 97*9880d681SAndroid Build Coastguard Worker# CHECK-EB: lwe $4, 8($2) # encoding: [0x60,0x82,0x6e,0x08] 98*9880d681SAndroid Build Coastguard Worker# CHECK-EB: sbe $5, 8($4) # encoding: [0x60,0xa4,0xa8,0x08] 99*9880d681SAndroid Build Coastguard Worker# CHECK-EB: she $5, 8($4) # encoding: [0x60,0xa4,0xaa,0x08] 100*9880d681SAndroid Build Coastguard Worker# CHECK-EB: swe $5, 8($4) # encoding: [0x60,0xa4,0xae,0x08] 101*9880d681SAndroid Build Coastguard Worker lb $5, 8($4) 102*9880d681SAndroid Build Coastguard Worker lbu $6, 8($4) 103*9880d681SAndroid Build Coastguard Worker lh $2, 8($4) 104*9880d681SAndroid Build Coastguard Worker lhu $4, 8($2) 105*9880d681SAndroid Build Coastguard Worker lw $6, 4($5) 106*9880d681SAndroid Build Coastguard Worker lw $6, 123($sp) 107*9880d681SAndroid Build Coastguard Worker sb $5, 8($4) 108*9880d681SAndroid Build Coastguard Worker sh $2, 8($4) 109*9880d681SAndroid Build Coastguard Worker sw $5, 4($6) 110*9880d681SAndroid Build Coastguard Worker sw $5, 123($sp) 111*9880d681SAndroid Build Coastguard Worker sw $3, 32($gp) 112*9880d681SAndroid Build Coastguard Worker ll $2, 8($4) 113*9880d681SAndroid Build Coastguard Worker sc $2, 8($4) 114*9880d681SAndroid Build Coastguard Worker lwu $2, 8($4) 115*9880d681SAndroid Build Coastguard Worker lwxs $2, $3($4) 116*9880d681SAndroid Build Coastguard Worker lwm32 $16, $17, 8($4) 117*9880d681SAndroid Build Coastguard Worker lwm32 $16 - $19, 8($4) 118*9880d681SAndroid Build Coastguard Worker lwm32 $16-$23, $30, 8($4) 119*9880d681SAndroid Build Coastguard Worker lwm32 $16-$19, $31, 8($4) 120*9880d681SAndroid Build Coastguard Worker lwm32 $16-$23, $30, $31, 8($4) 121*9880d681SAndroid Build Coastguard Worker lwm32 $16-$23, $30 - $31, 8($4) 122*9880d681SAndroid Build Coastguard Worker swm32 $16, $17, 8($4) 123*9880d681SAndroid Build Coastguard Worker swm32 $16 - $19, 8($4) 124*9880d681SAndroid Build Coastguard Worker lwm16 $16, $17, $ra, 8($sp) 125*9880d681SAndroid Build Coastguard Worker swm16 $16, $17, $ra, 8($sp) 126*9880d681SAndroid Build Coastguard Worker lwm $16, $17, $ra, 8($sp) 127*9880d681SAndroid Build Coastguard Worker lwm $16, $17, $ra, 64($sp) 128*9880d681SAndroid Build Coastguard Worker lwm $16, $17, $ra, 8($4) 129*9880d681SAndroid Build Coastguard Worker lwm $16, $17, 8($sp) 130*9880d681SAndroid Build Coastguard Worker swm $16, $17, $ra, 8($sp) 131*9880d681SAndroid Build Coastguard Worker swm $16, $17, $ra, 64($sp) 132*9880d681SAndroid Build Coastguard Worker swm $16, $17, $ra, 8($4) 133*9880d681SAndroid Build Coastguard Worker swm $16, $17, 8($sp) 134*9880d681SAndroid Build Coastguard Worker swp $16, 8($4) 135*9880d681SAndroid Build Coastguard Worker lwp $16, 8($4) 136*9880d681SAndroid Build Coastguard Worker lhue $4, 8($2) 137*9880d681SAndroid Build Coastguard Worker lbe $4, 8($2) 138*9880d681SAndroid Build Coastguard Worker lbue $4, 8($2) 139*9880d681SAndroid Build Coastguard Worker lhe $4, 8($2) 140*9880d681SAndroid Build Coastguard Worker lwe $4, 8($2) 141*9880d681SAndroid Build Coastguard Worker sbe $5, 8($4) 142*9880d681SAndroid Build Coastguard Worker she $5, 8($4) 143*9880d681SAndroid Build Coastguard Worker swe $5, 8($4) 144