1# RUN: llvm-mc %s -triple=mipsel -show-encoding -mattr=micromips \ 2# RUN: -mcpu=mips32r2 | FileCheck -check-prefix=CHECK-EL %s 3# RUN: llvm-mc %s -triple=mips -show-encoding -mattr=micromips \ 4# RUN: -mcpu=mips32r2 | FileCheck -check-prefix=CHECK-EB %s 5# Check that the assembler can handle the documented syntax 6# for fpu instructions 7#------------------------------------------------------------------------------ 8# FPU Instructions 9#------------------------------------------------------------------------------ 10# Little endian 11#------------------------------------------------------------------------------ 12# CHECK-EL: add.s $f4, $f6, $f8 # encoding: [0x06,0x55,0x30,0x20] 13# CHECK-EL: add.d $f4, $f6, $f8 # encoding: [0x06,0x55,0x30,0x21] 14# CHECK-EL: div.s $f4, $f6, $f8 # encoding: [0x06,0x55,0xf0,0x20] 15# CHECK-EL: div.d $f4, $f6, $f8 # encoding: [0x06,0x55,0xf0,0x21] 16# CHECK-EL: mul.s $f4, $f6, $f8 # encoding: [0x06,0x55,0xb0,0x20] 17# CHECK-EL: mul.d $f4, $f6, $f8 # encoding: [0x06,0x55,0xb0,0x21] 18# CHECK-EL: sub.s $f4, $f6, $f8 # encoding: [0x06,0x55,0x70,0x20] 19# CHECK-EL: sub.d $f4, $f6, $f8 # encoding: [0x06,0x55,0x70,0x21] 20# CHECK-EL: lwc1 $f2, 4($6) # encoding: [0x46,0x9c,0x04,0x00] 21# CHECK-EL: ldc1 $f2, 4($6) # encoding: [0x46,0xbc,0x04,0x00] 22# CHECK-EL: swc1 $f2, 4($6) # encoding: [0x46,0x98,0x04,0x00] 23# CHECK-EL: sdc1 $f2, 4($6) # encoding: [0x46,0xb8,0x04,0x00] 24# CHECK-EL: bc1f 1332 # encoding: [0x80,0x43,0x9a,0x02] 25# CHECK-EL: nop # encoding: [0x00,0x00,0x00,0x00] 26# CHECK-EL: bc1t 1332 # encoding: [0xa0,0x43,0x9a,0x02] 27# CHECK-EL: nop # encoding: [0x00,0x00,0x00,0x00] 28# CHECK-EL: luxc1 $f2, $4($6) # encoding: [0x86,0x54,0x48,0x11] 29# CHECK-EL: suxc1 $f2, $4($6) # encoding: [0x86,0x54,0x88,0x11] 30# CHECK-EL: ceil.w.s $f6, $f8 # encoding: [0xc8,0x54,0x3b,0x1b] 31# CHECK-EL: ceil.w.d $f6, $f8 # encoding: [0xc8,0x54,0x3b,0x5b] 32# CHECK-EL: cvt.w.s $f6, $f8 # encoding: [0xc8,0x54,0x3b,0x09] 33# CHECK-EL: cvt.w.d $f6, $f8 # encoding: [0xc8,0x54,0x3b,0x49] 34# CHECK-EL: floor.w.s $f6, $f8 # encoding: [0xc8,0x54,0x3b,0x0b] 35# CHECK-EL: floor.w.d $f6, $f8 # encoding: [0xc8,0x54,0x3b,0x4b] 36# CHECK-EL: round.w.s $f6, $f8 # encoding: [0xc8,0x54,0x3b,0x3b] 37# CHECK-EL: round.w.d $f6, $f8 # encoding: [0xc8,0x54,0x3b,0x7b] 38# CHECK-EL: sqrt.s $f6, $f8 # encoding: [0xc8,0x54,0x3b,0x0a] 39# CHECK-EL: sqrt.d $f6, $f8 # encoding: [0xc8,0x54,0x3b,0x4a] 40# CHECK-EL: trunc.w.s $f6, $f8 # encoding: [0xc8,0x54,0x3b,0x2b] 41# CHECK-EL: trunc.w.d $f6, $f8 # encoding: [0xc8,0x54,0x3b,0x6b] 42# CHECK-EL: abs.s $f6, $f8 # encoding: [0xc8,0x54,0x7b,0x03] 43# CHECK-EL: abs.d $f6, $f8 # encoding: [0xc8,0x54,0x7b,0x23] 44# CHECK-EL: mov.s $f6, $f8 # encoding: [0xc8,0x54,0x7b,0x00] 45# CHECK-EL: mov.d $f6, $f8 # encoding: [0xc8,0x54,0x7b,0x20] 46# CHECK-EL: neg.s $f6, $f8 # encoding: [0xc8,0x54,0x7b,0x0b] 47# CHECK-EL: neg.d $f6, $f8 # encoding: [0xc8,0x54,0x7b,0x2b] 48# CHECK-EL: cvt.d.s $f6, $f8 # encoding: [0xc8,0x54,0x7b,0x13] 49# CHECK-EL: cvt.d.w $f6, $f8 # encoding: [0xc8,0x54,0x7b,0x33] 50# CHECK-EL: cvt.s.d $f6, $f8 # encoding: [0xc8,0x54,0x7b,0x1b] 51# CHECK-EL: cvt.s.w $f6, $f8 # encoding: [0xc8,0x54,0x7b,0x3b] 52# CHECK-EL: cfc1 $6, $0 # encoding: [0xc0,0x54,0x3b,0x10] 53# CHECK-EL: ctc1 $6, $0 # encoding: [0xc0,0x54,0x3b,0x18] 54# CHECK-EL: mfc1 $6, $f8 # encoding: [0xc8,0x54,0x3b,0x20] 55# CHECK-EL: mtc1 $6, $f8 # encoding: [0xc8,0x54,0x3b,0x28] 56# CHECK-EL: movz.s $f4, $f6, $7 # encoding: [0xe6,0x54,0x78,0x20] 57# CHECK-EL: movz.d $f4, $f6, $7 # encoding: [0xe6,0x54,0x78,0x21] 58# CHECK-EL: movn.s $f4, $f6, $7 # encoding: [0xe6,0x54,0x38,0x20] 59# CHECK-EL: movn.d $f4, $f6, $7 # encoding: [0xe6,0x54,0x38,0x21] 60# CHECK-EL: movt.s $f4, $f6, $fcc0 # encoding: [0x86,0x54,0x60,0x00] 61# CHECK-EL: movt.d $f4, $f6, $fcc0 # encoding: [0x86,0x54,0x60,0x02] 62# CHECK-EL: movf.s $f4, $f6, $fcc0 # encoding: [0x86,0x54,0x20,0x00] 63# CHECK-EL: movf.d $f4, $f6, $fcc0 # encoding: [0x86,0x54,0x20,0x02] 64# CHECK-EL: madd.s $f2, $f4, $f6, $f8 # encoding: [0x06,0x55,0x01,0x11] 65# CHECK-EL: madd.d $f2, $f4, $f6, $f8 # encoding: [0x06,0x55,0x09,0x11] 66# CHECK-EL: msub.s $f2, $f4, $f6, $f8 # encoding: [0x06,0x55,0x21,0x11] 67# CHECK-EL: msub.d $f2, $f4, $f6, $f8 # encoding: [0x06,0x55,0x29,0x11] 68# CHECK-EL: nmadd.s $f2, $f4, $f6, $f8 # encoding: [0x06,0x55,0x02,0x11] 69# CHECK-EL: nmadd.d $f2, $f4, $f6, $f8 # encoding: [0x06,0x55,0x0a,0x11] 70# CHECK-EL: nmsub.s $f2, $f4, $f6, $f8 # encoding: [0x06,0x55,0x22,0x11] 71# CHECK-EL: nmsub.d $f2, $f4, $f6, $f8 # encoding: [0x06,0x55,0x2a,0x11] 72#------------------------------------------------------------------------------ 73# Big endian 74#------------------------------------------------------------------------------ 75# CHECK-EB: add.s $f4, $f6, $f8 # encoding: [0x55,0x06,0x20,0x30] 76# CHECK-EB: add.d $f4, $f6, $f8 # encoding: [0x55,0x06,0x21,0x30] 77# CHECK-EB: div.s $f4, $f6, $f8 # encoding: [0x55,0x06,0x20,0xf0] 78# CHECK-EB: div.d $f4, $f6, $f8 # encoding: [0x55,0x06,0x21,0xf0] 79# CHECK-EB: mul.s $f4, $f6, $f8 # encoding: [0x55,0x06,0x20,0xb0] 80# CHECK-EB: mul.d $f4, $f6, $f8 # encoding: [0x55,0x06,0x21,0xb0] 81# CHECK-EB: sub.s $f4, $f6, $f8 # encoding: [0x55,0x06,0x20,0x70] 82# CHECK-EB: sub.d $f4, $f6, $f8 # encoding: [0x55,0x06,0x21,0x70] 83# CHECK-EB: lwc1 $f2, 4($6) # encoding: [0x9c,0x46,0x00,0x04] 84# CHECK-EB: ldc1 $f2, 4($6) # encoding: [0xbc,0x46,0x00,0x04] 85# CHECK-EB: swc1 $f2, 4($6) # encoding: [0x98,0x46,0x00,0x04] 86# CHECK-EB: sdc1 $f2, 4($6) # encoding: [0xb8,0x46,0x00,0x04] 87# CHECK-EB: bc1f 1332 # encoding: [0x43,0x80,0x02,0x9a] 88# CHECK-EB: nop # encoding: [0x00,0x00,0x00,0x00] 89# CHECK-EB: bc1t 1332 # encoding: [0x43,0xa0,0x02,0x9a] 90# CHECK-EB: nop # encoding: [0x00,0x00,0x00,0x00] 91# CHECK-EB: luxc1 $f2, $4($6) # encoding: [0x54,0x86,0x11,0x48] 92# CHECK-EB: suxc1 $f2, $4($6) # encoding: [0x54,0x86,0x11,0x88] 93# CHECK-EB: ceil.w.s $f6, $f8 # encoding: [0x54,0xc8,0x1b,0x3b] 94# CHECK-EB: ceil.w.d $f6, $f8 # encoding: [0x54,0xc8,0x5b,0x3b] 95# CHECK-EB: cvt.w.s $f6, $f8 # encoding: [0x54,0xc8,0x09,0x3b] 96# CHECK-EB: cvt.w.d $f6, $f8 # encoding: [0x54,0xc8,0x49,0x3b] 97# CHECK-EB: floor.w.s $f6, $f8 # encoding: [0x54,0xc8,0x0b,0x3b] 98# CHECK-EB: floor.w.d $f6, $f8 # encoding: [0x54,0xc8,0x4b,0x3b] 99# CHECK-EB: round.w.s $f6, $f8 # encoding: [0x54,0xc8,0x3b,0x3b] 100# CHECK-EB: round.w.d $f6, $f8 # encoding: [0x54,0xc8,0x7b,0x3b] 101# CHECK-EB: sqrt.s $f6, $f8 # encoding: [0x54,0xc8,0x0a,0x3b] 102# CHECK-EB: sqrt.d $f6, $f8 # encoding: [0x54,0xc8,0x4a,0x3b] 103# CHECK-EB: trunc.w.s $f6, $f8 # encoding: [0x54,0xc8,0x2b,0x3b] 104# CHECK-EB: trunc.w.d $f6, $f8 # encoding: [0x54,0xc8,0x6b,0x3b] 105# CHECK-EB: abs.s $f6, $f8 # encoding: [0x54,0xc8,0x03,0x7b] 106# CHECK-EB: abs.d $f6, $f8 # encoding: [0x54,0xc8,0x23,0x7b] 107# CHECK-EB: mov.s $f6, $f8 # encoding: [0x54,0xc8,0x00,0x7b] 108# CHECK-EB: mov.d $f6, $f8 # encoding: [0x54,0xc8,0x20,0x7b] 109# CHECK-EB: neg.s $f6, $f8 # encoding: [0x54,0xc8,0x0b,0x7b] 110# CHECK-EB: neg.d $f6, $f8 # encoding: [0x54,0xc8,0x2b,0x7b] 111# CHECK-EB: cvt.d.s $f6, $f8 # encoding: [0x54,0xc8,0x13,0x7b] 112# CHECK-EB: cvt.d.w $f6, $f8 # encoding: [0x54,0xc8,0x33,0x7b] 113# CHECK-EB: cvt.s.d $f6, $f8 # encoding: [0x54,0xc8,0x1b,0x7b] 114# CHECK-EB: cvt.s.w $f6, $f8 # encoding: [0x54,0xc8,0x3b,0x7b] 115# CHECK-EB: cfc1 $6, $0 # encoding: [0x54,0xc0,0x10,0x3b] 116# CHECK-EB: ctc1 $6, $0 # encoding: [0x54,0xc0,0x18,0x3b] 117# CHECK-EB: mfc1 $6, $f8 # encoding: [0x54,0xc8,0x20,0x3b] 118# CHECK-EB: mtc1 $6, $f8 # encoding: [0x54,0xc8,0x28,0x3b] 119# CHECK-EB: movz.s $f4, $f6, $7 # encoding: [0x54,0xe6,0x20,0x78] 120# CHECK-EB: movz.d $f4, $f6, $7 # encoding: [0x54,0xe6,0x21,0x78] 121# CHECK-EB: movn.s $f4, $f6, $7 # encoding: [0x54,0xe6,0x20,0x38] 122# CHECK-EB: movn.d $f4, $f6, $7 # encoding: [0x54,0xe6,0x21,0x38] 123# CHECK-EB: movt.s $f4, $f6, $fcc0 # encoding: [0x54,0x86,0x00,0x60] 124# CHECK-EB: movt.d $f4, $f6, $fcc0 # encoding: [0x54,0x86,0x02,0x60] 125# CHECK-EB: movf.s $f4, $f6, $fcc0 # encoding: [0x54,0x86,0x00,0x20] 126# CHECK-EB: movf.d $f4, $f6, $fcc0 # encoding: [0x54,0x86,0x02,0x20] 127# CHECK-EB: madd.s $f2, $f4, $f6, $f8 # encoding: [0x55,0x06,0x11,0x01] 128# CHECK-EB: madd.d $f2, $f4, $f6, $f8 # encoding: [0x55,0x06,0x11,0x09] 129# CHECK-EB: msub.s $f2, $f4, $f6, $f8 # encoding: [0x55,0x06,0x11,0x21] 130# CHECK-EB: msub.d $f2, $f4, $f6, $f8 # encoding: [0x55,0x06,0x11,0x29] 131# CHECK-EB: nmadd.s $f2, $f4, $f6, $f8 # encoding: [0x55,0x06,0x11,0x02] 132# CHECK-EB: nmadd.d $f2, $f4, $f6, $f8 # encoding: [0x55,0x06,0x11,0x0a] 133# CHECK-EB: nmsub.s $f2, $f4, $f6, $f8 # encoding: [0x55,0x06,0x11,0x22] 134# CHECK-EB: nmsub.d $f2, $f4, $f6, $f8 # encoding: [0x55,0x06,0x11,0x2a] 135 136 add.s $f4, $f6, $f8 137 add.d $f4, $f6, $f8 138 div.s $f4, $f6, $f8 139 div.d $f4, $f6, $f8 140 mul.s $f4, $f6, $f8 141 mul.d $f4, $f6, $f8 142 sub.s $f4, $f6, $f8 143 sub.d $f4, $f6, $f8 144 lwc1 $f2, 4($6) 145 ldc1 $f2, 4($6) 146 swc1 $f2, 4($6) 147 sdc1 $f2, 4($6) 148 bc1f 1332 149 bc1t 1332 150 luxc1 $f2, $4($6) 151 suxc1 $f2, $4($6) 152 ceil.w.s $f6, $f8 153 ceil.w.d $f6, $f8 154 cvt.w.s $f6, $f8 155 cvt.w.d $f6, $f8 156 floor.w.s $f6, $f8 157 floor.w.d $f6, $f8 158 round.w.s $f6, $f8 159 round.w.d $f6, $f8 160 sqrt.s $f6, $f8 161 sqrt.d $f6, $f8 162 trunc.w.s $f6, $f8 163 trunc.w.d $f6, $f8 164 abs.s $f6, $f8 165 abs.d $f6, $f8 166 mov.s $f6, $f8 167 mov.d $f6, $f8 168 neg.s $f6, $f8 169 neg.d $f6, $f8 170 cvt.d.s $f6, $f8 171 cvt.d.w $f6, $f8 172 cvt.s.d $f6, $f8 173 cvt.s.w $f6, $f8 174 cfc1 $6, $0 175 ctc1 $6, $0 176 mfc1 $6, $f8 177 mtc1 $6, $f8 178 movz.s $f4, $f6, $7 179 movz.d $f4, $f6, $7 180 movn.s $f4, $f6, $7 181 movn.d $f4, $f6, $7 182 movt.s $f4, $f6, $fcc0 183 movt.d $f4, $f6, $fcc0 184 movf.s $f4, $f6, $fcc0 185 movf.d $f4, $f6, $fcc0 186 madd.s $f2, $f4, $f6, $f8 187 madd.d $f2, $f4, $f6, $f8 188 msub.s $f2, $f4, $f6, $f8 189 msub.d $f2, $f4, $f6, $f8 190 nmadd.s $f2, $f4, $f6, $f8 191 nmadd.d $f2, $f4, $f6, $f8 192 nmsub.s $f2, $f4, $f6, $f8 193 nmsub.d $f2, $f4, $f6, $f8 194