1*9880d681SAndroid Build Coastguard Worker# RUN: llvm-mc %s -triple=mipsel-unknown-linux -show-encoding -mcpu=mips32r2 | FileCheck %s 2*9880d681SAndroid Build Coastguard Worker# RUN: llvm-mc %s -triple=mips64el-unknown-linux -show-encoding -mcpu=mips64r2 | FileCheck %s 3*9880d681SAndroid Build Coastguard Worker# Check that the assembler can handle the documented syntax 4*9880d681SAndroid Build Coastguard Worker# for FPU instructions. 5*9880d681SAndroid Build Coastguard Worker#------------------------------------------------------------------------------ 6*9880d681SAndroid Build Coastguard Worker# FP aritmetic instructions 7*9880d681SAndroid Build Coastguard Worker#------------------------------------------------------------------------------ 8*9880d681SAndroid Build Coastguard Worker 9*9880d681SAndroid Build Coastguard Worker# CHECK: abs.d $f12, $f14 # encoding: [0x05,0x73,0x20,0x46] 10*9880d681SAndroid Build Coastguard Worker# CHECK: abs.s $f6, $f7 # encoding: [0x85,0x39,0x00,0x46] 11*9880d681SAndroid Build Coastguard Worker# CHECK: add.d $f8, $f12, $f14 # encoding: [0x00,0x62,0x2e,0x46] 12*9880d681SAndroid Build Coastguard Worker# CHECK: add.s $f9, $f6, $f7 # encoding: [0x40,0x32,0x07,0x46] 13*9880d681SAndroid Build Coastguard Worker# CHECK: floor.w.d $f12, $f14 # encoding: [0x0f,0x73,0x20,0x46] 14*9880d681SAndroid Build Coastguard Worker# CHECK: floor.w.s $f6, $f7 # encoding: [0x8f,0x39,0x00,0x46] 15*9880d681SAndroid Build Coastguard Worker# CHECK: ceil.w.d $f12, $f14 # encoding: [0x0e,0x73,0x20,0x46] 16*9880d681SAndroid Build Coastguard Worker# CHECK: ceil.w.s $f6, $f7 # encoding: [0x8e,0x39,0x00,0x46] 17*9880d681SAndroid Build Coastguard Worker# CHECK: mul.d $f8, $f12, $f14 # encoding: [0x02,0x62,0x2e,0x46] 18*9880d681SAndroid Build Coastguard Worker# CHECK: mul.s $f9, $f6, $f7 # encoding: [0x42,0x32,0x07,0x46] 19*9880d681SAndroid Build Coastguard Worker# CHECK: neg.d $f12, $f14 # encoding: [0x07,0x73,0x20,0x46] 20*9880d681SAndroid Build Coastguard Worker# CHECK: neg.s $f6, $f7 # encoding: [0x87,0x39,0x00,0x46] 21*9880d681SAndroid Build Coastguard Worker# CHECK: round.w.d $f12, $f14 # encoding: [0x0c,0x73,0x20,0x46] 22*9880d681SAndroid Build Coastguard Worker# CHECK: round.w.s $f6, $f7 # encoding: [0x8c,0x39,0x00,0x46] 23*9880d681SAndroid Build Coastguard Worker# CHECK: sqrt.d $f12, $f14 # encoding: [0x04,0x73,0x20,0x46] 24*9880d681SAndroid Build Coastguard Worker# CHECK: sqrt.s $f6, $f7 # encoding: [0x84,0x39,0x00,0x46] 25*9880d681SAndroid Build Coastguard Worker# CHECK: sub.d $f8, $f12, $f14 # encoding: [0x01,0x62,0x2e,0x46] 26*9880d681SAndroid Build Coastguard Worker# CHECK: sub.s $f9, $f6, $f7 # encoding: [0x41,0x32,0x07,0x46] 27*9880d681SAndroid Build Coastguard Worker# CHECK: trunc.w.d $f12, $f14 # encoding: [0x0d,0x73,0x20,0x46] 28*9880d681SAndroid Build Coastguard Worker# CHECK: trunc.w.s $f6, $f7 # encoding: [0x8d,0x39,0x00,0x46] 29*9880d681SAndroid Build Coastguard Worker 30*9880d681SAndroid Build Coastguard Worker abs.d $f12,$f14 31*9880d681SAndroid Build Coastguard Worker abs.s $f6,$f7 32*9880d681SAndroid Build Coastguard Worker add.d $f8,$f12,$f14 33*9880d681SAndroid Build Coastguard Worker add.s $f9,$f6,$f7 34*9880d681SAndroid Build Coastguard Worker floor.w.d $f12,$f14 35*9880d681SAndroid Build Coastguard Worker floor.w.s $f6,$f7 36*9880d681SAndroid Build Coastguard Worker ceil.w.d $f12,$f14 37*9880d681SAndroid Build Coastguard Worker ceil.w.s $f6,$f7 38*9880d681SAndroid Build Coastguard Worker mul.d $f8,$f12,$f14 39*9880d681SAndroid Build Coastguard Worker mul.s $f9,$f6, $f7 40*9880d681SAndroid Build Coastguard Worker neg.d $f12,$f14 41*9880d681SAndroid Build Coastguard Worker neg.s $f6,$f7 42*9880d681SAndroid Build Coastguard Worker round.w.d $f12,$f14 43*9880d681SAndroid Build Coastguard Worker round.w.s $f6,$f7 44*9880d681SAndroid Build Coastguard Worker sqrt.d $f12,$f14 45*9880d681SAndroid Build Coastguard Worker sqrt.s $f6,$f7 46*9880d681SAndroid Build Coastguard Worker sub.d $f8,$f12,$f14 47*9880d681SAndroid Build Coastguard Worker sub.s $f9,$f6,$f7 48*9880d681SAndroid Build Coastguard Worker trunc.w.d $f12,$f14 49*9880d681SAndroid Build Coastguard Worker trunc.w.s $f6,$f7 50*9880d681SAndroid Build Coastguard Worker 51*9880d681SAndroid Build Coastguard Worker#------------------------------------------------------------------------------ 52*9880d681SAndroid Build Coastguard Worker# FP compare instructions 53*9880d681SAndroid Build Coastguard Worker#------------------------------------------------------------------------------ 54*9880d681SAndroid Build Coastguard Worker 55*9880d681SAndroid Build Coastguard Worker# CHECK: c.eq.d $f12, $f14 # encoding: [0x32,0x60,0x2e,0x46] 56*9880d681SAndroid Build Coastguard Worker# CHECK: c.eq.s $f6, $f7 # encoding: [0x32,0x30,0x07,0x46] 57*9880d681SAndroid Build Coastguard Worker# CHECK: c.f.d $f12, $f14 # encoding: [0x30,0x60,0x2e,0x46] 58*9880d681SAndroid Build Coastguard Worker# CHECK: c.f.s $f6, $f7 # encoding: [0x30,0x30,0x07,0x46] 59*9880d681SAndroid Build Coastguard Worker# CHECK: c.le.d $f12, $f14 # encoding: [0x3e,0x60,0x2e,0x46] 60*9880d681SAndroid Build Coastguard Worker# CHECK: c.le.s $f6, $f7 # encoding: [0x3e,0x30,0x07,0x46] 61*9880d681SAndroid Build Coastguard Worker# CHECK: c.lt.d $f12, $f14 # encoding: [0x3c,0x60,0x2e,0x46] 62*9880d681SAndroid Build Coastguard Worker# CHECK: c.lt.s $f6, $f7 # encoding: [0x3c,0x30,0x07,0x46] 63*9880d681SAndroid Build Coastguard Worker# CHECK: c.nge.d $f12, $f14 # encoding: [0x3d,0x60,0x2e,0x46] 64*9880d681SAndroid Build Coastguard Worker# CHECK: c.nge.s $f6, $f7 # encoding: [0x3d,0x30,0x07,0x46] 65*9880d681SAndroid Build Coastguard Worker# CHECK: c.ngl.d $f12, $f14 # encoding: [0x3b,0x60,0x2e,0x46] 66*9880d681SAndroid Build Coastguard Worker# CHECK: c.ngl.s $f6, $f7 # encoding: [0x3b,0x30,0x07,0x46] 67*9880d681SAndroid Build Coastguard Worker# CHECK: c.ngle.d $f12, $f14 # encoding: [0x39,0x60,0x2e,0x46] 68*9880d681SAndroid Build Coastguard Worker# CHECK: c.ngle.s $f6, $f7 # encoding: [0x39,0x30,0x07,0x46] 69*9880d681SAndroid Build Coastguard Worker# CHECK: c.ngt.d $f12, $f14 # encoding: [0x3f,0x60,0x2e,0x46] 70*9880d681SAndroid Build Coastguard Worker# CHECK: c.ngt.s $f6, $f7 # encoding: [0x3f,0x30,0x07,0x46] 71*9880d681SAndroid Build Coastguard Worker# CHECK: c.ole.d $f12, $f14 # encoding: [0x36,0x60,0x2e,0x46] 72*9880d681SAndroid Build Coastguard Worker# CHECK: c.ole.s $f6, $f7 # encoding: [0x36,0x30,0x07,0x46] 73*9880d681SAndroid Build Coastguard Worker# CHECK: c.olt.d $f12, $f14 # encoding: [0x34,0x60,0x2e,0x46] 74*9880d681SAndroid Build Coastguard Worker# CHECK: c.olt.s $f6, $f7 # encoding: [0x34,0x30,0x07,0x46] 75*9880d681SAndroid Build Coastguard Worker# CHECK: c.seq.d $f12, $f14 # encoding: [0x3a,0x60,0x2e,0x46] 76*9880d681SAndroid Build Coastguard Worker# CHECK: c.seq.s $f6, $f7 # encoding: [0x3a,0x30,0x07,0x46] 77*9880d681SAndroid Build Coastguard Worker# CHECK: c.sf.d $f12, $f14 # encoding: [0x38,0x60,0x2e,0x46] 78*9880d681SAndroid Build Coastguard Worker# CHECK: c.sf.s $f6, $f7 # encoding: [0x38,0x30,0x07,0x46] 79*9880d681SAndroid Build Coastguard Worker# CHECK: c.ueq.d $f12, $f14 # encoding: [0x33,0x60,0x2e,0x46] 80*9880d681SAndroid Build Coastguard Worker# CHECK: c.ueq.s $f28, $f18 # encoding: [0x33,0xe0,0x12,0x46] 81*9880d681SAndroid Build Coastguard Worker# CHECK: c.ule.d $f12, $f14 # encoding: [0x37,0x60,0x2e,0x46] 82*9880d681SAndroid Build Coastguard Worker# CHECK: c.ule.s $f6, $f7 # encoding: [0x37,0x30,0x07,0x46] 83*9880d681SAndroid Build Coastguard Worker# CHECK: c.ult.d $f12, $f14 # encoding: [0x35,0x60,0x2e,0x46] 84*9880d681SAndroid Build Coastguard Worker# CHECK: c.ult.s $f6, $f7 # encoding: [0x35,0x30,0x07,0x46] 85*9880d681SAndroid Build Coastguard Worker# CHECK: c.un.d $f12, $f14 # encoding: [0x31,0x60,0x2e,0x46] 86*9880d681SAndroid Build Coastguard Worker# CHECK: c.un.s $f6, $f7 # encoding: [0x31,0x30,0x07,0x46] 87*9880d681SAndroid Build Coastguard Worker 88*9880d681SAndroid Build Coastguard Worker c.eq.d $f12,$f14 89*9880d681SAndroid Build Coastguard Worker c.eq.s $f6,$f7 90*9880d681SAndroid Build Coastguard Worker c.f.d $f12,$f14 91*9880d681SAndroid Build Coastguard Worker c.f.s $f6,$f7 92*9880d681SAndroid Build Coastguard Worker c.le.d $f12,$f14 93*9880d681SAndroid Build Coastguard Worker c.le.s $f6,$f7 94*9880d681SAndroid Build Coastguard Worker c.lt.d $f12,$f14 95*9880d681SAndroid Build Coastguard Worker c.lt.s $f6,$f7 96*9880d681SAndroid Build Coastguard Worker c.nge.d $f12,$f14 97*9880d681SAndroid Build Coastguard Worker c.nge.s $f6,$f7 98*9880d681SAndroid Build Coastguard Worker c.ngl.d $f12,$f14 99*9880d681SAndroid Build Coastguard Worker c.ngl.s $f6,$f7 100*9880d681SAndroid Build Coastguard Worker c.ngle.d $f12,$f14 101*9880d681SAndroid Build Coastguard Worker c.ngle.s $f6,$f7 102*9880d681SAndroid Build Coastguard Worker c.ngt.d $f12,$f14 103*9880d681SAndroid Build Coastguard Worker c.ngt.s $f6,$f7 104*9880d681SAndroid Build Coastguard Worker c.ole.d $f12,$f14 105*9880d681SAndroid Build Coastguard Worker c.ole.s $f6,$f7 106*9880d681SAndroid Build Coastguard Worker c.olt.d $f12,$f14 107*9880d681SAndroid Build Coastguard Worker c.olt.s $f6,$f7 108*9880d681SAndroid Build Coastguard Worker c.seq.d $f12,$f14 109*9880d681SAndroid Build Coastguard Worker c.seq.s $f6,$f7 110*9880d681SAndroid Build Coastguard Worker c.sf.d $f12,$f14 111*9880d681SAndroid Build Coastguard Worker c.sf.s $f6,$f7 112*9880d681SAndroid Build Coastguard Worker c.ueq.d $f12,$f14 113*9880d681SAndroid Build Coastguard Worker c.ueq.s $f28,$f18 114*9880d681SAndroid Build Coastguard Worker c.ule.d $f12,$f14 115*9880d681SAndroid Build Coastguard Worker c.ule.s $f6,$f7 116*9880d681SAndroid Build Coastguard Worker c.ult.d $f12,$f14 117*9880d681SAndroid Build Coastguard Worker c.ult.s $f6,$f7 118*9880d681SAndroid Build Coastguard Worker c.un.d $f12,$f14 119*9880d681SAndroid Build Coastguard Worker c.un.s $f6,$f7 120*9880d681SAndroid Build Coastguard Worker 121*9880d681SAndroid Build Coastguard Worker#------------------------------------------------------------------------------ 122*9880d681SAndroid Build Coastguard Worker# FP convert instructions 123*9880d681SAndroid Build Coastguard Worker#------------------------------------------------------------------------------ 124*9880d681SAndroid Build Coastguard Worker# CHECK: cvt.d.s $f6, $f7 # encoding: [0xa1,0x39,0x00,0x46] 125*9880d681SAndroid Build Coastguard Worker# CHECK: cvt.d.w $f12, $f14 # encoding: [0x21,0x73,0x80,0x46] 126*9880d681SAndroid Build Coastguard Worker# CHECK: cvt.s.d $f12, $f14 # encoding: [0x20,0x73,0x20,0x46] 127*9880d681SAndroid Build Coastguard Worker# CHECK: cvt.s.w $f6, $f7 # encoding: [0xa0,0x39,0x80,0x46] 128*9880d681SAndroid Build Coastguard Worker# CHECK: cvt.w.d $f12, $f14 # encoding: [0x24,0x73,0x20,0x46] 129*9880d681SAndroid Build Coastguard Worker# CHECK: cvt.w.s $f6, $f7 # encoding: [0xa4,0x39,0x00,0x46] 130*9880d681SAndroid Build Coastguard Worker 131*9880d681SAndroid Build Coastguard Worker cvt.d.s $f6,$f7 132*9880d681SAndroid Build Coastguard Worker cvt.d.w $f12,$f14 133*9880d681SAndroid Build Coastguard Worker cvt.s.d $f12,$f14 134*9880d681SAndroid Build Coastguard Worker cvt.s.w $f6,$f7 135*9880d681SAndroid Build Coastguard Worker cvt.w.d $f12,$f14 136*9880d681SAndroid Build Coastguard Worker cvt.w.s $f6,$f7 137*9880d681SAndroid Build Coastguard Worker 138*9880d681SAndroid Build Coastguard Worker#------------------------------------------------------------------------------ 139*9880d681SAndroid Build Coastguard Worker# FP move instructions 140*9880d681SAndroid Build Coastguard Worker#------------------------------------------------------------------------------ 141*9880d681SAndroid Build Coastguard Worker# CHECK: bc1f $BB_1 # encoding: [A,A,0x00,0x45] 142*9880d681SAndroid Build Coastguard Worker# CHECK: # fixup A - offset: 0, value: ($BB_1)-4, kind: fixup_Mips_PC16 143*9880d681SAndroid Build Coastguard Worker 144*9880d681SAndroid Build Coastguard Worker# CHECK: cfc1 $6, $0 # encoding: [0x00,0x00,0x46,0x44] 145*9880d681SAndroid Build Coastguard Worker# CHECK: ctc1 $10, $31 # encoding: [0x00,0xf8,0xca,0x44] 146*9880d681SAndroid Build Coastguard Worker# CHECK: mfc1 $6, $f7 # encoding: [0x00,0x38,0x06,0x44] 147*9880d681SAndroid Build Coastguard Worker# CHECK: mfhi $5 # encoding: [0x10,0x28,0x00,0x00] 148*9880d681SAndroid Build Coastguard Worker# CHECK: mflo $5 # encoding: [0x12,0x28,0x00,0x00] 149*9880d681SAndroid Build Coastguard Worker# CHECK: mov.d $f6, $f8 # encoding: [0x86,0x41,0x20,0x46] 150*9880d681SAndroid Build Coastguard Worker# CHECK: mov.s $f6, $f7 # encoding: [0x86,0x39,0x00,0x46] 151*9880d681SAndroid Build Coastguard Worker# CHECK: mtc1 $6, $f7 # encoding: [0x00,0x38,0x86,0x44] 152*9880d681SAndroid Build Coastguard Worker# CHECK: mthi $7 # encoding: [0x11,0x00,0xe0,0x00] 153*9880d681SAndroid Build Coastguard Worker# CHECK: mtlo $7 # encoding: [0x13,0x00,0xe0,0x00] 154*9880d681SAndroid Build Coastguard Worker# CHECK: swc1 $f9, 9158($7) # encoding: [0xc6,0x23,0xe9,0xe4] 155*9880d681SAndroid Build Coastguard Worker# CHECK: mfc0 $6, $7, 0 # encoding: [0x00,0x38,0x06,0x40] 156*9880d681SAndroid Build Coastguard Worker# CHECK: mtc0 $9, $8, 0 # encoding: [0x00,0x40,0x89,0x40] 157*9880d681SAndroid Build Coastguard Worker# CHECK: mfc2 $5, $7, 0 # encoding: [0x00,0x38,0x05,0x48] 158*9880d681SAndroid Build Coastguard Worker# CHECK: mtc2 $9, $4, 0 # encoding: [0x00,0x20,0x89,0x48] 159*9880d681SAndroid Build Coastguard Worker# CHECK: mfc0 $6, $7, 2 # encoding: [0x02,0x38,0x06,0x40] 160*9880d681SAndroid Build Coastguard Worker# CHECK: mtc0 $9, $8, 3 # encoding: [0x03,0x40,0x89,0x40] 161*9880d681SAndroid Build Coastguard Worker# CHECK: mfc2 $5, $7, 4 # encoding: [0x04,0x38,0x05,0x48] 162*9880d681SAndroid Build Coastguard Worker# CHECK: mtc2 $9, $4, 5 # encoding: [0x05,0x20,0x89,0x48] 163*9880d681SAndroid Build Coastguard Worker# CHECK: movf $2, $1, $fcc0 # encoding: [0x01,0x10,0x20,0x00] 164*9880d681SAndroid Build Coastguard Worker# CHECK: movt $2, $1, $fcc0 # encoding: [0x01,0x10,0x21,0x00] 165*9880d681SAndroid Build Coastguard Worker# CHECK: movt $4, $5, $fcc4 # encoding: [0x01,0x20,0xb1,0x00] 166*9880d681SAndroid Build Coastguard Worker# CHECK: movf.d $f4, $f6, $fcc2 # encoding: [0x11,0x31,0x28,0x46] 167*9880d681SAndroid Build Coastguard Worker# CHECK: movf.s $f4, $f6, $fcc5 # encoding: [0x11,0x31,0x14,0x46] 168*9880d681SAndroid Build Coastguard Worker# CHECK: luxc1 $f0, $6($5) # encoding: [0x05,0x00,0xa6,0x4c] 169*9880d681SAndroid Build Coastguard Worker# CHECK: suxc1 $f4, $24($5) # encoding: [0x0d,0x20,0xb8,0x4c] 170*9880d681SAndroid Build Coastguard Worker# CHECK: lwxc1 $f20, $12($14) # encoding: [0x00,0x05,0xcc,0x4d] 171*9880d681SAndroid Build Coastguard Worker# CHECK: swxc1 $f26, $18($22) # encoding: [0x08,0xd0,0xd2,0x4e] 172*9880d681SAndroid Build Coastguard Worker# CHECK: mfhc1 $17, $f4 # encoding: [0x00,0x20,0x71,0x44] 173*9880d681SAndroid Build Coastguard Worker# CHECK: mthc1 $17, $f6 # encoding: [0x00,0x30,0xf1,0x44] 174*9880d681SAndroid Build Coastguard Worker# CHECK: swc2 $4, 16($sp) # encoding: [0x10,0x00,0xa4,0xeb] 175*9880d681SAndroid Build Coastguard Worker# CHECK: sdc2 $4, 16($sp) # encoding: [0x10,0x00,0xa4,0xfb] 176*9880d681SAndroid Build Coastguard Worker# CHECK: lwc2 $11, 12($ra) # encoding: [0x0c,0x00,0xeb,0xcb] 177*9880d681SAndroid Build Coastguard Worker# CHECK: ldc2 $11, 12($ra) # encoding: [0x0c,0x00,0xeb,0xdb] 178*9880d681SAndroid Build Coastguard Worker bc1f $fcc0, $BB_1 179*9880d681SAndroid Build Coastguard Worker cfc1 $a2,$0 180*9880d681SAndroid Build Coastguard Worker ctc1 $10,$31 181*9880d681SAndroid Build Coastguard Worker mfc1 $a2,$f7 182*9880d681SAndroid Build Coastguard Worker mfhi $a1 183*9880d681SAndroid Build Coastguard Worker mflo $a1 184*9880d681SAndroid Build Coastguard Worker mov.d $f6,$f8 185*9880d681SAndroid Build Coastguard Worker mov.s $f6,$f7 186*9880d681SAndroid Build Coastguard Worker mtc1 $a2,$f7 187*9880d681SAndroid Build Coastguard Worker mthi $a3 188*9880d681SAndroid Build Coastguard Worker mtlo $a3 189*9880d681SAndroid Build Coastguard Worker swc1 $f9,9158($a3) 190*9880d681SAndroid Build Coastguard Worker mfc0 $6, $7 191*9880d681SAndroid Build Coastguard Worker mtc0 $9, $8 192*9880d681SAndroid Build Coastguard Worker mfc2 $5, $7 193*9880d681SAndroid Build Coastguard Worker mtc2 $9, $4 194*9880d681SAndroid Build Coastguard Worker mfc0 $6, $7, 2 195*9880d681SAndroid Build Coastguard Worker mtc0 $9, $8, 3 196*9880d681SAndroid Build Coastguard Worker mfc2 $5, $7, 4 197*9880d681SAndroid Build Coastguard Worker mtc2 $9, $4, 5 198*9880d681SAndroid Build Coastguard Worker movf $2, $1, $fcc0 199*9880d681SAndroid Build Coastguard Worker movt $2, $1, $fcc0 200*9880d681SAndroid Build Coastguard Worker movt $4, $5, $fcc4 201*9880d681SAndroid Build Coastguard Worker movf.d $f4, $f6, $fcc2 202*9880d681SAndroid Build Coastguard Worker movf.s $f4, $f6, $fcc5 203*9880d681SAndroid Build Coastguard Worker luxc1 $f0, $a2($a1) 204*9880d681SAndroid Build Coastguard Worker suxc1 $f4, $t8($a1) 205*9880d681SAndroid Build Coastguard Worker lwxc1 $f20, $12($14) 206*9880d681SAndroid Build Coastguard Worker swxc1 $f26, $s2($s6) 207*9880d681SAndroid Build Coastguard Worker mfhc1 $17, $f4 208*9880d681SAndroid Build Coastguard Worker mthc1 $17, $f6 209*9880d681SAndroid Build Coastguard Worker swc2 $4, 16($sp) 210*9880d681SAndroid Build Coastguard Worker sdc2 $4, 16($sp) 211*9880d681SAndroid Build Coastguard Worker lwc2 $11, 12($ra) 212*9880d681SAndroid Build Coastguard Worker ldc2 $11, 12($ra) 213