mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-11-02 22:23:10 +00:00
[SystemZ] Add floating-point load-and-test instructions
These instructions can also be used as comparisons with zero. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187882 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -39,6 +39,17 @@ let neverHasSideEffects = 1 in {
|
||||
def LXR : UnaryRRE<"lx", 0xB365, null_frag, FP128, FP128>;
|
||||
}
|
||||
|
||||
// Moves between two floating-point registers that also set the condition
|
||||
// codes.
|
||||
let Defs = [CC] in {
|
||||
defm LTEBR : LoadAndTestRRE<"lteb", 0xB302, FP32>;
|
||||
defm LTDBR : LoadAndTestRRE<"ltdb", 0xB312, FP64>;
|
||||
defm LTXBR : LoadAndTestRRE<"ltxb", 0xB342, FP128>;
|
||||
}
|
||||
def : CompareZeroFP<LTEBRCompare, FP32>;
|
||||
def : CompareZeroFP<LTDBRCompare, FP64>;
|
||||
def : CompareZeroFP<LTXBRCompare, FP128>;
|
||||
|
||||
// Moves between 64-bit integer and floating-point registers.
|
||||
def LGDR : UnaryRRE<"lgd", 0xB3CD, bitconvert, GR64, FP64>;
|
||||
def LDGR : UnaryRRE<"ldg", 0xB3C1, bitconvert, FP64, GR64>;
|
||||
|
||||
@@ -1289,6 +1289,15 @@ class RotateSelectRIEf<string mnemonic, bits<16> opcode, RegisterOperand cls1,
|
||||
let DisableEncoding = "$R1src";
|
||||
}
|
||||
|
||||
// A floating-point load-and test operation. Create both a normal unary
|
||||
// operation and one that acts as a comparison against zero.
|
||||
multiclass LoadAndTestRRE<string mnemonic, bits<16> opcode,
|
||||
RegisterOperand cls> {
|
||||
def "" : UnaryRRE<mnemonic, opcode, null_frag, cls, cls>;
|
||||
let isCodeGenOnly = 1 in
|
||||
def Compare : CompareRRE<mnemonic, opcode, null_frag, cls, cls>;
|
||||
}
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// Pseudo instructions
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
@@ -79,3 +79,9 @@ multiclass MVCLoadStore<SDPatternOperator load, SDPatternOperator store,
|
||||
bdaddr12only:$src),
|
||||
(insn bdaddr12only:$dest, bdaddr12only:$src, length)>;
|
||||
}
|
||||
|
||||
// Record that INSN is a LOAD AND TEST that can be used to compare
|
||||
// registers in CLS against zero. The instruction has separate R1 and R2
|
||||
// operands, but they must be the same when the instruction is used like this.
|
||||
class CompareZeroFP<Instruction insn, RegisterOperand cls>
|
||||
: Pat<(z_cmp cls:$reg, (fpimm0)), (insn cls:$reg, cls:$reg)>;
|
||||
|
||||
Reference in New Issue
Block a user