mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-04-05 17:39:16 +00:00
Add patterns for SHLD64* and SHRD64*.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41975 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
2204906892
commit
e47f1f9633
@ -338,7 +338,9 @@ MachineInstr *X86InstrInfo::commuteInstruction(MachineInstr *MI) const {
|
||||
case X86::SHRD16rri8: // A = SHRD16rri8 B, C, I -> A = SHLD16rri8 C, B, (16-I)
|
||||
case X86::SHLD16rri8: // A = SHLD16rri8 B, C, I -> A = SHRD16rri8 C, B, (16-I)
|
||||
case X86::SHRD32rri8: // A = SHRD32rri8 B, C, I -> A = SHLD32rri8 C, B, (32-I)
|
||||
case X86::SHLD32rri8:{// A = SHLD32rri8 B, C, I -> A = SHRD32rri8 C, B, (32-I)
|
||||
case X86::SHLD32rri8: // A = SHLD32rri8 B, C, I -> A = SHRD32rri8 C, B, (32-I)
|
||||
case X86::SHRD64rri8: // A = SHRD64rri8 B, C, I -> A = SHLD64rri8 C, B, (64-I)
|
||||
case X86::SHLD64rri8:{// A = SHLD64rri8 B, C, I -> A = SHRD64rri8 C, B, (64-I)
|
||||
unsigned Opc;
|
||||
unsigned Size;
|
||||
switch (MI->getOpcode()) {
|
||||
@ -347,6 +349,8 @@ MachineInstr *X86InstrInfo::commuteInstruction(MachineInstr *MI) const {
|
||||
case X86::SHLD16rri8: Size = 16; Opc = X86::SHRD16rri8; break;
|
||||
case X86::SHRD32rri8: Size = 32; Opc = X86::SHLD32rri8; break;
|
||||
case X86::SHLD32rri8: Size = 32; Opc = X86::SHRD32rri8; break;
|
||||
case X86::SHRD64rri8: Size = 64; Opc = X86::SHLD64rri8; break;
|
||||
case X86::SHLD64rri8: Size = 64; Opc = X86::SHRD64rri8; break;
|
||||
}
|
||||
unsigned Amt = MI->getOperand(3).getImmedValue();
|
||||
unsigned A = MI->getOperand(0).getReg();
|
||||
|
@ -564,38 +564,50 @@ def ROR64m1 : RI<0xD1, MRM1m, (outs), (ins i64mem:$dst),
|
||||
let isTwoAddress = 1 in {
|
||||
let Uses = [CL] in {
|
||||
def SHLD64rrCL : RI<0xA5, MRMDestReg, (outs GR64:$dst), (ins GR64:$src1, GR64:$src2),
|
||||
"shld{q}\t{%cl, $src2, $dst|$dst, $src2, %CL}", []>, TB;
|
||||
"shld{q}\t{%cl, $src2, $dst|$dst, $src2, %CL}",
|
||||
[(set GR64:$dst, (X86shld GR64:$src1, GR64:$src2, CL))]>, TB;
|
||||
def SHRD64rrCL : RI<0xAD, MRMDestReg, (outs GR64:$dst), (ins GR64:$src1, GR64:$src2),
|
||||
"shrd{q}\t{%cl, $src2, $dst|$dst, $src2, %CL}", []>, TB;
|
||||
"shrd{q}\t{%cl, $src2, $dst|$dst, $src2, %CL}",
|
||||
[(set GR64:$dst, (X86shrd GR64:$src1, GR64:$src2, CL))]>, TB;
|
||||
}
|
||||
|
||||
let isCommutable = 1 in { // FIXME: Update X86InstrInfo::commuteInstruction
|
||||
def SHLD64rri8 : RIi8<0xA4, MRMDestReg,
|
||||
(outs GR64:$dst), (ins GR64:$src1, GR64:$src2, i8imm:$src3),
|
||||
"shld{q}\t{$src3, $src2, $dst|$dst, $src2, $src3}", []>,
|
||||
TB;
|
||||
"shld{q}\t{$src3, $src2, $dst|$dst, $src2, $src3}",
|
||||
[(set GR64:$dst, (X86shld GR64:$src1, GR64:$src2,
|
||||
(i8 imm:$src3)))]>,
|
||||
TB;
|
||||
def SHRD64rri8 : RIi8<0xAC, MRMDestReg,
|
||||
(outs GR64:$dst), (ins GR64:$src1, GR64:$src2, i8imm:$src3),
|
||||
"shrd{q}\t{$src3, $src2, $dst|$dst, $src2, $src3}", []>,
|
||||
"shrd{q}\t{$src3, $src2, $dst|$dst, $src2, $src3}",
|
||||
[(set GR64:$dst, (X86shrd GR64:$src1, GR64:$src2,
|
||||
(i8 imm:$src3)))]>,
|
||||
TB;
|
||||
} // isCommutable
|
||||
} // isTwoAddress
|
||||
|
||||
// Temporary hack: there is no patterns associated with these instructions
|
||||
// so we have to tell tblgen that these do not produce results.
|
||||
let Uses = [CL] in {
|
||||
def SHLD64mrCL : RI<0xA5, MRMDestMem, (outs), (ins i64mem:$dst, GR64:$src2),
|
||||
"shld{q}\t{%cl, $src2, $dst|$dst, $src2, %CL}", []>, TB;
|
||||
"shld{q}\t{%cl, $src2, $dst|$dst, $src2, %CL}",
|
||||
[(store (X86shld (loadi64 addr:$dst), GR64:$src2, CL),
|
||||
addr:$dst)]>, TB;
|
||||
def SHRD64mrCL : RI<0xAD, MRMDestMem, (outs), (ins i64mem:$dst, GR64:$src2),
|
||||
"shrd{q}\t{%cl, $src2, $dst|$dst, $src2, %CL}", []>, TB;
|
||||
"shrd{q}\t{%cl, $src2, $dst|$dst, $src2, %CL}",
|
||||
[(store (X86shrd (loadi64 addr:$dst), GR64:$src2, CL),
|
||||
addr:$dst)]>, TB;
|
||||
}
|
||||
def SHLD64mri8 : RIi8<0xA4, MRMDestMem,
|
||||
(outs), (ins i64mem:$dst, GR64:$src2, i8imm:$src3),
|
||||
"shld{q}\t{$src3, $src2, $dst|$dst, $src2, $src3}", []>,
|
||||
"shld{q}\t{$src3, $src2, $dst|$dst, $src2, $src3}",
|
||||
[(store (X86shld (loadi64 addr:$dst), GR64:$src2,
|
||||
(i8 imm:$src3)), addr:$dst)]>,
|
||||
TB;
|
||||
def SHRD64mri8 : RIi8<0xAC, MRMDestMem,
|
||||
(outs), (ins i64mem:$dst, GR64:$src2, i8imm:$src3),
|
||||
"shrd{q}\t{$src3, $src2, $dst|$dst, $src2, $src3}", []>,
|
||||
"shrd{q}\t{$src3, $src2, $dst|$dst, $src2, $src3}",
|
||||
[(store (X86shrd (loadi64 addr:$dst), GR64:$src2,
|
||||
(i8 imm:$src3)), addr:$dst)]>,
|
||||
TB;
|
||||
} // Defs = [EFLAGS]
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user