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