mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-24 23:28:41 +00:00
Add MC assembly/disassembly support for VRINT{A, N, P, M} to V8FP.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185929 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1522,6 +1522,32 @@ class ADuI<bits<5> opcod1, bits<2> opcod2, bits<4> opcod3, bits<2> opcod4,
|
||||
let Inst{4} = opcod5;
|
||||
}
|
||||
|
||||
// Double precision, unary, not-predicated
|
||||
class ADuInp<bits<5> opcod1, bits<2> opcod2, bits<4> opcod3, bits<2> opcod4,
|
||||
bit opcod5, dag oops, dag iops, InstrItinClass itin,
|
||||
string asm, list<dag> pattern>
|
||||
: VFPXI<oops, iops, AddrModeNone, 4, IndexModeNone, VFPUnaryFrm, itin, asm, "", pattern> {
|
||||
// Instruction operands.
|
||||
bits<5> Dd;
|
||||
bits<5> Dm;
|
||||
|
||||
let Inst{31-28} = 0b1111;
|
||||
|
||||
// Encode instruction operands.
|
||||
let Inst{3-0} = Dm{3-0};
|
||||
let Inst{5} = Dm{4};
|
||||
let Inst{15-12} = Dd{3-0};
|
||||
let Inst{22} = Dd{4};
|
||||
|
||||
let Inst{27-23} = opcod1;
|
||||
let Inst{21-20} = opcod2;
|
||||
let Inst{19-16} = opcod3;
|
||||
let Inst{11-9} = 0b101;
|
||||
let Inst{8} = 1; // Double precision
|
||||
let Inst{7-6} = opcod4;
|
||||
let Inst{4} = opcod5;
|
||||
}
|
||||
|
||||
// Double precision, binary
|
||||
class ADbI<bits<5> opcod1, bits<2> opcod2, bit op6, bit op4, dag oops,
|
||||
dag iops, InstrItinClass itin, string opc, string asm,
|
||||
|
@@ -669,6 +669,33 @@ defm VRINTZ : vrint_inst_zrx<"z", 0, 1>;
|
||||
defm VRINTR : vrint_inst_zrx<"r", 0, 0>;
|
||||
defm VRINTX : vrint_inst_zrx<"x", 1, 0>;
|
||||
|
||||
multiclass vrint_inst_anpm<string opc, bits<2> rm> {
|
||||
let PostEncoderMethod = "" in {
|
||||
def S : ASuInp<0b11101, 0b11, 0b1000, 0b01, 0,
|
||||
(outs SPR:$Sd), (ins SPR:$Sm),
|
||||
NoItinerary, !strconcat("vrint", opc, ".f32\t$Sd, $Sm"),
|
||||
[]>, Requires<[HasV8FP]> {
|
||||
let Inst{17-16} = rm;
|
||||
}
|
||||
def D : ADuInp<0b11101, 0b11, 0b1000, 0b01, 0,
|
||||
(outs DPR:$Dd), (ins DPR:$Dm),
|
||||
NoItinerary, !strconcat("vrint", opc, ".f64\t$Dd, $Dm"),
|
||||
[]>, Requires<[HasV8FP]> {
|
||||
let Inst{17-16} = rm;
|
||||
}
|
||||
}
|
||||
|
||||
def : InstAlias<!strconcat("vrint", opc, ".f32.f32\t$Sd, $Sm"),
|
||||
(!cast<Instruction>(NAME#"S") SPR:$Sd, SPR:$Sm)>;
|
||||
def : InstAlias<!strconcat("vrint", opc, ".f64.f64\t$Dd, $Dm"),
|
||||
(!cast<Instruction>(NAME#"D") DPR:$Dd, DPR:$Dm)>;
|
||||
}
|
||||
|
||||
defm VRINTA : vrint_inst_anpm<"a", 0b00>;
|
||||
defm VRINTN : vrint_inst_anpm<"n", 0b01>;
|
||||
defm VRINTP : vrint_inst_anpm<"p", 0b10>;
|
||||
defm VRINTM : vrint_inst_anpm<"m", 0b11>;
|
||||
|
||||
def VSQRTD : ADuI<0b11101, 0b11, 0b0001, 0b11, 0,
|
||||
(outs DPR:$Dd), (ins DPR:$Dm),
|
||||
IIC_fpSQRT64, "vsqrt", ".f64\t$Dd, $Dm",
|
||||
|
@@ -4906,8 +4906,9 @@ StringRef ARMAsmParser::splitMnemonic(StringRef Mnemonic,
|
||||
Mnemonic == "umaal" || Mnemonic == "umlal" || Mnemonic == "vabal" ||
|
||||
Mnemonic == "vmlal" || Mnemonic == "vpadal" || Mnemonic == "vqdmlal" ||
|
||||
Mnemonic == "fmuls" || Mnemonic == "vmaxnm" || Mnemonic == "vminnm" ||
|
||||
Mnemonic == "vcvta" || Mnemonic == "vcvtn" || Mnemonic == "vcvtp" ||
|
||||
Mnemonic == "vcvtm" || Mnemonic.startswith("vsel"))
|
||||
Mnemonic == "vcvta" || Mnemonic == "vcvtn" || Mnemonic == "vcvtp" ||
|
||||
Mnemonic == "vcvtm" || Mnemonic == "vrinta" || Mnemonic == "vrintn" ||
|
||||
Mnemonic == "vrintp" || Mnemonic == "vrintm" || Mnemonic.startswith("vsel"))
|
||||
return Mnemonic;
|
||||
|
||||
// First, split out any predication code. Ignore mnemonics we know aren't
|
||||
@@ -5009,7 +5010,9 @@ getMnemonicAcceptInfo(StringRef Mnemonic, bool &CanAcceptCarrySet,
|
||||
Mnemonic == "trap" || Mnemonic == "setend" ||
|
||||
Mnemonic.startswith("cps") || Mnemonic.startswith("vsel") ||
|
||||
Mnemonic == "vmaxnm" || Mnemonic == "vminnm" || Mnemonic == "vcvta" ||
|
||||
Mnemonic == "vcvtn" || Mnemonic == "vcvtp" || Mnemonic == "vcvtm") {
|
||||
Mnemonic == "vcvtn" || Mnemonic == "vcvtp" || Mnemonic == "vcvtm" ||
|
||||
Mnemonic == "vrinta" || Mnemonic == "vrintn" || Mnemonic == "vrintp" ||
|
||||
Mnemonic == "vrintm") {
|
||||
// These mnemonics are never predicable
|
||||
CanAcceptPredicationCode = false;
|
||||
} else if (!isThumb()) {
|
||||
|
Reference in New Issue
Block a user