mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-26 05:32:25 +00:00
[mips] Implement ehb, ssnop, and pause in assembler
Summary: Add negative tests for pause Reviewers: matheusalmeida Reviewed By: matheusalmeida Differential Revision: http://llvm-reviews.chandlerc.com/D3246 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205537 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
3eb87654a5
commit
8750f9a291
@ -818,3 +818,14 @@ class CMov_F_F_FM<bits<5> fmt, bit tf> : StdArch {
|
||||
let Inst{10-6} = fd;
|
||||
let Inst{5-0} = 0x11;
|
||||
}
|
||||
|
||||
class BARRIER_FM<bits<5> op> : StdArch {
|
||||
bits<32> Inst;
|
||||
|
||||
let Inst{31-26} = 0; // SPECIAL
|
||||
let Inst{25-21} = 0;
|
||||
let Inst{20-16} = 0; // rt = 0
|
||||
let Inst{15-11} = 0; // rd = 0
|
||||
let Inst{10-6} = op; // Operation
|
||||
let Inst{5-0} = 0; // SLL
|
||||
}
|
||||
|
@ -1161,6 +1161,12 @@ def MTC0 : MFC3OP<"mtc0", GPR32Opnd>, MFC3OP_FM<0x10, 4>;
|
||||
def MFC2 : MFC3OP<"mfc2", GPR32Opnd>, MFC3OP_FM<0x12, 0>;
|
||||
def MTC2 : MFC3OP<"mtc2", GPR32Opnd>, MFC3OP_FM<0x12, 4>;
|
||||
|
||||
class Barrier<string asmstr> : InstSE<(outs), (ins), asmstr, [], NoItinerary,
|
||||
FrmOther>;
|
||||
def SSNOP : Barrier<"ssnop">, BARRIER_FM<1>;
|
||||
def EHB : Barrier<"ehb">, BARRIER_FM<3>;
|
||||
def PAUSE : Barrier<"pause">, BARRIER_FM<5>, Requires<[HasMips32r2]>;
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// Instruction aliases
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
@ -12,8 +12,6 @@
|
||||
tlbr
|
||||
tlbwi
|
||||
tlbwr
|
||||
ehb
|
||||
lwc0 c0_entrylo,-7321($s2)
|
||||
lwc3 $10,-32265($k0)
|
||||
ssnop
|
||||
swc0 c0_prid,18904($s3)
|
||||
|
@ -28,6 +28,7 @@
|
||||
div.d $f29,$f20,$f27
|
||||
div.s $f4,$f5,$f15
|
||||
divu $zero,$t9,$t7
|
||||
ehb # CHECK: ehb # encoding: [0x00,0x00,0x00,0xc0]
|
||||
lb $t8,-14515($t2)
|
||||
lbu $t0,30195($v1)
|
||||
lh $t3,-8556($s5)
|
||||
@ -71,6 +72,7 @@
|
||||
sltu $s4,$s5,$t3
|
||||
srav $s1,$s7,$sp
|
||||
srlv $t9,$s4,$a0
|
||||
ssnop # CHECK: ssnop # encoding: [0x00,0x00,0x00,0x40]
|
||||
sub $s6,$s3,$t4
|
||||
sub.d $f18,$f3,$f17
|
||||
sub.s $f23,$f22,$f22
|
||||
|
@ -8,11 +8,9 @@
|
||||
# XFAIL: *
|
||||
|
||||
.set noat
|
||||
ehb
|
||||
ldc3 $29,-28645($s1)
|
||||
lwc3 $10,-32265($k0)
|
||||
sdc3 $12,5835($t2)
|
||||
ssnop
|
||||
tlbp
|
||||
tlbr
|
||||
tlbwi
|
||||
|
@ -30,6 +30,7 @@
|
||||
div.d $f29,$f20,$f27
|
||||
div.s $f4,$f5,$f15
|
||||
divu $zero,$t9,$t7
|
||||
ehb # CHECK: ehb # encoding: [0x00,0x00,0x00,0xc0]
|
||||
floor.w.d $f14,$f11
|
||||
floor.w.s $f8,$f9
|
||||
lb $t8,-14515($t2)
|
||||
@ -85,6 +86,7 @@
|
||||
sqrt.s $f0,$f1
|
||||
srav $s1,$s7,$sp
|
||||
srlv $t9,$s4,$a0
|
||||
ssnop # CHECK: ssnop # encoding: [0x00,0x00,0x00,0x40]
|
||||
sub $s6,$s3,$t4
|
||||
sub.d $f18,$f3,$f17
|
||||
sub.s $f23,$f22,$f22
|
||||
|
@ -8,9 +8,7 @@
|
||||
# XFAIL: *
|
||||
|
||||
.set noat
|
||||
ehb
|
||||
lwc3 $10,-32265($k0)
|
||||
ssnop
|
||||
tlbp
|
||||
tlbr
|
||||
tlbwi
|
||||
|
@ -50,6 +50,7 @@
|
||||
dsrlv $s3,$t6,$s4
|
||||
dsub $a3,$s6,$t0
|
||||
dsubu $a1,$a1,$k0
|
||||
ehb # CHECK: ehb # encoding: [0x00,0x00,0x00,0xc0]
|
||||
eret
|
||||
floor.l.d $f26,$f7
|
||||
floor.l.s $f12,$f5
|
||||
@ -121,6 +122,7 @@
|
||||
sqrt.s $f0,$f1
|
||||
srav $s1,$s7,$sp
|
||||
srlv $t9,$s4,$a0
|
||||
ssnop # CHECK: ssnop # encoding: [0x00,0x00,0x00,0x40]
|
||||
sub $s6,$s3,$t4
|
||||
sub.d $f18,$f3,$f17
|
||||
sub.s $f23,$f22,$f22
|
||||
|
8
test/MC/Mips/mips32/invalid-mips32r2.s
Normal file
8
test/MC/Mips/mips32/invalid-mips32r2.s
Normal file
@ -0,0 +1,8 @@
|
||||
# Instructions that are invalid
|
||||
#
|
||||
# RUN: not llvm-mc %s -triple=mips-unknown-linux -show-encoding -mcpu=mips32 \
|
||||
# RUN: 2>%t1
|
||||
# RUN: FileCheck %s < %t1
|
||||
|
||||
.set noat
|
||||
pause # CHECK: requires a CPU feature not currently enabled
|
@ -35,11 +35,9 @@
|
||||
c.ult.s $fcc7,$f24,$f10
|
||||
c.un.d $fcc6,$f23,$f24
|
||||
c.un.s $fcc1,$f30,$f4
|
||||
ehb
|
||||
ldc3 $29,-28645($s1)
|
||||
rorv $t5,$a3,$s5
|
||||
sdc3 $12,5835($t2)
|
||||
ssnop
|
||||
tlbp
|
||||
tlbr
|
||||
tlbwi
|
||||
|
@ -32,6 +32,7 @@
|
||||
div.d $f29,$f20,$f27
|
||||
div.s $f4,$f5,$f15
|
||||
divu $zero,$t9,$t7
|
||||
ehb # CHECK: ehb # encoding: [0x00,0x00,0x00,0xc0]
|
||||
eret
|
||||
floor.w.d $f14,$f11
|
||||
floor.w.s $f8,$f9
|
||||
@ -109,6 +110,7 @@
|
||||
sqrt.s $f0,$f1
|
||||
srav $s1,$s7,$sp
|
||||
srlv $t9,$s4,$a0
|
||||
ssnop # CHECK: ssnop # encoding: [0x00,0x00,0x00,0x40]
|
||||
sub $s6,$s3,$t4
|
||||
sub.d $f18,$f3,$f17
|
||||
sub.s $f23,$f22,$f22
|
||||
|
@ -116,7 +116,6 @@
|
||||
dpsu.h.qbr $ac2,$a1,$s6
|
||||
dpsx.w.ph $ac0,$s7,$gp
|
||||
dvpe $s6
|
||||
ehb
|
||||
emt $t0
|
||||
evpe $v0
|
||||
extpdpv $s6,$ac0,$s8
|
||||
@ -225,7 +224,6 @@
|
||||
nor.v $w20,$w20,$w15
|
||||
or.v $w13,$w23,$w12
|
||||
packrl.ph $ra,$t8,$t6
|
||||
pause
|
||||
pcnt.b $w30,$w15
|
||||
pcnt.d $w5,$w16
|
||||
pcnt.h $w20,$w24
|
||||
@ -280,7 +278,6 @@
|
||||
shrav_r.w $s7,$s4,$s6
|
||||
shrlv.ph $t6,$t2,$t1
|
||||
shrlv.qb $a2,$s2,$t3
|
||||
ssnop
|
||||
sub.ps $f5,$f14,$f26
|
||||
subq.ph $ra,$t1,$s8
|
||||
subq_s.ph $t5,$s8,$s5
|
||||
|
@ -35,6 +35,7 @@
|
||||
div.d $f29,$f20,$f27
|
||||
div.s $f4,$f5,$f15
|
||||
divu $zero,$t9,$t7
|
||||
ehb # CHECK: ehb # encoding: [0x00,0x00,0x00,0xc0]
|
||||
ei $t6
|
||||
eret
|
||||
floor.w.d $f14,$f11
|
||||
@ -109,6 +110,7 @@
|
||||
nop
|
||||
nor $a3,$zero,$a3
|
||||
or $t4,$s0,$sp
|
||||
pause # CHECK: pause # encoding: [0x00,0x00,0x01,0x40]
|
||||
rdhwr $sp,$11
|
||||
round.w.d $f6,$f4
|
||||
round.w.s $f27,$f28
|
||||
@ -129,6 +131,7 @@
|
||||
sqrt.s $f0,$f1
|
||||
srav $s1,$s7,$sp
|
||||
srlv $t9,$s4,$a0
|
||||
ssnop # CHECK: ssnop # encoding: [0x00,0x00,0x00,0x40]
|
||||
sub $s6,$s3,$t4
|
||||
sub.d $f18,$f3,$f17
|
||||
sub.s $f23,$f22,$f22
|
||||
|
@ -36,7 +36,6 @@
|
||||
c.ult.s $fcc7,$f24,$f10
|
||||
c.un.d $fcc6,$f23,$f24
|
||||
c.un.s $fcc1,$f30,$f4
|
||||
ehb
|
||||
madd.d $f18,$f19,$f26,$f20
|
||||
madd.s $f1,$f31,$f19,$f25
|
||||
msub.d $f10,$f1,$f31,$f18
|
||||
@ -49,7 +48,6 @@
|
||||
recip.s $f3,$f30
|
||||
rsqrt.d $f3,$f28
|
||||
rsqrt.s $f4,$f8
|
||||
ssnop
|
||||
tlbp
|
||||
tlbr
|
||||
tlbwi
|
||||
|
@ -50,6 +50,7 @@
|
||||
dsrlv $s3,$t6,$s4
|
||||
dsub $a3,$s6,$t0
|
||||
dsubu $a1,$a1,$k0
|
||||
ehb # CHECK: ehb # encoding: [0x00,0x00,0x00,0xc0]
|
||||
eret
|
||||
floor.l.d $f26,$f7
|
||||
floor.l.s $f12,$f5
|
||||
@ -136,6 +137,7 @@
|
||||
sqrt.s $f0,$f1
|
||||
srav $s1,$s7,$sp
|
||||
srlv $t9,$s4,$a0
|
||||
ssnop # CHECK: ssnop # encoding: [0x00,0x00,0x00,0x40]
|
||||
sub $s6,$s3,$t4
|
||||
sub.d $f18,$f3,$f17
|
||||
sub.s $f23,$f22,$f22
|
||||
|
@ -58,7 +58,6 @@
|
||||
cvt.ps.s $f3,$f18,$f19
|
||||
cvt.s.pl $f30,$f1
|
||||
cvt.s.pu $f14,$f25
|
||||
ehb
|
||||
madd.d $f18,$f19,$f26,$f20
|
||||
madd.ps $f22,$f3,$f14,$f3
|
||||
madd.s $f1,$f31,$f19,$f25
|
||||
@ -86,7 +85,6 @@
|
||||
recip.s $f3,$f30
|
||||
rsqrt.d $f3,$f28
|
||||
rsqrt.s $f4,$f8
|
||||
ssnop
|
||||
sub.ps $f5,$f14,$f26
|
||||
tlbp
|
||||
tlbr
|
||||
|
@ -50,6 +50,7 @@
|
||||
dsrlv $s3,$t6,$s4
|
||||
dsub $a3,$s6,$t0
|
||||
dsubu $a1,$a1,$k0
|
||||
ehb # CHECK: ehb # encoding: [0x00,0x00,0x00,0xc0]
|
||||
eret
|
||||
floor.l.d $f26,$f7
|
||||
floor.l.s $f12,$f5
|
||||
@ -137,6 +138,7 @@
|
||||
sqrt.s $f0,$f1
|
||||
srav $s1,$s7,$sp
|
||||
srlv $t9,$s4,$a0
|
||||
ssnop # CHECK: ssnop # encoding: [0x00,0x00,0x00,0x40]
|
||||
sub $s6,$s3,$t4
|
||||
sub.d $f18,$f3,$f17
|
||||
sub.s $f23,$f22,$f22
|
||||
|
8
test/MC/Mips/mips64/invalid-mips64r2.s
Normal file
8
test/MC/Mips/mips64/invalid-mips64r2.s
Normal file
@ -0,0 +1,8 @@
|
||||
# Instructions that are invalid
|
||||
#
|
||||
# RUN: not llvm-mc %s -triple=mips64-unknown-linux -show-encoding -mcpu=mips64 \
|
||||
# RUN: 2>%t1
|
||||
# RUN: FileCheck %s < %t1
|
||||
|
||||
.set noat
|
||||
pause # CHECK: requires a CPU feature not currently enabled
|
@ -62,7 +62,6 @@
|
||||
cvt.s.pu $f14,$f25
|
||||
dmfc0 $t2,c0_watchhi,2
|
||||
dmtc0 $t7,c0_datalo
|
||||
ehb
|
||||
madd.d $f18,$f19,$f26,$f20
|
||||
madd.ps $f22,$f3,$f14,$f3
|
||||
madd.s $f1,$f31,$f19,$f25
|
||||
@ -92,7 +91,6 @@
|
||||
recip.s $f3,$f30
|
||||
rsqrt.d $f3,$f28
|
||||
rsqrt.s $f4,$f8
|
||||
ssnop
|
||||
sub.ps $f5,$f14,$f26
|
||||
tlbp
|
||||
tlbr
|
||||
|
@ -54,6 +54,7 @@
|
||||
dsrlv $s3,$t6,$s4
|
||||
dsub $a3,$s6,$t0
|
||||
dsubu $a1,$a1,$k0
|
||||
ehb # CHECK: ehb # encoding: [0x00,0x00,0x00,0xc0]
|
||||
eret
|
||||
floor.l.d $f26,$f7
|
||||
floor.l.s $f12,$f5
|
||||
@ -150,6 +151,7 @@
|
||||
sqrt.s $f0,$f1
|
||||
srav $s1,$s7,$sp
|
||||
srlv $t9,$s4,$a0
|
||||
ssnop # CHECK: ssnop # encoding: [0x00,0x00,0x00,0x40]
|
||||
sub $s6,$s3,$t4
|
||||
sub.d $f18,$f3,$f17
|
||||
sub.s $f23,$f22,$f22
|
||||
|
@ -119,7 +119,6 @@
|
||||
dpsx.w.ph $ac0,$s7,$gp
|
||||
drorv $at,$a1,$s7
|
||||
dvpe $s6
|
||||
ehb
|
||||
emt $t0
|
||||
evpe $v0
|
||||
extpdpv $s6,$ac0,$s8
|
||||
@ -231,7 +230,6 @@
|
||||
nor.v $w20,$w20,$w15
|
||||
or.v $w13,$w23,$w12
|
||||
packrl.ph $ra,$t8,$t6
|
||||
pause
|
||||
pcnt.b $w30,$w15
|
||||
pcnt.d $w5,$w16
|
||||
pcnt.h $w20,$w24
|
||||
@ -283,7 +281,6 @@
|
||||
shrav_r.w $s7,$s4,$s6
|
||||
shrlv.ph $t6,$t2,$t1
|
||||
shrlv.qb $a2,$s2,$t3
|
||||
ssnop
|
||||
sub.ps $f5,$f14,$f26
|
||||
subq.ph $ra,$t1,$s8
|
||||
subq_s.ph $t5,$s8,$s5
|
||||
|
@ -57,6 +57,7 @@
|
||||
dsrlv $s3,$t6,$s4
|
||||
dsub $a3,$s6,$t0
|
||||
dsubu $a1,$a1,$k0
|
||||
ehb # CHECK: ehb # encoding: [0x00,0x00,0x00,0xc0]
|
||||
ei $t6
|
||||
eret
|
||||
floor.l.d $f26,$f7
|
||||
@ -136,6 +137,7 @@
|
||||
nop
|
||||
nor $a3,$zero,$a3
|
||||
or $t4,$s0,$sp
|
||||
pause # CHECK: pause # encoding: [0x00,0x00,0x01,0x40]
|
||||
rdhwr $sp,$11
|
||||
round.l.d $f12,$f1
|
||||
round.l.s $f25,$f5
|
||||
@ -162,6 +164,7 @@
|
||||
sqrt.s $f0,$f1
|
||||
srav $s1,$s7,$sp
|
||||
srlv $t9,$s4,$a0
|
||||
ssnop # CHECK: ssnop # encoding: [0x00,0x00,0x00,0x40]
|
||||
sub $s6,$s3,$t4
|
||||
sub.d $f18,$f3,$f17
|
||||
sub.s $f23,$f22,$f22
|
||||
|
Loading…
Reference in New Issue
Block a user