2008-01-10 05:50:42 +00:00
|
|
|
//====- X86Instr64bit.td - Describe X86-64 Instructions ----*- tablegen -*-===//
|
2006-09-08 06:48:29 +00:00
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
2007-12-29 20:36:04 +00:00
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
2006-09-08 06:48:29 +00:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file describes the X86-64 instruction set, defining the instructions,
|
|
|
|
// and properties of the instructions which are needed for code generation,
|
|
|
|
// machine code emission, and analysis.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
2008-01-10 05:50:42 +00:00
|
|
|
// Operand Definitions.
|
2006-09-08 06:48:29 +00:00
|
|
|
//
|
|
|
|
|
|
|
|
// 64-bits but only 32 bits are significant.
|
|
|
|
def i64i32imm : Operand<i64>;
|
2009-06-20 19:34:09 +00:00
|
|
|
|
|
|
|
// 64-bits but only 32 bits are significant, and those bits are treated as being
|
|
|
|
// pc relative.
|
|
|
|
def i64i32imm_pcrel : Operand<i64> {
|
|
|
|
let PrintMethod = "print_pcrel_imm";
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2006-09-08 06:48:29 +00:00
|
|
|
// 64-bits but only 8 bits are significant.
|
2009-08-10 21:06:41 +00:00
|
|
|
def i64i8imm : Operand<i64> {
|
|
|
|
let ParserMatchClass = ImmSExt8AsmOperand;
|
|
|
|
}
|
2006-09-08 06:48:29 +00:00
|
|
|
|
|
|
|
def lea64mem : Operand<i64> {
|
2009-04-08 21:14:34 +00:00
|
|
|
let PrintMethod = "printlea64mem";
|
2009-08-05 17:40:24 +00:00
|
|
|
let MIOperandInfo = (ops GR64, i8imm, GR64_NOSP, i32imm);
|
2009-08-10 18:41:10 +00:00
|
|
|
let ParserMatchClass = X86MemAsmOperand;
|
2006-09-08 06:48:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
def lea64_32mem : Operand<i32> {
|
|
|
|
let PrintMethod = "printlea64_32mem";
|
2009-06-20 07:03:18 +00:00
|
|
|
let AsmOperandLowerMethod = "lower_lea64_32mem";
|
2009-08-05 17:40:24 +00:00
|
|
|
let MIOperandInfo = (ops GR32, i8imm, GR32_NOSP, i32imm);
|
2009-08-10 18:41:10 +00:00
|
|
|
let ParserMatchClass = X86MemAsmOperand;
|
2006-09-08 06:48:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
2008-01-10 05:50:42 +00:00
|
|
|
// Complex Pattern Definitions.
|
2006-09-08 06:48:29 +00:00
|
|
|
//
|
|
|
|
def lea64addr : ComplexPattern<i64, 4, "SelectLEAAddr",
|
2009-08-02 16:09:17 +00:00
|
|
|
[add, sub, mul, X86mul_imm, shl, or, frameindex,
|
2009-07-11 23:17:29 +00:00
|
|
|
X86WrapperRIP], []>;
|
2006-09-08 06:48:29 +00:00
|
|
|
|
2009-06-20 20:38:48 +00:00
|
|
|
def tls64addr : ComplexPattern<i64, 4, "SelectTLSADDRAddr",
|
|
|
|
[tglobaltlsaddr], []>;
|
|
|
|
|
2006-09-08 06:48:29 +00:00
|
|
|
//===----------------------------------------------------------------------===//
|
2008-01-10 05:50:42 +00:00
|
|
|
// Pattern fragments.
|
2006-09-08 06:48:29 +00:00
|
|
|
//
|
|
|
|
|
2008-12-19 18:25:21 +00:00
|
|
|
def i64immSExt8 : PatLeaf<(i64 imm), [{
|
|
|
|
// i64immSExt8 predicate - True if the 64-bit immediate fits in a 8-bit
|
|
|
|
// sign extended field.
|
|
|
|
return (int64_t)N->getZExtValue() == (int8_t)N->getZExtValue();
|
|
|
|
}]>;
|
|
|
|
|
2006-09-08 06:48:29 +00:00
|
|
|
def i64immSExt32 : PatLeaf<(i64 imm), [{
|
|
|
|
// i64immSExt32 predicate - True if the 64-bit immediate fits in a 32-bit
|
|
|
|
// sign extended field.
|
2008-09-12 16:56:44 +00:00
|
|
|
return (int64_t)N->getZExtValue() == (int32_t)N->getZExtValue();
|
2006-09-08 06:48:29 +00:00
|
|
|
}]>;
|
|
|
|
|
|
|
|
def i64immZExt32 : PatLeaf<(i64 imm), [{
|
|
|
|
// i64immZExt32 predicate - True if the 64-bit immediate fits in a 32-bit
|
|
|
|
// unsignedsign extended field.
|
2008-09-12 16:56:44 +00:00
|
|
|
return (uint64_t)N->getZExtValue() == (uint32_t)N->getZExtValue();
|
2006-09-08 06:48:29 +00:00
|
|
|
}]>;
|
|
|
|
|
2006-10-09 20:57:25 +00:00
|
|
|
def sextloadi64i8 : PatFrag<(ops node:$ptr), (i64 (sextloadi8 node:$ptr))>;
|
|
|
|
def sextloadi64i16 : PatFrag<(ops node:$ptr), (i64 (sextloadi16 node:$ptr))>;
|
|
|
|
def sextloadi64i32 : PatFrag<(ops node:$ptr), (i64 (sextloadi32 node:$ptr))>;
|
|
|
|
|
|
|
|
def zextloadi64i1 : PatFrag<(ops node:$ptr), (i64 (zextloadi1 node:$ptr))>;
|
|
|
|
def zextloadi64i8 : PatFrag<(ops node:$ptr), (i64 (zextloadi8 node:$ptr))>;
|
|
|
|
def zextloadi64i16 : PatFrag<(ops node:$ptr), (i64 (zextloadi16 node:$ptr))>;
|
|
|
|
def zextloadi64i32 : PatFrag<(ops node:$ptr), (i64 (zextloadi32 node:$ptr))>;
|
|
|
|
|
|
|
|
def extloadi64i1 : PatFrag<(ops node:$ptr), (i64 (extloadi1 node:$ptr))>;
|
|
|
|
def extloadi64i8 : PatFrag<(ops node:$ptr), (i64 (extloadi8 node:$ptr))>;
|
|
|
|
def extloadi64i16 : PatFrag<(ops node:$ptr), (i64 (extloadi16 node:$ptr))>;
|
|
|
|
def extloadi64i32 : PatFrag<(ops node:$ptr), (i64 (extloadi32 node:$ptr))>;
|
2006-09-08 06:48:29 +00:00
|
|
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// Instruction list...
|
|
|
|
//
|
|
|
|
|
2008-10-01 18:28:06 +00:00
|
|
|
// ADJCALLSTACKDOWN/UP implicitly use/def RSP because they may be expanded into
|
|
|
|
// a stack adjustment and the codegen must know that they may modify the stack
|
|
|
|
// pointer before prolog-epilog rewriting occurs.
|
|
|
|
// Pessimistically assume ADJCALLSTACKDOWN / ADJCALLSTACKUP will become
|
|
|
|
// sub / add which can clobber EFLAGS.
|
|
|
|
let Defs = [RSP, EFLAGS], Uses = [RSP] in {
|
|
|
|
def ADJCALLSTACKDOWN64 : I<0, Pseudo, (outs), (ins i32imm:$amt),
|
|
|
|
"#ADJCALLSTACKDOWN",
|
2008-10-11 22:08:30 +00:00
|
|
|
[(X86callseq_start timm:$amt)]>,
|
2008-10-01 18:28:06 +00:00
|
|
|
Requires<[In64BitMode]>;
|
|
|
|
def ADJCALLSTACKUP64 : I<0, Pseudo, (outs), (ins i32imm:$amt1, i32imm:$amt2),
|
|
|
|
"#ADJCALLSTACKUP",
|
2008-10-11 22:08:30 +00:00
|
|
|
[(X86callseq_end timm:$amt1, timm:$amt2)]>,
|
2008-10-01 18:28:06 +00:00
|
|
|
Requires<[In64BitMode]>;
|
|
|
|
}
|
|
|
|
|
2006-09-08 06:48:29 +00:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// Call Instructions...
|
|
|
|
//
|
2007-07-21 00:34:19 +00:00
|
|
|
let isCall = 1 in
|
2008-10-01 18:28:06 +00:00
|
|
|
// All calls clobber the non-callee saved registers. RSP is marked as
|
|
|
|
// a use to prevent stack-pointer assignments that appear immediately
|
|
|
|
// before calls from potentially appearing dead. Uses for argument
|
|
|
|
// registers are added manually.
|
2006-09-08 06:48:29 +00:00
|
|
|
let Defs = [RAX, RCX, RDX, RSI, RDI, R8, R9, R10, R11,
|
2008-01-29 19:34:22 +00:00
|
|
|
FP0, FP1, FP2, FP3, FP4, FP5, FP6, ST0, ST1,
|
2007-04-26 21:06:48 +00:00
|
|
|
MM0, MM1, MM2, MM3, MM4, MM5, MM6, MM7,
|
2006-09-08 06:48:29 +00:00
|
|
|
XMM0, XMM1, XMM2, XMM3, XMM4, XMM5, XMM6, XMM7,
|
2008-10-01 04:14:30 +00:00
|
|
|
XMM8, XMM9, XMM10, XMM11, XMM12, XMM13, XMM14, XMM15, EFLAGS],
|
|
|
|
Uses = [RSP] in {
|
2009-03-18 00:43:52 +00:00
|
|
|
|
|
|
|
// NOTE: this pattern doesn't match "X86call imm", because we do not know
|
|
|
|
// that the offset between an arbitrary immediate and the call will fit in
|
|
|
|
// the 32-bit pcrel field that we have.
|
2009-06-16 19:44:27 +00:00
|
|
|
def CALL64pcrel32 : Ii32<0xE8, RawFrm,
|
2009-06-20 19:34:09 +00:00
|
|
|
(outs), (ins i64i32imm_pcrel:$dst, variable_ops),
|
|
|
|
"call\t$dst", []>,
|
2009-08-03 08:12:53 +00:00
|
|
|
Requires<[In64BitMode, NotWin64]>;
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
def CALL64r : I<0xFF, MRM2r, (outs), (ins GR64:$dst, variable_ops),
|
2009-08-03 08:12:53 +00:00
|
|
|
"call\t{*}$dst", [(X86call GR64:$dst)]>,
|
|
|
|
Requires<[NotWin64]>;
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
def CALL64m : I<0xFF, MRM2m, (outs), (ins i64mem:$dst, variable_ops),
|
2009-08-03 08:12:53 +00:00
|
|
|
"call\t{*}$dst", [(X86call (loadi64 addr:$dst))]>,
|
|
|
|
Requires<[NotWin64]>;
|
2009-09-03 00:04:47 +00:00
|
|
|
|
|
|
|
def FARCALL64 : RI<0xFF, MRM3m, (outs), (ins opaque80mem:$dst),
|
|
|
|
"lcall{q}\t{*}$dst", []>;
|
2006-09-08 06:48:29 +00:00
|
|
|
}
|
|
|
|
|
2009-08-03 08:12:53 +00:00
|
|
|
// FIXME: We need to teach codegen about single list of call-clobbered registers.
|
|
|
|
let isCall = 1 in
|
|
|
|
// All calls clobber the non-callee saved registers. RSP is marked as
|
|
|
|
// a use to prevent stack-pointer assignments that appear immediately
|
|
|
|
// before calls from potentially appearing dead. Uses for argument
|
|
|
|
// registers are added manually.
|
|
|
|
let Defs = [RAX, RCX, RDX, R8, R9, R10, R11,
|
|
|
|
FP0, FP1, FP2, FP3, FP4, FP5, FP6, ST0, ST1,
|
|
|
|
MM0, MM1, MM2, MM3, MM4, MM5, MM6, MM7,
|
|
|
|
XMM0, XMM1, XMM2, XMM3, XMM4, XMM5, EFLAGS],
|
|
|
|
Uses = [RSP] in {
|
|
|
|
def WINCALL64pcrel32 : I<0xE8, RawFrm,
|
2009-08-07 23:59:21 +00:00
|
|
|
(outs), (ins i64i32imm_pcrel:$dst, variable_ops),
|
|
|
|
"call\t$dst", []>,
|
2009-08-03 08:12:53 +00:00
|
|
|
Requires<[IsWin64]>;
|
|
|
|
def WINCALL64r : I<0xFF, MRM2r, (outs), (ins GR64:$dst, variable_ops),
|
|
|
|
"call\t{*}$dst",
|
|
|
|
[(X86call GR64:$dst)]>, Requires<[IsWin64]>;
|
|
|
|
def WINCALL64m : I<0xFF, MRM2m, (outs), (ins i64mem:$dst, variable_ops),
|
|
|
|
"call\t{*}$dst",
|
|
|
|
[(X86call (loadi64 addr:$dst))]>, Requires<[IsWin64]>;
|
|
|
|
}
|
2007-10-11 19:40:01 +00:00
|
|
|
|
|
|
|
|
|
|
|
let isCall = 1, isTerminator = 1, isReturn = 1, isBarrier = 1 in
|
2009-02-10 21:39:44 +00:00
|
|
|
def TCRETURNdi64 : I<0, Pseudo, (outs), (ins i64imm:$dst, i32imm:$offset,
|
|
|
|
variable_ops),
|
2007-10-11 19:40:01 +00:00
|
|
|
"#TC_RETURN $dst $offset",
|
|
|
|
[]>;
|
|
|
|
|
|
|
|
let isCall = 1, isTerminator = 1, isReturn = 1, isBarrier = 1 in
|
2009-02-10 21:39:44 +00:00
|
|
|
def TCRETURNri64 : I<0, Pseudo, (outs), (ins GR64:$dst, i32imm:$offset,
|
|
|
|
variable_ops),
|
2007-10-11 19:40:01 +00:00
|
|
|
"#TC_RETURN $dst $offset",
|
|
|
|
[]>;
|
|
|
|
|
|
|
|
|
|
|
|
let isCall = 1, isTerminator = 1, isReturn = 1, isBarrier = 1 in
|
2009-02-10 21:39:44 +00:00
|
|
|
def TAILJMPr64 : I<0xFF, MRM4r, (outs), (ins GR64:$dst),
|
|
|
|
"jmp{q}\t{*}$dst # TAILCALL",
|
|
|
|
[]>;
|
2007-10-11 19:40:01 +00:00
|
|
|
|
2006-09-08 06:48:29 +00:00
|
|
|
// Branches
|
2007-11-12 07:39:39 +00:00
|
|
|
let isBranch = 1, isTerminator = 1, isBarrier = 1, isIndirectBranch = 1 in {
|
2007-07-31 20:11:57 +00:00
|
|
|
def JMP64r : I<0xFF, MRM4r, (outs), (ins GR64:$dst), "jmp{q}\t{*}$dst",
|
2006-09-08 06:48:29 +00:00
|
|
|
[(brind GR64:$dst)]>;
|
2007-07-31 20:11:57 +00:00
|
|
|
def JMP64m : I<0xFF, MRM4m, (outs), (ins i64mem:$dst), "jmp{q}\t{*}$dst",
|
2006-09-08 06:48:29 +00:00
|
|
|
[(brind (loadi64 addr:$dst))]>;
|
2009-09-03 00:04:47 +00:00
|
|
|
def FARJMP64 : RI<0xFF, MRM5m, (outs), (ins opaque80mem:$dst),
|
|
|
|
"ljmp{q}\t{*}$dst", []>;
|
2006-09-08 06:48:29 +00:00
|
|
|
}
|
|
|
|
|
2008-09-08 21:12:47 +00:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// EH Pseudo Instructions
|
|
|
|
//
|
|
|
|
let isTerminator = 1, isReturn = 1, isBarrier = 1,
|
|
|
|
hasCtrlDep = 1 in {
|
|
|
|
def EH_RETURN64 : I<0xC3, RawFrm, (outs), (ins GR64:$addr),
|
|
|
|
"ret\t#eh_return, addr: $addr",
|
|
|
|
[(X86ehret GR64:$addr)]>;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2006-09-08 06:48:29 +00:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// Miscellaneous Instructions...
|
|
|
|
//
|
2008-01-10 07:59:24 +00:00
|
|
|
let Defs = [RBP,RSP], Uses = [RBP,RSP], mayLoad = 1, neverHasSideEffects = 1 in
|
2006-09-08 06:48:29 +00:00
|
|
|
def LEAVE64 : I<0xC9, RawFrm,
|
2007-09-11 19:55:27 +00:00
|
|
|
(outs), (ins), "leave", []>;
|
2008-01-10 07:59:24 +00:00
|
|
|
let Defs = [RSP], Uses = [RSP], neverHasSideEffects=1 in {
|
2009-09-10 18:29:13 +00:00
|
|
|
let mayLoad = 1 in {
|
2006-09-08 06:48:29 +00:00
|
|
|
def POP64r : I<0x58, AddRegFrm,
|
2007-09-11 19:55:27 +00:00
|
|
|
(outs GR64:$reg), (ins), "pop{q}\t$reg", []>;
|
2009-09-10 18:29:13 +00:00
|
|
|
def POP64rmr: I<0x8F, MRM0r, (outs GR64:$reg), (ins), "pop{q}\t$reg", []>;
|
|
|
|
def POP64rmm: I<0x8F, MRM0m, (outs i64mem:$dst), (ins), "pop{q}\t$dst", []>;
|
|
|
|
}
|
|
|
|
let mayStore = 1 in {
|
2007-06-18 14:12:56 +00:00
|
|
|
def PUSH64r : I<0x50, AddRegFrm,
|
2007-09-11 19:55:27 +00:00
|
|
|
(outs), (ins GR64:$reg), "push{q}\t$reg", []>;
|
2009-09-10 18:29:13 +00:00
|
|
|
def PUSH64rmr: I<0xFF, MRM6r, (outs), (ins GR64:$reg), "push{q}\t$reg", []>;
|
|
|
|
def PUSH64rmm: I<0xFF, MRM6m, (outs), (ins i64mem:$src), "push{q}\t$src", []>;
|
|
|
|
}
|
2007-09-11 19:55:27 +00:00
|
|
|
}
|
2006-09-08 06:48:29 +00:00
|
|
|
|
2009-06-15 19:39:04 +00:00
|
|
|
let Defs = [RSP], Uses = [RSP], neverHasSideEffects = 1, mayStore = 1 in {
|
|
|
|
def PUSH64i8 : Ii8<0x6a, RawFrm, (outs), (ins i8imm:$imm),
|
2009-06-15 20:59:31 +00:00
|
|
|
"push{q}\t$imm", []>;
|
2009-06-15 19:39:04 +00:00
|
|
|
def PUSH64i16 : Ii16<0x68, RawFrm, (outs), (ins i16imm:$imm),
|
2009-06-15 20:59:31 +00:00
|
|
|
"push{q}\t$imm", []>;
|
2009-06-15 19:39:04 +00:00
|
|
|
def PUSH64i32 : Ii32<0x68, RawFrm, (outs), (ins i32imm:$imm),
|
2009-06-15 20:59:31 +00:00
|
|
|
"push{q}\t$imm", []>;
|
2009-06-15 19:39:04 +00:00
|
|
|
}
|
|
|
|
|
2008-01-10 07:59:24 +00:00
|
|
|
let Defs = [RSP, EFLAGS], Uses = [RSP], mayLoad = 1 in
|
2007-09-26 21:28:00 +00:00
|
|
|
def POPFQ : I<0x9D, RawFrm, (outs), (ins), "popf", []>, REX_W;
|
2008-01-10 07:59:24 +00:00
|
|
|
let Defs = [RSP], Uses = [RSP, EFLAGS], mayStore = 1 in
|
2007-09-26 21:28:00 +00:00
|
|
|
def PUSHFQ : I<0x9C, RawFrm, (outs), (ins), "pushf", []>;
|
2007-09-26 01:29:06 +00:00
|
|
|
|
2006-09-08 06:48:29 +00:00
|
|
|
def LEA64_32r : I<0x8D, MRMSrcMem,
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
(outs GR32:$dst), (ins lea64_32mem:$src),
|
2007-07-31 20:11:57 +00:00
|
|
|
"lea{l}\t{$src|$dst}, {$dst|$src}",
|
2006-09-08 06:48:29 +00:00
|
|
|
[(set GR32:$dst, lea32addr:$src)]>, Requires<[In64BitMode]>;
|
|
|
|
|
2008-03-27 01:41:09 +00:00
|
|
|
let isReMaterializable = 1 in
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
def LEA64r : RI<0x8D, MRMSrcMem, (outs GR64:$dst), (ins lea64mem:$src),
|
2007-07-31 20:11:57 +00:00
|
|
|
"lea{q}\t{$src|$dst}, {$dst|$src}",
|
2006-09-08 06:48:29 +00:00
|
|
|
[(set GR64:$dst, lea64addr:$src)]>;
|
|
|
|
|
|
|
|
let isTwoAddress = 1 in
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
def BSWAP64r : RI<0xC8, AddRegFrm, (outs GR64:$dst), (ins GR64:$src),
|
2007-07-31 20:11:57 +00:00
|
|
|
"bswap{q}\t$dst",
|
2006-09-08 06:48:29 +00:00
|
|
|
[(set GR64:$dst, (bswap GR64:$src))]>, TB;
|
|
|
|
|
2007-12-14 02:13:44 +00:00
|
|
|
// Bit scan instructions.
|
|
|
|
let Defs = [EFLAGS] in {
|
2007-12-14 18:49:43 +00:00
|
|
|
def BSF64rr : RI<0xBC, MRMSrcReg, (outs GR64:$dst), (ins GR64:$src),
|
2007-12-14 15:10:00 +00:00
|
|
|
"bsf{q}\t{$src, $dst|$dst, $src}",
|
2007-12-14 18:25:34 +00:00
|
|
|
[(set GR64:$dst, (X86bsf GR64:$src)), (implicit EFLAGS)]>, TB;
|
2007-12-14 02:13:44 +00:00
|
|
|
def BSF64rm : RI<0xBC, MRMSrcMem, (outs GR64:$dst), (ins i64mem:$src),
|
2007-12-14 15:10:00 +00:00
|
|
|
"bsf{q}\t{$src, $dst|$dst, $src}",
|
2007-12-14 18:25:34 +00:00
|
|
|
[(set GR64:$dst, (X86bsf (loadi64 addr:$src))),
|
|
|
|
(implicit EFLAGS)]>, TB;
|
2007-12-14 02:13:44 +00:00
|
|
|
|
2007-12-14 18:49:43 +00:00
|
|
|
def BSR64rr : RI<0xBD, MRMSrcReg, (outs GR64:$dst), (ins GR64:$src),
|
2007-12-14 15:10:00 +00:00
|
|
|
"bsr{q}\t{$src, $dst|$dst, $src}",
|
2007-12-14 18:25:34 +00:00
|
|
|
[(set GR64:$dst, (X86bsr GR64:$src)), (implicit EFLAGS)]>, TB;
|
2007-12-14 02:13:44 +00:00
|
|
|
def BSR64rm : RI<0xBD, MRMSrcMem, (outs GR64:$dst), (ins i64mem:$src),
|
2007-12-14 15:10:00 +00:00
|
|
|
"bsr{q}\t{$src, $dst|$dst, $src}",
|
2007-12-14 18:25:34 +00:00
|
|
|
[(set GR64:$dst, (X86bsr (loadi64 addr:$src))),
|
|
|
|
(implicit EFLAGS)]>, TB;
|
2007-12-14 02:13:44 +00:00
|
|
|
} // Defs = [EFLAGS]
|
|
|
|
|
2006-09-08 06:48:29 +00:00
|
|
|
// Repeat string ops
|
2007-09-11 19:55:27 +00:00
|
|
|
let Defs = [RCX,RDI,RSI], Uses = [RCX,RDI,RSI] in
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
def REP_MOVSQ : RI<0xA5, RawFrm, (outs), (ins), "{rep;movsq|rep movsq}",
|
2007-09-11 19:55:27 +00:00
|
|
|
[(X86rep_movs i64)]>, REP;
|
|
|
|
let Defs = [RCX,RDI], Uses = [RAX,RCX,RDI] in
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
def REP_STOSQ : RI<0xAB, RawFrm, (outs), (ins), "{rep;stosq|rep stosq}",
|
2007-09-11 19:55:27 +00:00
|
|
|
[(X86rep_stos i64)]>, REP;
|
2006-09-08 06:48:29 +00:00
|
|
|
|
2009-09-12 00:37:19 +00:00
|
|
|
def SCAS64 : RI<0xAF, RawFrm, (outs), (ins), "scas{q}", []>;
|
|
|
|
|
2009-09-12 02:25:20 +00:00
|
|
|
def CMPS64 : RI<0xA7, RawFrm, (outs), (ins), "cmps{q}", []>;
|
|
|
|
|
2009-07-21 01:07:24 +00:00
|
|
|
// Fast system-call instructions
|
|
|
|
def SYSEXIT64 : RI<0x35, RawFrm,
|
|
|
|
(outs), (ins), "sysexit", []>, TB;
|
|
|
|
|
2006-09-08 06:48:29 +00:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// Move Instructions...
|
|
|
|
//
|
|
|
|
|
2008-01-10 07:59:24 +00:00
|
|
|
let neverHasSideEffects = 1 in
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
def MOV64rr : RI<0x89, MRMDestReg, (outs GR64:$dst), (ins GR64:$src),
|
2007-07-31 20:11:57 +00:00
|
|
|
"mov{q}\t{$src, $dst|$dst, $src}", []>;
|
2006-09-08 06:48:29 +00:00
|
|
|
|
2008-06-25 01:16:38 +00:00
|
|
|
let isReMaterializable = 1, isAsCheapAsAMove = 1 in {
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
def MOV64ri : RIi64<0xB8, AddRegFrm, (outs GR64:$dst), (ins i64imm:$src),
|
2007-07-31 20:11:57 +00:00
|
|
|
"movabs{q}\t{$src, $dst|$dst, $src}",
|
2006-09-08 06:48:29 +00:00
|
|
|
[(set GR64:$dst, imm:$src)]>;
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
def MOV64ri32 : RIi32<0xC7, MRM0r, (outs GR64:$dst), (ins i64i32imm:$src),
|
2007-07-31 20:11:57 +00:00
|
|
|
"mov{q}\t{$src, $dst|$dst, $src}",
|
2006-09-08 06:48:29 +00:00
|
|
|
[(set GR64:$dst, i64immSExt32:$src)]>;
|
2007-09-07 21:32:51 +00:00
|
|
|
}
|
2006-09-08 06:48:29 +00:00
|
|
|
|
2008-12-03 18:15:48 +00:00
|
|
|
let canFoldAsLoad = 1 in
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
def MOV64rm : RI<0x8B, MRMSrcMem, (outs GR64:$dst), (ins i64mem:$src),
|
2007-07-31 20:11:57 +00:00
|
|
|
"mov{q}\t{$src, $dst|$dst, $src}",
|
2006-09-08 06:48:29 +00:00
|
|
|
[(set GR64:$dst, (load addr:$src))]>;
|
|
|
|
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
def MOV64mr : RI<0x89, MRMDestMem, (outs), (ins i64mem:$dst, GR64:$src),
|
2007-07-31 20:11:57 +00:00
|
|
|
"mov{q}\t{$src, $dst|$dst, $src}",
|
2006-09-08 06:48:29 +00:00
|
|
|
[(store GR64:$src, addr:$dst)]>;
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
def MOV64mi32 : RIi32<0xC7, MRM0m, (outs), (ins i64mem:$dst, i64i32imm:$src),
|
2007-07-31 20:11:57 +00:00
|
|
|
"mov{q}\t{$src, $dst|$dst, $src}",
|
2006-09-08 06:48:29 +00:00
|
|
|
[(store i64immSExt32:$src, addr:$dst)]>;
|
|
|
|
|
2009-09-10 18:33:42 +00:00
|
|
|
def MOV64o8a : RIi8<0xA0, RawFrm, (outs), (ins i8imm:$src),
|
|
|
|
"mov{q}\t{$src, %rax|%rax, $src}", []>;
|
|
|
|
def MOV64o32a : RIi32<0xA1, RawFrm, (outs), (ins i32imm:$src),
|
|
|
|
"mov{q}\t{$src, %rax|%rax, $src}", []>;
|
|
|
|
def MOV64ao8 : RIi8<0xA2, RawFrm, (outs i8imm:$dst), (ins),
|
|
|
|
"mov{q}\t{%rax, $dst|$dst, %rax}", []>;
|
|
|
|
def MOV64ao32 : RIi32<0xA3, RawFrm, (outs i32imm:$dst), (ins),
|
|
|
|
"mov{q}\t{%rax, $dst|$dst, %rax}", []>;
|
|
|
|
|
2009-09-15 18:47:29 +00:00
|
|
|
// Moves to and from segment registers
|
|
|
|
def MOV64rs : RI<0x8C, MRMDestReg, (outs GR64:$dst), (ins SEGMENT_REG:$src),
|
|
|
|
"mov{w}\t{$src, $dst|$dst, $src}", []>;
|
|
|
|
def MOV64ms : RI<0x8C, MRMDestMem, (outs i64mem:$dst), (ins SEGMENT_REG:$src),
|
|
|
|
"mov{w}\t{$src, $dst|$dst, $src}", []>;
|
|
|
|
def MOV64sr : RI<0x8E, MRMSrcReg, (outs SEGMENT_REG:$dst), (ins GR64:$src),
|
|
|
|
"mov{w}\t{$src, $dst|$dst, $src}", []>;
|
|
|
|
def MOV64sm : RI<0x8E, MRMSrcMem, (outs SEGMENT_REG:$dst), (ins i64mem:$src),
|
|
|
|
"mov{w}\t{$src, $dst|$dst, $src}", []>;
|
|
|
|
|
2006-09-08 06:48:29 +00:00
|
|
|
// Sign/Zero extenders
|
|
|
|
|
2009-04-13 15:13:28 +00:00
|
|
|
// MOVSX64rr8 always has a REX prefix and it has an 8-bit register
|
|
|
|
// operand, which makes it a rare instruction with an 8-bit register
|
|
|
|
// operand that can never access an h register. If support for h registers
|
|
|
|
// were generalized, this would require a special register class.
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
def MOVSX64rr8 : RI<0xBE, MRMSrcReg, (outs GR64:$dst), (ins GR8 :$src),
|
2007-07-31 20:11:57 +00:00
|
|
|
"movs{bq|x}\t{$src, $dst|$dst, $src}",
|
2006-09-08 06:48:29 +00:00
|
|
|
[(set GR64:$dst, (sext GR8:$src))]>, TB;
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
def MOVSX64rm8 : RI<0xBE, MRMSrcMem, (outs GR64:$dst), (ins i8mem :$src),
|
2007-07-31 20:11:57 +00:00
|
|
|
"movs{bq|x}\t{$src, $dst|$dst, $src}",
|
2006-09-08 06:48:29 +00:00
|
|
|
[(set GR64:$dst, (sextloadi64i8 addr:$src))]>, TB;
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
def MOVSX64rr16: RI<0xBF, MRMSrcReg, (outs GR64:$dst), (ins GR16:$src),
|
2007-07-31 20:11:57 +00:00
|
|
|
"movs{wq|x}\t{$src, $dst|$dst, $src}",
|
2006-09-08 06:48:29 +00:00
|
|
|
[(set GR64:$dst, (sext GR16:$src))]>, TB;
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
def MOVSX64rm16: RI<0xBF, MRMSrcMem, (outs GR64:$dst), (ins i16mem:$src),
|
2007-07-31 20:11:57 +00:00
|
|
|
"movs{wq|x}\t{$src, $dst|$dst, $src}",
|
2006-09-08 06:48:29 +00:00
|
|
|
[(set GR64:$dst, (sextloadi64i16 addr:$src))]>, TB;
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
def MOVSX64rr32: RI<0x63, MRMSrcReg, (outs GR64:$dst), (ins GR32:$src),
|
2007-07-31 20:11:57 +00:00
|
|
|
"movs{lq|xd}\t{$src, $dst|$dst, $src}",
|
2006-09-08 06:48:29 +00:00
|
|
|
[(set GR64:$dst, (sext GR32:$src))]>;
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
def MOVSX64rm32: RI<0x63, MRMSrcMem, (outs GR64:$dst), (ins i32mem:$src),
|
2007-07-31 20:11:57 +00:00
|
|
|
"movs{lq|xd}\t{$src, $dst|$dst, $src}",
|
2006-09-08 06:48:29 +00:00
|
|
|
[(set GR64:$dst, (sextloadi64i32 addr:$src))]>;
|
|
|
|
|
2008-07-30 18:09:17 +00:00
|
|
|
// Use movzbl instead of movzbq when the destination is a register; it's
|
|
|
|
// equivalent due to implicit zero-extending, and it has a smaller encoding.
|
|
|
|
def MOVZX64rr8 : I<0xB6, MRMSrcReg, (outs GR64:$dst), (ins GR8 :$src),
|
|
|
|
"movz{bl|x}\t{$src, ${dst:subreg32}|${dst:subreg32}, $src}",
|
|
|
|
[(set GR64:$dst, (zext GR8:$src))]>, TB;
|
|
|
|
def MOVZX64rm8 : I<0xB6, MRMSrcMem, (outs GR64:$dst), (ins i8mem :$src),
|
|
|
|
"movz{bl|x}\t{$src, ${dst:subreg32}|${dst:subreg32}, $src}",
|
|
|
|
[(set GR64:$dst, (zextloadi64i8 addr:$src))]>, TB;
|
|
|
|
// Use movzwl instead of movzwq when the destination is a register; it's
|
|
|
|
// equivalent due to implicit zero-extending, and it has a smaller encoding.
|
|
|
|
def MOVZX64rr16: I<0xB7, MRMSrcReg, (outs GR64:$dst), (ins GR16:$src),
|
|
|
|
"movz{wl|x}\t{$src, ${dst:subreg32}|${dst:subreg32}, $src}",
|
|
|
|
[(set GR64:$dst, (zext GR16:$src))]>, TB;
|
|
|
|
def MOVZX64rm16: I<0xB7, MRMSrcMem, (outs GR64:$dst), (ins i16mem:$src),
|
|
|
|
"movz{wl|x}\t{$src, ${dst:subreg32}|${dst:subreg32}, $src}",
|
|
|
|
[(set GR64:$dst, (zextloadi64i16 addr:$src))]>, TB;
|
2006-09-08 06:48:29 +00:00
|
|
|
|
2008-08-07 02:54:50 +00:00
|
|
|
// There's no movzlq instruction, but movl can be used for this purpose, using
|
Implement support for using modeling implicit-zero-extension on x86-64
with SUBREG_TO_REG, teach SimpleRegisterCoalescing to coalesce
SUBREG_TO_REG instructions (which are similar to INSERT_SUBREG
instructions), and teach the DAGCombiner to take advantage of this on
targets which support it. This eliminates many redundant
zero-extension operations on x86-64.
This adds a new TargetLowering hook, isZExtFree. It's similar to
isTruncateFree, except it only applies to actual definitions, and not
no-op truncates which may not zero the high bits.
Also, this adds a new optimization to SimplifyDemandedBits: transform
operations like x+y into (zext (add (trunc x), (trunc y))) on targets
where all the casts are no-ops. In contexts where the high part of the
add is explicitly masked off, this allows the mask operation to be
eliminated. Fix the DAGCombiner to avoid undoing these transformations
to eliminate casts on targets where the casts are no-ops.
Also, this adds a new two-address lowering heuristic. Since
two-address lowering runs before coalescing, it helps to be able to
look through copies when deciding whether commuting and/or
three-address conversion are profitable.
Also, fix a bug in LiveInterval::MergeInClobberRanges. It didn't handle
the case that a clobber range extended both before and beyond an
existing live range. In that case, multiple live ranges need to be
added. This was exposed by the new subreg coalescing code.
Remove 2008-05-06-SpillerBug.ll. It was bugpoint-reduced, and the
spiller behavior it was looking for no longer occurrs with the new
instruction selection.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68576 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-08 00:15:30 +00:00
|
|
|
// implicit zero-extension. The preferred way to do 32-bit-to-64-bit zero
|
|
|
|
// extension on x86-64 is to use a SUBREG_TO_REG to utilize implicit
|
|
|
|
// zero-extension, however this isn't possible when the 32-bit value is
|
|
|
|
// defined by a truncate or is copied from something where the high bits aren't
|
|
|
|
// necessarily all zero. In such cases, we fall back to these explicit zext
|
|
|
|
// instructions.
|
2008-08-07 02:54:50 +00:00
|
|
|
def MOVZX64rr32 : I<0x89, MRMDestReg, (outs GR64:$dst), (ins GR32:$src),
|
|
|
|
"mov{l}\t{$src, ${dst:subreg32}|${dst:subreg32}, $src}",
|
|
|
|
[(set GR64:$dst, (zext GR32:$src))]>;
|
|
|
|
def MOVZX64rm32 : I<0x8B, MRMSrcMem, (outs GR64:$dst), (ins i32mem:$src),
|
|
|
|
"mov{l}\t{$src, ${dst:subreg32}|${dst:subreg32}, $src}",
|
|
|
|
[(set GR64:$dst, (zextloadi64i32 addr:$src))]>;
|
|
|
|
|
Implement support for using modeling implicit-zero-extension on x86-64
with SUBREG_TO_REG, teach SimpleRegisterCoalescing to coalesce
SUBREG_TO_REG instructions (which are similar to INSERT_SUBREG
instructions), and teach the DAGCombiner to take advantage of this on
targets which support it. This eliminates many redundant
zero-extension operations on x86-64.
This adds a new TargetLowering hook, isZExtFree. It's similar to
isTruncateFree, except it only applies to actual definitions, and not
no-op truncates which may not zero the high bits.
Also, this adds a new optimization to SimplifyDemandedBits: transform
operations like x+y into (zext (add (trunc x), (trunc y))) on targets
where all the casts are no-ops. In contexts where the high part of the
add is explicitly masked off, this allows the mask operation to be
eliminated. Fix the DAGCombiner to avoid undoing these transformations
to eliminate casts on targets where the casts are no-ops.
Also, this adds a new two-address lowering heuristic. Since
two-address lowering runs before coalescing, it helps to be able to
look through copies when deciding whether commuting and/or
three-address conversion are profitable.
Also, fix a bug in LiveInterval::MergeInClobberRanges. It didn't handle
the case that a clobber range extended both before and beyond an
existing live range. In that case, multiple live ranges need to be
added. This was exposed by the new subreg coalescing code.
Remove 2008-05-06-SpillerBug.ll. It was bugpoint-reduced, and the
spiller behavior it was looking for no longer occurrs with the new
instruction selection.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68576 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-08 00:15:30 +00:00
|
|
|
// Any instruction that defines a 32-bit result leaves the high half of the
|
2009-09-15 00:14:11 +00:00
|
|
|
// register. Truncate can be lowered to EXTRACT_SUBREG. CopyFromReg may
|
|
|
|
// be copying from a truncate. And x86's cmov doesn't do anything if the
|
|
|
|
// condition is false. But any other 32-bit operation will zero-extend
|
Implement support for using modeling implicit-zero-extension on x86-64
with SUBREG_TO_REG, teach SimpleRegisterCoalescing to coalesce
SUBREG_TO_REG instructions (which are similar to INSERT_SUBREG
instructions), and teach the DAGCombiner to take advantage of this on
targets which support it. This eliminates many redundant
zero-extension operations on x86-64.
This adds a new TargetLowering hook, isZExtFree. It's similar to
isTruncateFree, except it only applies to actual definitions, and not
no-op truncates which may not zero the high bits.
Also, this adds a new optimization to SimplifyDemandedBits: transform
operations like x+y into (zext (add (trunc x), (trunc y))) on targets
where all the casts are no-ops. In contexts where the high part of the
add is explicitly masked off, this allows the mask operation to be
eliminated. Fix the DAGCombiner to avoid undoing these transformations
to eliminate casts on targets where the casts are no-ops.
Also, this adds a new two-address lowering heuristic. Since
two-address lowering runs before coalescing, it helps to be able to
look through copies when deciding whether commuting and/or
three-address conversion are profitable.
Also, fix a bug in LiveInterval::MergeInClobberRanges. It didn't handle
the case that a clobber range extended both before and beyond an
existing live range. In that case, multiple live ranges need to be
added. This was exposed by the new subreg coalescing code.
Remove 2008-05-06-SpillerBug.ll. It was bugpoint-reduced, and the
spiller behavior it was looking for no longer occurrs with the new
instruction selection.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68576 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-08 00:15:30 +00:00
|
|
|
// up to 64 bits.
|
|
|
|
def def32 : PatLeaf<(i32 GR32:$src), [{
|
|
|
|
return N->getOpcode() != ISD::TRUNCATE &&
|
|
|
|
N->getOpcode() != TargetInstrInfo::EXTRACT_SUBREG &&
|
2009-09-15 00:14:11 +00:00
|
|
|
N->getOpcode() != ISD::CopyFromReg &&
|
|
|
|
N->getOpcode() != X86ISD::CMOV;
|
Implement support for using modeling implicit-zero-extension on x86-64
with SUBREG_TO_REG, teach SimpleRegisterCoalescing to coalesce
SUBREG_TO_REG instructions (which are similar to INSERT_SUBREG
instructions), and teach the DAGCombiner to take advantage of this on
targets which support it. This eliminates many redundant
zero-extension operations on x86-64.
This adds a new TargetLowering hook, isZExtFree. It's similar to
isTruncateFree, except it only applies to actual definitions, and not
no-op truncates which may not zero the high bits.
Also, this adds a new optimization to SimplifyDemandedBits: transform
operations like x+y into (zext (add (trunc x), (trunc y))) on targets
where all the casts are no-ops. In contexts where the high part of the
add is explicitly masked off, this allows the mask operation to be
eliminated. Fix the DAGCombiner to avoid undoing these transformations
to eliminate casts on targets where the casts are no-ops.
Also, this adds a new two-address lowering heuristic. Since
two-address lowering runs before coalescing, it helps to be able to
look through copies when deciding whether commuting and/or
three-address conversion are profitable.
Also, fix a bug in LiveInterval::MergeInClobberRanges. It didn't handle
the case that a clobber range extended both before and beyond an
existing live range. In that case, multiple live ranges need to be
added. This was exposed by the new subreg coalescing code.
Remove 2008-05-06-SpillerBug.ll. It was bugpoint-reduced, and the
spiller behavior it was looking for no longer occurrs with the new
instruction selection.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68576 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-08 00:15:30 +00:00
|
|
|
}]>;
|
|
|
|
|
|
|
|
// In the case of a 32-bit def that is known to implicitly zero-extend,
|
|
|
|
// we can use a SUBREG_TO_REG.
|
|
|
|
def : Pat<(i64 (zext def32:$src)),
|
|
|
|
(SUBREG_TO_REG (i64 0), GR32:$src, x86_subreg_32bit)>;
|
|
|
|
|
2008-01-10 07:59:24 +00:00
|
|
|
let neverHasSideEffects = 1 in {
|
|
|
|
let Defs = [RAX], Uses = [EAX] in
|
|
|
|
def CDQE : RI<0x98, RawFrm, (outs), (ins),
|
|
|
|
"{cltq|cdqe}", []>; // RAX = signext(EAX)
|
2006-09-08 06:48:29 +00:00
|
|
|
|
2008-01-10 07:59:24 +00:00
|
|
|
let Defs = [RAX,RDX], Uses = [RAX] in
|
|
|
|
def CQO : RI<0x99, RawFrm, (outs), (ins),
|
|
|
|
"{cqto|cqo}", []>; // RDX:RAX = signext(RAX)
|
|
|
|
}
|
2006-09-08 06:48:29 +00:00
|
|
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// Arithmetic Instructions...
|
|
|
|
//
|
|
|
|
|
2007-09-14 21:48:26 +00:00
|
|
|
let Defs = [EFLAGS] in {
|
2009-09-02 00:55:49 +00:00
|
|
|
|
|
|
|
def ADD64i32 : RI<0x05, RawFrm, (outs), (ins i32imm:$src),
|
|
|
|
"add{q}\t{$src, %rax|%rax, $src}", []>;
|
|
|
|
|
2006-09-08 06:48:29 +00:00
|
|
|
let isTwoAddress = 1 in {
|
|
|
|
let isConvertibleToThreeAddress = 1 in {
|
|
|
|
let isCommutable = 1 in
|
2008-12-12 00:56:36 +00:00
|
|
|
// Register-Register Addition
|
|
|
|
def ADD64rr : RI<0x01, MRMDestReg, (outs GR64:$dst), (ins GR64:$src1, GR64:$src2),
|
|
|
|
"add{q}\t{$src2, $dst|$dst, $src2}",
|
2008-12-12 21:15:41 +00:00
|
|
|
[(set GR64:$dst, (add GR64:$src1, GR64:$src2)),
|
2008-12-02 00:07:05 +00:00
|
|
|
(implicit EFLAGS)]>;
|
2008-12-12 00:56:36 +00:00
|
|
|
|
|
|
|
// Register-Integer Addition
|
|
|
|
def ADD64ri8 : RIi8<0x83, MRM0r, (outs GR64:$dst), (ins GR64:$src1, i64i8imm:$src2),
|
|
|
|
"add{q}\t{$src2, $dst|$dst, $src2}",
|
2008-12-12 21:15:41 +00:00
|
|
|
[(set GR64:$dst, (add GR64:$src1, i64immSExt8:$src2)),
|
|
|
|
(implicit EFLAGS)]>;
|
2008-12-19 18:25:21 +00:00
|
|
|
def ADD64ri32 : RIi32<0x81, MRM0r, (outs GR64:$dst), (ins GR64:$src1, i64i32imm:$src2),
|
|
|
|
"add{q}\t{$src2, $dst|$dst, $src2}",
|
|
|
|
[(set GR64:$dst, (add GR64:$src1, i64immSExt32:$src2)),
|
|
|
|
(implicit EFLAGS)]>;
|
2006-09-08 06:48:29 +00:00
|
|
|
} // isConvertibleToThreeAddress
|
|
|
|
|
2008-12-12 00:56:36 +00:00
|
|
|
// Register-Memory Addition
|
|
|
|
def ADD64rm : RI<0x03, MRMSrcMem, (outs GR64:$dst), (ins GR64:$src1, i64mem:$src2),
|
|
|
|
"add{q}\t{$src2, $dst|$dst, $src2}",
|
2008-12-12 21:15:41 +00:00
|
|
|
[(set GR64:$dst, (add GR64:$src1, (load addr:$src2))),
|
2008-12-12 00:56:36 +00:00
|
|
|
(implicit EFLAGS)]>;
|
2009-09-15 20:53:57 +00:00
|
|
|
|
2009-09-15 21:43:27 +00:00
|
|
|
// Register-Register Addition - Equivalent to the normal rr form (ADD64rr), but
|
|
|
|
// differently encoded.
|
2009-09-15 20:53:57 +00:00
|
|
|
def ADD64mrmrr : RI<0x03, MRMSrcReg, (outs GR64:$dst), (ins GR64:$src1, GR64:$src2),
|
|
|
|
"add{l}\t{$src2, $dst|$dst, $src2}", []>;
|
|
|
|
|
2006-09-08 06:48:29 +00:00
|
|
|
} // isTwoAddress
|
|
|
|
|
2008-12-12 00:56:36 +00:00
|
|
|
// Memory-Register Addition
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
def ADD64mr : RI<0x01, MRMDestMem, (outs), (ins i64mem:$dst, GR64:$src2),
|
2007-07-31 20:11:57 +00:00
|
|
|
"add{q}\t{$src2, $dst|$dst, $src2}",
|
2008-12-12 21:15:41 +00:00
|
|
|
[(store (add (load addr:$dst), GR64:$src2), addr:$dst),
|
|
|
|
(implicit EFLAGS)]>;
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
def ADD64mi8 : RIi8<0x83, MRM0m, (outs), (ins i64mem:$dst, i64i8imm :$src2),
|
2007-07-31 20:11:57 +00:00
|
|
|
"add{q}\t{$src2, $dst|$dst, $src2}",
|
2008-12-12 21:15:41 +00:00
|
|
|
[(store (add (load addr:$dst), i64immSExt8:$src2), addr:$dst),
|
|
|
|
(implicit EFLAGS)]>;
|
2008-12-19 18:25:21 +00:00
|
|
|
def ADD64mi32 : RIi32<0x81, MRM0m, (outs), (ins i64mem:$dst, i64i32imm :$src2),
|
|
|
|
"add{q}\t{$src2, $dst|$dst, $src2}",
|
|
|
|
[(store (add (load addr:$dst), i64immSExt32:$src2), addr:$dst),
|
|
|
|
(implicit EFLAGS)]>;
|
2006-09-08 06:48:29 +00:00
|
|
|
|
2007-10-05 17:59:57 +00:00
|
|
|
let Uses = [EFLAGS] in {
|
2009-09-11 19:01:56 +00:00
|
|
|
|
|
|
|
def ADC64i32 : RI<0x15, RawFrm, (outs), (ins i32imm:$src),
|
|
|
|
"adc{q}\t{$src, %rax|%rax, $src}", []>;
|
|
|
|
|
2006-09-08 06:48:29 +00:00
|
|
|
let isTwoAddress = 1 in {
|
|
|
|
let isCommutable = 1 in
|
2009-06-02 03:12:52 +00:00
|
|
|
def ADC64rr : RI<0x11, MRMDestReg, (outs GR64:$dst), (ins GR64:$src1, GR64:$src2),
|
2007-07-31 20:11:57 +00:00
|
|
|
"adc{q}\t{$src2, $dst|$dst, $src2}",
|
2009-06-02 03:12:52 +00:00
|
|
|
[(set GR64:$dst, (adde GR64:$src1, GR64:$src2))]>;
|
2006-09-08 06:48:29 +00:00
|
|
|
|
2009-06-02 03:12:52 +00:00
|
|
|
def ADC64rm : RI<0x13, MRMSrcMem , (outs GR64:$dst), (ins GR64:$src1, i64mem:$src2),
|
2007-07-31 20:11:57 +00:00
|
|
|
"adc{q}\t{$src2, $dst|$dst, $src2}",
|
2009-06-02 03:12:52 +00:00
|
|
|
[(set GR64:$dst, (adde GR64:$src1, (load addr:$src2)))]>;
|
2006-09-08 06:48:29 +00:00
|
|
|
|
2009-06-02 03:12:52 +00:00
|
|
|
def ADC64ri8 : RIi8<0x83, MRM2r, (outs GR64:$dst), (ins GR64:$src1, i64i8imm:$src2),
|
2007-07-31 20:11:57 +00:00
|
|
|
"adc{q}\t{$src2, $dst|$dst, $src2}",
|
2009-06-02 03:12:52 +00:00
|
|
|
[(set GR64:$dst, (adde GR64:$src1, i64immSExt8:$src2))]>;
|
|
|
|
def ADC64ri32 : RIi32<0x81, MRM2r, (outs GR64:$dst), (ins GR64:$src1, i64i32imm:$src2),
|
2008-12-19 18:25:21 +00:00
|
|
|
"adc{q}\t{$src2, $dst|$dst, $src2}",
|
2009-06-02 03:12:52 +00:00
|
|
|
[(set GR64:$dst, (adde GR64:$src1, i64immSExt32:$src2))]>;
|
2006-09-08 06:48:29 +00:00
|
|
|
} // isTwoAddress
|
|
|
|
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
def ADC64mr : RI<0x11, MRMDestMem, (outs), (ins i64mem:$dst, GR64:$src2),
|
2007-07-31 20:11:57 +00:00
|
|
|
"adc{q}\t{$src2, $dst|$dst, $src2}",
|
2009-06-02 03:12:52 +00:00
|
|
|
[(store (adde (load addr:$dst), GR64:$src2), addr:$dst)]>;
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
def ADC64mi8 : RIi8<0x83, MRM2m, (outs), (ins i64mem:$dst, i64i8imm :$src2),
|
2007-07-31 20:11:57 +00:00
|
|
|
"adc{q}\t{$src2, $dst|$dst, $src2}",
|
2009-06-02 03:12:52 +00:00
|
|
|
[(store (adde (load addr:$dst), i64immSExt8:$src2), addr:$dst)]>;
|
2008-12-19 18:25:21 +00:00
|
|
|
def ADC64mi32 : RIi32<0x81, MRM2m, (outs), (ins i64mem:$dst, i64i32imm:$src2),
|
|
|
|
"adc{q}\t{$src2, $dst|$dst, $src2}",
|
2009-06-02 03:12:52 +00:00
|
|
|
[(store (adde (load addr:$dst), i64immSExt8:$src2), addr:$dst)]>;
|
2007-10-05 17:59:57 +00:00
|
|
|
} // Uses = [EFLAGS]
|
2006-09-08 06:48:29 +00:00
|
|
|
|
|
|
|
let isTwoAddress = 1 in {
|
2008-12-12 00:56:36 +00:00
|
|
|
// Register-Register Subtraction
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
def SUB64rr : RI<0x29, MRMDestReg, (outs GR64:$dst), (ins GR64:$src1, GR64:$src2),
|
2007-07-31 20:11:57 +00:00
|
|
|
"sub{q}\t{$src2, $dst|$dst, $src2}",
|
2008-12-12 21:15:41 +00:00
|
|
|
[(set GR64:$dst, (sub GR64:$src1, GR64:$src2)),
|
|
|
|
(implicit EFLAGS)]>;
|
2008-12-12 00:56:36 +00:00
|
|
|
|
|
|
|
// Register-Memory Subtraction
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
def SUB64rm : RI<0x2B, MRMSrcMem, (outs GR64:$dst), (ins GR64:$src1, i64mem:$src2),
|
2007-07-31 20:11:57 +00:00
|
|
|
"sub{q}\t{$src2, $dst|$dst, $src2}",
|
2008-12-12 21:15:41 +00:00
|
|
|
[(set GR64:$dst, (sub GR64:$src1, (load addr:$src2))),
|
|
|
|
(implicit EFLAGS)]>;
|
2006-09-08 06:48:29 +00:00
|
|
|
|
2008-12-12 00:56:36 +00:00
|
|
|
// Register-Integer Subtraction
|
|
|
|
def SUB64ri8 : RIi8<0x83, MRM5r, (outs GR64:$dst),
|
|
|
|
(ins GR64:$src1, i64i8imm:$src2),
|
2007-07-31 20:11:57 +00:00
|
|
|
"sub{q}\t{$src2, $dst|$dst, $src2}",
|
2008-12-12 21:15:41 +00:00
|
|
|
[(set GR64:$dst, (sub GR64:$src1, i64immSExt8:$src2)),
|
|
|
|
(implicit EFLAGS)]>;
|
2008-12-19 18:25:21 +00:00
|
|
|
def SUB64ri32 : RIi32<0x81, MRM5r, (outs GR64:$dst),
|
|
|
|
(ins GR64:$src1, i64i32imm:$src2),
|
|
|
|
"sub{q}\t{$src2, $dst|$dst, $src2}",
|
|
|
|
[(set GR64:$dst, (sub GR64:$src1, i64immSExt32:$src2)),
|
|
|
|
(implicit EFLAGS)]>;
|
2006-09-08 06:48:29 +00:00
|
|
|
} // isTwoAddress
|
|
|
|
|
2009-09-11 19:01:56 +00:00
|
|
|
def SUB64i32 : RI<0x2D, RawFrm, (outs), (ins i32imm:$src),
|
|
|
|
"sub{q}\t{$src, %rax|%rax, $src}", []>;
|
|
|
|
|
2008-12-12 00:56:36 +00:00
|
|
|
// Memory-Register Subtraction
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
def SUB64mr : RI<0x29, MRMDestMem, (outs), (ins i64mem:$dst, GR64:$src2),
|
2007-07-31 20:11:57 +00:00
|
|
|
"sub{q}\t{$src2, $dst|$dst, $src2}",
|
2008-12-12 21:15:41 +00:00
|
|
|
[(store (sub (load addr:$dst), GR64:$src2), addr:$dst),
|
|
|
|
(implicit EFLAGS)]>;
|
2008-12-12 00:56:36 +00:00
|
|
|
|
|
|
|
// Memory-Integer Subtraction
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
def SUB64mi8 : RIi8<0x83, MRM5m, (outs), (ins i64mem:$dst, i64i8imm :$src2),
|
2007-07-31 20:11:57 +00:00
|
|
|
"sub{q}\t{$src2, $dst|$dst, $src2}",
|
2008-12-12 00:56:36 +00:00
|
|
|
[(store (sub (load addr:$dst), i64immSExt8:$src2),
|
2008-12-12 21:15:41 +00:00
|
|
|
addr:$dst),
|
|
|
|
(implicit EFLAGS)]>;
|
2008-12-19 18:25:21 +00:00
|
|
|
def SUB64mi32 : RIi32<0x81, MRM5m, (outs), (ins i64mem:$dst, i64i32imm:$src2),
|
|
|
|
"sub{q}\t{$src2, $dst|$dst, $src2}",
|
|
|
|
[(store (sub (load addr:$dst), i64immSExt32:$src2),
|
|
|
|
addr:$dst),
|
|
|
|
(implicit EFLAGS)]>;
|
2006-09-08 06:48:29 +00:00
|
|
|
|
2007-10-05 17:59:57 +00:00
|
|
|
let Uses = [EFLAGS] in {
|
2006-09-08 06:48:29 +00:00
|
|
|
let isTwoAddress = 1 in {
|
2009-06-02 03:12:52 +00:00
|
|
|
def SBB64rr : RI<0x19, MRMDestReg, (outs GR64:$dst), (ins GR64:$src1, GR64:$src2),
|
2007-07-31 20:11:57 +00:00
|
|
|
"sbb{q}\t{$src2, $dst|$dst, $src2}",
|
2009-06-02 03:12:52 +00:00
|
|
|
[(set GR64:$dst, (sube GR64:$src1, GR64:$src2))]>;
|
2006-09-08 06:48:29 +00:00
|
|
|
|
2009-06-02 03:12:52 +00:00
|
|
|
def SBB64rm : RI<0x1B, MRMSrcMem, (outs GR64:$dst), (ins GR64:$src1, i64mem:$src2),
|
2007-07-31 20:11:57 +00:00
|
|
|
"sbb{q}\t{$src2, $dst|$dst, $src2}",
|
2009-06-02 03:12:52 +00:00
|
|
|
[(set GR64:$dst, (sube GR64:$src1, (load addr:$src2)))]>;
|
2006-09-08 06:48:29 +00:00
|
|
|
|
2009-06-02 03:12:52 +00:00
|
|
|
def SBB64ri8 : RIi8<0x83, MRM3r, (outs GR64:$dst), (ins GR64:$src1, i64i8imm:$src2),
|
2007-07-31 20:11:57 +00:00
|
|
|
"sbb{q}\t{$src2, $dst|$dst, $src2}",
|
2009-06-02 03:12:52 +00:00
|
|
|
[(set GR64:$dst, (sube GR64:$src1, i64immSExt8:$src2))]>;
|
|
|
|
def SBB64ri32 : RIi32<0x81, MRM3r, (outs GR64:$dst), (ins GR64:$src1, i64i32imm:$src2),
|
2008-12-19 18:25:21 +00:00
|
|
|
"sbb{q}\t{$src2, $dst|$dst, $src2}",
|
2009-06-02 03:12:52 +00:00
|
|
|
[(set GR64:$dst, (sube GR64:$src1, i64immSExt32:$src2))]>;
|
2006-09-08 06:48:29 +00:00
|
|
|
} // isTwoAddress
|
|
|
|
|
2009-09-11 19:01:56 +00:00
|
|
|
def SBB64i32 : RI<0x1D, RawFrm, (outs), (ins i32imm:$src),
|
|
|
|
"sbb{q}\t{$src, %rax|%rax, $src}", []>;
|
|
|
|
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
def SBB64mr : RI<0x19, MRMDestMem, (outs), (ins i64mem:$dst, GR64:$src2),
|
2007-07-31 20:11:57 +00:00
|
|
|
"sbb{q}\t{$src2, $dst|$dst, $src2}",
|
2009-06-02 03:12:52 +00:00
|
|
|
[(store (sube (load addr:$dst), GR64:$src2), addr:$dst)]>;
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
def SBB64mi8 : RIi8<0x83, MRM3m, (outs), (ins i64mem:$dst, i64i8imm :$src2),
|
2007-07-31 20:11:57 +00:00
|
|
|
"sbb{q}\t{$src2, $dst|$dst, $src2}",
|
2009-06-02 03:12:52 +00:00
|
|
|
[(store (sube (load addr:$dst), i64immSExt8:$src2), addr:$dst)]>;
|
2008-12-19 18:25:21 +00:00
|
|
|
def SBB64mi32 : RIi32<0x81, MRM3m, (outs), (ins i64mem:$dst, i64i32imm:$src2),
|
|
|
|
"sbb{q}\t{$src2, $dst|$dst, $src2}",
|
2009-06-02 03:12:52 +00:00
|
|
|
[(store (sube (load addr:$dst), i64immSExt32:$src2), addr:$dst)]>;
|
2007-10-05 17:59:57 +00:00
|
|
|
} // Uses = [EFLAGS]
|
2007-09-14 21:48:26 +00:00
|
|
|
} // Defs = [EFLAGS]
|
2006-09-08 06:48:29 +00:00
|
|
|
|
|
|
|
// Unsigned multiplication
|
2008-01-10 07:59:24 +00:00
|
|
|
let Defs = [RAX,RDX,EFLAGS], Uses = [RAX], neverHasSideEffects = 1 in {
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
def MUL64r : RI<0xF7, MRM4r, (outs), (ins GR64:$src),
|
2007-09-11 19:55:27 +00:00
|
|
|
"mul{q}\t$src", []>; // RAX,RDX = RAX*GR64
|
2008-01-10 07:59:24 +00:00
|
|
|
let mayLoad = 1 in
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
def MUL64m : RI<0xF7, MRM4m, (outs), (ins i64mem:$src),
|
2007-09-11 19:55:27 +00:00
|
|
|
"mul{q}\t$src", []>; // RAX,RDX = RAX*[mem64]
|
2006-09-08 06:48:29 +00:00
|
|
|
|
|
|
|
// Signed multiplication
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
def IMUL64r : RI<0xF7, MRM5r, (outs), (ins GR64:$src),
|
2007-09-11 19:55:27 +00:00
|
|
|
"imul{q}\t$src", []>; // RAX,RDX = RAX*GR64
|
2008-01-10 07:59:24 +00:00
|
|
|
let mayLoad = 1 in
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
def IMUL64m : RI<0xF7, MRM5m, (outs), (ins i64mem:$src),
|
2007-09-11 19:55:27 +00:00
|
|
|
"imul{q}\t$src", []>; // RAX,RDX = RAX*[mem64]
|
|
|
|
}
|
2006-09-08 06:48:29 +00:00
|
|
|
|
2007-09-14 21:48:26 +00:00
|
|
|
let Defs = [EFLAGS] in {
|
2006-09-08 06:48:29 +00:00
|
|
|
let isTwoAddress = 1 in {
|
|
|
|
let isCommutable = 1 in
|
2008-12-12 21:15:41 +00:00
|
|
|
// Register-Register Signed Integer Multiplication
|
2008-12-12 00:56:36 +00:00
|
|
|
def IMUL64rr : RI<0xAF, MRMSrcReg, (outs GR64:$dst),
|
|
|
|
(ins GR64:$src1, GR64:$src2),
|
2007-07-31 20:11:57 +00:00
|
|
|
"imul{q}\t{$src2, $dst|$dst, $src2}",
|
2008-12-12 21:15:41 +00:00
|
|
|
[(set GR64:$dst, (mul GR64:$src1, GR64:$src2)),
|
|
|
|
(implicit EFLAGS)]>, TB;
|
2008-12-12 00:56:36 +00:00
|
|
|
|
2008-12-12 21:15:41 +00:00
|
|
|
// Register-Memory Signed Integer Multiplication
|
2008-12-12 00:56:36 +00:00
|
|
|
def IMUL64rm : RI<0xAF, MRMSrcMem, (outs GR64:$dst),
|
|
|
|
(ins GR64:$src1, i64mem:$src2),
|
2007-07-31 20:11:57 +00:00
|
|
|
"imul{q}\t{$src2, $dst|$dst, $src2}",
|
2008-12-12 21:15:41 +00:00
|
|
|
[(set GR64:$dst, (mul GR64:$src1, (load addr:$src2))),
|
|
|
|
(implicit EFLAGS)]>, TB;
|
2006-09-08 06:48:29 +00:00
|
|
|
} // isTwoAddress
|
|
|
|
|
|
|
|
// Suprisingly enough, these are not two address instructions!
|
2008-12-12 00:56:36 +00:00
|
|
|
|
2008-12-12 21:15:41 +00:00
|
|
|
// Register-Integer Signed Integer Multiplication
|
2006-09-08 06:48:29 +00:00
|
|
|
def IMUL64rri8 : RIi8<0x6B, MRMSrcReg, // GR64 = GR64*I8
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
(outs GR64:$dst), (ins GR64:$src1, i64i8imm:$src2),
|
2007-07-31 20:11:57 +00:00
|
|
|
"imul{q}\t{$src2, $src1, $dst|$dst, $src1, $src2}",
|
2008-12-12 21:15:41 +00:00
|
|
|
[(set GR64:$dst, (mul GR64:$src1, i64immSExt8:$src2)),
|
|
|
|
(implicit EFLAGS)]>;
|
2008-12-19 18:25:21 +00:00
|
|
|
def IMUL64rri32 : RIi32<0x69, MRMSrcReg, // GR64 = GR64*I32
|
|
|
|
(outs GR64:$dst), (ins GR64:$src1, i64i32imm:$src2),
|
|
|
|
"imul{q}\t{$src2, $src1, $dst|$dst, $src1, $src2}",
|
|
|
|
[(set GR64:$dst, (mul GR64:$src1, i64immSExt32:$src2)),
|
|
|
|
(implicit EFLAGS)]>;
|
2008-12-12 21:15:41 +00:00
|
|
|
|
|
|
|
// Memory-Integer Signed Integer Multiplication
|
2006-09-08 06:48:29 +00:00
|
|
|
def IMUL64rmi8 : RIi8<0x6B, MRMSrcMem, // GR64 = [mem64]*I8
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
(outs GR64:$dst), (ins i64mem:$src1, i64i8imm: $src2),
|
2007-07-31 20:11:57 +00:00
|
|
|
"imul{q}\t{$src2, $src1, $dst|$dst, $src1, $src2}",
|
2008-12-12 00:56:36 +00:00
|
|
|
[(set GR64:$dst, (mul (load addr:$src1),
|
2008-12-12 21:15:41 +00:00
|
|
|
i64immSExt8:$src2)),
|
|
|
|
(implicit EFLAGS)]>;
|
2008-12-19 18:25:21 +00:00
|
|
|
def IMUL64rmi32 : RIi32<0x69, MRMSrcMem, // GR64 = [mem64]*I32
|
|
|
|
(outs GR64:$dst), (ins i64mem:$src1, i64i32imm:$src2),
|
|
|
|
"imul{q}\t{$src2, $src1, $dst|$dst, $src1, $src2}",
|
|
|
|
[(set GR64:$dst, (mul (load addr:$src1),
|
|
|
|
i64immSExt32:$src2)),
|
|
|
|
(implicit EFLAGS)]>;
|
2007-09-14 21:48:26 +00:00
|
|
|
} // Defs = [EFLAGS]
|
2006-09-08 06:48:29 +00:00
|
|
|
|
|
|
|
// Unsigned division / remainder
|
2007-09-14 21:48:26 +00:00
|
|
|
let Defs = [RAX,RDX,EFLAGS], Uses = [RAX,RDX] in {
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
def DIV64r : RI<0xF7, MRM6r, (outs), (ins GR64:$src), // RDX:RAX/r64 = RAX,RDX
|
2007-09-11 19:55:27 +00:00
|
|
|
"div{q}\t$src", []>;
|
2006-09-08 06:48:29 +00:00
|
|
|
// Signed division / remainder
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
def IDIV64r: RI<0xF7, MRM7r, (outs), (ins GR64:$src), // RDX:RAX/r64 = RAX,RDX
|
2007-09-11 19:55:27 +00:00
|
|
|
"idiv{q}\t$src", []>;
|
2008-01-10 07:59:24 +00:00
|
|
|
let mayLoad = 1 in {
|
|
|
|
def DIV64m : RI<0xF7, MRM6m, (outs), (ins i64mem:$src), // RDX:RAX/[mem64] = RAX,RDX
|
|
|
|
"div{q}\t$src", []>;
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
def IDIV64m: RI<0xF7, MRM7m, (outs), (ins i64mem:$src), // RDX:RAX/[mem64] = RAX,RDX
|
2007-09-11 19:55:27 +00:00
|
|
|
"idiv{q}\t$src", []>;
|
|
|
|
}
|
2008-01-10 07:59:24 +00:00
|
|
|
}
|
2006-09-08 06:48:29 +00:00
|
|
|
|
|
|
|
// Unary instructions
|
2007-09-14 21:48:26 +00:00
|
|
|
let Defs = [EFLAGS], CodeSize = 2 in {
|
2006-09-08 06:48:29 +00:00
|
|
|
let isTwoAddress = 1 in
|
2007-07-31 20:11:57 +00:00
|
|
|
def NEG64r : RI<0xF7, MRM3r, (outs GR64:$dst), (ins GR64:$src), "neg{q}\t$dst",
|
2009-03-03 19:53:46 +00:00
|
|
|
[(set GR64:$dst, (ineg GR64:$src)),
|
|
|
|
(implicit EFLAGS)]>;
|
2007-07-31 20:11:57 +00:00
|
|
|
def NEG64m : RI<0xF7, MRM3m, (outs), (ins i64mem:$dst), "neg{q}\t$dst",
|
2009-03-03 19:53:46 +00:00
|
|
|
[(store (ineg (loadi64 addr:$dst)), addr:$dst),
|
|
|
|
(implicit EFLAGS)]>;
|
2006-09-08 06:48:29 +00:00
|
|
|
|
|
|
|
let isTwoAddress = 1, isConvertibleToThreeAddress = 1 in
|
2007-07-31 20:11:57 +00:00
|
|
|
def INC64r : RI<0xFF, MRM0r, (outs GR64:$dst), (ins GR64:$src), "inc{q}\t$dst",
|
2009-03-03 19:53:46 +00:00
|
|
|
[(set GR64:$dst, (add GR64:$src, 1)),
|
|
|
|
(implicit EFLAGS)]>;
|
2007-07-31 20:11:57 +00:00
|
|
|
def INC64m : RI<0xFF, MRM0m, (outs), (ins i64mem:$dst), "inc{q}\t$dst",
|
2009-03-03 19:53:46 +00:00
|
|
|
[(store (add (loadi64 addr:$dst), 1), addr:$dst),
|
|
|
|
(implicit EFLAGS)]>;
|
2006-09-08 06:48:29 +00:00
|
|
|
|
|
|
|
let isTwoAddress = 1, isConvertibleToThreeAddress = 1 in
|
2007-07-31 20:11:57 +00:00
|
|
|
def DEC64r : RI<0xFF, MRM1r, (outs GR64:$dst), (ins GR64:$src), "dec{q}\t$dst",
|
2009-03-03 19:53:46 +00:00
|
|
|
[(set GR64:$dst, (add GR64:$src, -1)),
|
|
|
|
(implicit EFLAGS)]>;
|
2007-07-31 20:11:57 +00:00
|
|
|
def DEC64m : RI<0xFF, MRM1m, (outs), (ins i64mem:$dst), "dec{q}\t$dst",
|
2009-03-03 19:53:46 +00:00
|
|
|
[(store (add (loadi64 addr:$dst), -1), addr:$dst),
|
|
|
|
(implicit EFLAGS)]>;
|
2006-09-08 06:48:29 +00:00
|
|
|
|
|
|
|
// In 64-bit mode, single byte INC and DEC cannot be encoded.
|
|
|
|
let isTwoAddress = 1, isConvertibleToThreeAddress = 1 in {
|
|
|
|
// Can transform into LEA.
|
2007-07-31 20:11:57 +00:00
|
|
|
def INC64_16r : I<0xFF, MRM0r, (outs GR16:$dst), (ins GR16:$src), "inc{w}\t$dst",
|
2009-03-03 19:53:46 +00:00
|
|
|
[(set GR16:$dst, (add GR16:$src, 1)),
|
|
|
|
(implicit EFLAGS)]>,
|
2006-09-08 06:48:29 +00:00
|
|
|
OpSize, Requires<[In64BitMode]>;
|
2007-07-31 20:11:57 +00:00
|
|
|
def INC64_32r : I<0xFF, MRM0r, (outs GR32:$dst), (ins GR32:$src), "inc{l}\t$dst",
|
2009-03-03 19:53:46 +00:00
|
|
|
[(set GR32:$dst, (add GR32:$src, 1)),
|
|
|
|
(implicit EFLAGS)]>,
|
2006-09-08 06:48:29 +00:00
|
|
|
Requires<[In64BitMode]>;
|
2007-07-31 20:11:57 +00:00
|
|
|
def DEC64_16r : I<0xFF, MRM1r, (outs GR16:$dst), (ins GR16:$src), "dec{w}\t$dst",
|
2009-03-03 19:53:46 +00:00
|
|
|
[(set GR16:$dst, (add GR16:$src, -1)),
|
|
|
|
(implicit EFLAGS)]>,
|
2006-09-08 06:48:29 +00:00
|
|
|
OpSize, Requires<[In64BitMode]>;
|
2007-07-31 20:11:57 +00:00
|
|
|
def DEC64_32r : I<0xFF, MRM1r, (outs GR32:$dst), (ins GR32:$src), "dec{l}\t$dst",
|
2009-03-03 19:53:46 +00:00
|
|
|
[(set GR32:$dst, (add GR32:$src, -1)),
|
|
|
|
(implicit EFLAGS)]>,
|
2006-09-08 06:48:29 +00:00
|
|
|
Requires<[In64BitMode]>;
|
|
|
|
} // isConvertibleToThreeAddress
|
2007-10-19 21:23:22 +00:00
|
|
|
|
|
|
|
// These are duplicates of their 32-bit counterparts. Only needed so X86 knows
|
|
|
|
// how to unfold them.
|
|
|
|
let isTwoAddress = 0, CodeSize = 2 in {
|
|
|
|
def INC64_16m : I<0xFF, MRM0m, (outs), (ins i16mem:$dst), "inc{w}\t$dst",
|
2009-03-03 19:53:46 +00:00
|
|
|
[(store (add (loadi16 addr:$dst), 1), addr:$dst),
|
|
|
|
(implicit EFLAGS)]>,
|
2007-10-19 21:23:22 +00:00
|
|
|
OpSize, Requires<[In64BitMode]>;
|
|
|
|
def INC64_32m : I<0xFF, MRM0m, (outs), (ins i32mem:$dst), "inc{l}\t$dst",
|
2009-03-03 19:53:46 +00:00
|
|
|
[(store (add (loadi32 addr:$dst), 1), addr:$dst),
|
|
|
|
(implicit EFLAGS)]>,
|
2007-10-19 21:23:22 +00:00
|
|
|
Requires<[In64BitMode]>;
|
|
|
|
def DEC64_16m : I<0xFF, MRM1m, (outs), (ins i16mem:$dst), "dec{w}\t$dst",
|
2009-03-03 19:53:46 +00:00
|
|
|
[(store (add (loadi16 addr:$dst), -1), addr:$dst),
|
|
|
|
(implicit EFLAGS)]>,
|
2007-10-19 21:23:22 +00:00
|
|
|
OpSize, Requires<[In64BitMode]>;
|
|
|
|
def DEC64_32m : I<0xFF, MRM1m, (outs), (ins i32mem:$dst), "dec{l}\t$dst",
|
2009-03-03 19:53:46 +00:00
|
|
|
[(store (add (loadi32 addr:$dst), -1), addr:$dst),
|
|
|
|
(implicit EFLAGS)]>,
|
2007-10-19 21:23:22 +00:00
|
|
|
Requires<[In64BitMode]>;
|
|
|
|
}
|
2007-09-14 21:48:26 +00:00
|
|
|
} // Defs = [EFLAGS], CodeSize
|
2006-09-08 06:48:29 +00:00
|
|
|
|
|
|
|
|
2007-09-14 21:48:26 +00:00
|
|
|
let Defs = [EFLAGS] in {
|
2006-09-08 06:48:29 +00:00
|
|
|
// Shift instructions
|
|
|
|
let isTwoAddress = 1 in {
|
2007-09-11 19:55:27 +00:00
|
|
|
let Uses = [CL] in
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
def SHL64rCL : RI<0xD3, MRM4r, (outs GR64:$dst), (ins GR64:$src),
|
2007-07-31 20:11:57 +00:00
|
|
|
"shl{q}\t{%cl, $dst|$dst, %CL}",
|
2007-09-11 19:55:27 +00:00
|
|
|
[(set GR64:$dst, (shl GR64:$src, CL))]>;
|
2007-10-05 18:20:36 +00:00
|
|
|
let isConvertibleToThreeAddress = 1 in // Can transform into LEA.
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
def SHL64ri : RIi8<0xC1, MRM4r, (outs GR64:$dst), (ins GR64:$src1, i8imm:$src2),
|
2007-07-31 20:11:57 +00:00
|
|
|
"shl{q}\t{$src2, $dst|$dst, $src2}",
|
2006-09-08 06:48:29 +00:00
|
|
|
[(set GR64:$dst, (shl GR64:$src1, (i8 imm:$src2)))]>;
|
2009-09-16 02:28:43 +00:00
|
|
|
// NOTE: We don't include patterns for shifts of a register by one, because
|
|
|
|
// 'add reg,reg' is cheaper.
|
|
|
|
def SHL64r1 : RI<0xD1, MRM4r, (outs GR64:$dst), (ins GR64:$src1),
|
|
|
|
"shr{q}\t$dst", []>;
|
2006-09-08 06:48:29 +00:00
|
|
|
} // isTwoAddress
|
|
|
|
|
2007-09-11 19:55:27 +00:00
|
|
|
let Uses = [CL] in
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
def SHL64mCL : RI<0xD3, MRM4m, (outs), (ins i64mem:$dst),
|
2007-07-31 20:11:57 +00:00
|
|
|
"shl{q}\t{%cl, $dst|$dst, %CL}",
|
2007-09-11 19:55:27 +00:00
|
|
|
[(store (shl (loadi64 addr:$dst), CL), addr:$dst)]>;
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
def SHL64mi : RIi8<0xC1, MRM4m, (outs), (ins i64mem:$dst, i8imm:$src),
|
2007-07-31 20:11:57 +00:00
|
|
|
"shl{q}\t{$src, $dst|$dst, $src}",
|
2006-09-08 06:48:29 +00:00
|
|
|
[(store (shl (loadi64 addr:$dst), (i8 imm:$src)), addr:$dst)]>;
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
def SHL64m1 : RI<0xD1, MRM4m, (outs), (ins i64mem:$dst),
|
2007-07-31 20:11:57 +00:00
|
|
|
"shl{q}\t$dst",
|
2006-09-08 06:48:29 +00:00
|
|
|
[(store (shl (loadi64 addr:$dst), (i8 1)), addr:$dst)]>;
|
|
|
|
|
|
|
|
let isTwoAddress = 1 in {
|
2007-09-11 19:55:27 +00:00
|
|
|
let Uses = [CL] in
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
def SHR64rCL : RI<0xD3, MRM5r, (outs GR64:$dst), (ins GR64:$src),
|
2007-07-31 20:11:57 +00:00
|
|
|
"shr{q}\t{%cl, $dst|$dst, %CL}",
|
2007-09-11 19:55:27 +00:00
|
|
|
[(set GR64:$dst, (srl GR64:$src, CL))]>;
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
def SHR64ri : RIi8<0xC1, MRM5r, (outs GR64:$dst), (ins GR64:$src1, i8imm:$src2),
|
2007-07-31 20:11:57 +00:00
|
|
|
"shr{q}\t{$src2, $dst|$dst, $src2}",
|
2006-09-08 06:48:29 +00:00
|
|
|
[(set GR64:$dst, (srl GR64:$src1, (i8 imm:$src2)))]>;
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
def SHR64r1 : RI<0xD1, MRM5r, (outs GR64:$dst), (ins GR64:$src1),
|
2007-07-31 20:11:57 +00:00
|
|
|
"shr{q}\t$dst",
|
2006-09-08 06:48:29 +00:00
|
|
|
[(set GR64:$dst, (srl GR64:$src1, (i8 1)))]>;
|
|
|
|
} // isTwoAddress
|
|
|
|
|
2007-09-11 19:55:27 +00:00
|
|
|
let Uses = [CL] in
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
def SHR64mCL : RI<0xD3, MRM5m, (outs), (ins i64mem:$dst),
|
2007-07-31 20:11:57 +00:00
|
|
|
"shr{q}\t{%cl, $dst|$dst, %CL}",
|
2007-09-11 19:55:27 +00:00
|
|
|
[(store (srl (loadi64 addr:$dst), CL), addr:$dst)]>;
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
def SHR64mi : RIi8<0xC1, MRM5m, (outs), (ins i64mem:$dst, i8imm:$src),
|
2007-07-31 20:11:57 +00:00
|
|
|
"shr{q}\t{$src, $dst|$dst, $src}",
|
2006-09-08 06:48:29 +00:00
|
|
|
[(store (srl (loadi64 addr:$dst), (i8 imm:$src)), addr:$dst)]>;
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
def SHR64m1 : RI<0xD1, MRM5m, (outs), (ins i64mem:$dst),
|
2007-07-31 20:11:57 +00:00
|
|
|
"shr{q}\t$dst",
|
2006-09-08 06:48:29 +00:00
|
|
|
[(store (srl (loadi64 addr:$dst), (i8 1)), addr:$dst)]>;
|
|
|
|
|
|
|
|
let isTwoAddress = 1 in {
|
2007-09-11 19:55:27 +00:00
|
|
|
let Uses = [CL] in
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
def SAR64rCL : RI<0xD3, MRM7r, (outs GR64:$dst), (ins GR64:$src),
|
2007-07-31 20:11:57 +00:00
|
|
|
"sar{q}\t{%cl, $dst|$dst, %CL}",
|
2007-09-11 19:55:27 +00:00
|
|
|
[(set GR64:$dst, (sra GR64:$src, CL))]>;
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
def SAR64ri : RIi8<0xC1, MRM7r, (outs GR64:$dst), (ins GR64:$src1, i8imm:$src2),
|
2007-07-31 20:11:57 +00:00
|
|
|
"sar{q}\t{$src2, $dst|$dst, $src2}",
|
2006-09-08 06:48:29 +00:00
|
|
|
[(set GR64:$dst, (sra GR64:$src1, (i8 imm:$src2)))]>;
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
def SAR64r1 : RI<0xD1, MRM7r, (outs GR64:$dst), (ins GR64:$src1),
|
2007-07-31 20:11:57 +00:00
|
|
|
"sar{q}\t$dst",
|
2006-09-08 06:48:29 +00:00
|
|
|
[(set GR64:$dst, (sra GR64:$src1, (i8 1)))]>;
|
|
|
|
} // isTwoAddress
|
|
|
|
|
2007-09-11 19:55:27 +00:00
|
|
|
let Uses = [CL] in
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
def SAR64mCL : RI<0xD3, MRM7m, (outs), (ins i64mem:$dst),
|
2007-07-31 20:11:57 +00:00
|
|
|
"sar{q}\t{%cl, $dst|$dst, %CL}",
|
2007-09-11 19:55:27 +00:00
|
|
|
[(store (sra (loadi64 addr:$dst), CL), addr:$dst)]>;
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
def SAR64mi : RIi8<0xC1, MRM7m, (outs), (ins i64mem:$dst, i8imm:$src),
|
2007-07-31 20:11:57 +00:00
|
|
|
"sar{q}\t{$src, $dst|$dst, $src}",
|
2006-09-08 06:48:29 +00:00
|
|
|
[(store (sra (loadi64 addr:$dst), (i8 imm:$src)), addr:$dst)]>;
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
def SAR64m1 : RI<0xD1, MRM7m, (outs), (ins i64mem:$dst),
|
2007-07-31 20:11:57 +00:00
|
|
|
"sar{q}\t$dst",
|
2006-09-08 06:48:29 +00:00
|
|
|
[(store (sra (loadi64 addr:$dst), (i8 1)), addr:$dst)]>;
|
|
|
|
|
|
|
|
// Rotate instructions
|
|
|
|
let isTwoAddress = 1 in {
|
2007-09-11 19:55:27 +00:00
|
|
|
let Uses = [CL] in
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
def ROL64rCL : RI<0xD3, MRM0r, (outs GR64:$dst), (ins GR64:$src),
|
2007-07-31 20:11:57 +00:00
|
|
|
"rol{q}\t{%cl, $dst|$dst, %CL}",
|
2007-09-11 19:55:27 +00:00
|
|
|
[(set GR64:$dst, (rotl GR64:$src, CL))]>;
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
def ROL64ri : RIi8<0xC1, MRM0r, (outs GR64:$dst), (ins GR64:$src1, i8imm:$src2),
|
2007-07-31 20:11:57 +00:00
|
|
|
"rol{q}\t{$src2, $dst|$dst, $src2}",
|
2006-09-08 06:48:29 +00:00
|
|
|
[(set GR64:$dst, (rotl GR64:$src1, (i8 imm:$src2)))]>;
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
def ROL64r1 : RI<0xD1, MRM0r, (outs GR64:$dst), (ins GR64:$src1),
|
2007-07-31 20:11:57 +00:00
|
|
|
"rol{q}\t$dst",
|
2006-09-08 06:48:29 +00:00
|
|
|
[(set GR64:$dst, (rotl GR64:$src1, (i8 1)))]>;
|
|
|
|
} // isTwoAddress
|
|
|
|
|
2007-09-11 19:55:27 +00:00
|
|
|
let Uses = [CL] in
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
def ROL64mCL : I<0xD3, MRM0m, (outs), (ins i64mem:$dst),
|
2007-07-31 20:11:57 +00:00
|
|
|
"rol{q}\t{%cl, $dst|$dst, %CL}",
|
2007-09-11 19:55:27 +00:00
|
|
|
[(store (rotl (loadi64 addr:$dst), CL), addr:$dst)]>;
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
def ROL64mi : RIi8<0xC1, MRM0m, (outs), (ins i64mem:$dst, i8imm:$src),
|
2007-07-31 20:11:57 +00:00
|
|
|
"rol{q}\t{$src, $dst|$dst, $src}",
|
2006-09-08 06:48:29 +00:00
|
|
|
[(store (rotl (loadi64 addr:$dst), (i8 imm:$src)), addr:$dst)]>;
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
def ROL64m1 : RI<0xD1, MRM0m, (outs), (ins i64mem:$dst),
|
2007-07-31 20:11:57 +00:00
|
|
|
"rol{q}\t$dst",
|
2006-09-08 06:48:29 +00:00
|
|
|
[(store (rotl (loadi64 addr:$dst), (i8 1)), addr:$dst)]>;
|
|
|
|
|
|
|
|
let isTwoAddress = 1 in {
|
2007-09-11 19:55:27 +00:00
|
|
|
let Uses = [CL] in
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
def ROR64rCL : RI<0xD3, MRM1r, (outs GR64:$dst), (ins GR64:$src),
|
2007-07-31 20:11:57 +00:00
|
|
|
"ror{q}\t{%cl, $dst|$dst, %CL}",
|
2007-09-11 19:55:27 +00:00
|
|
|
[(set GR64:$dst, (rotr GR64:$src, CL))]>;
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
def ROR64ri : RIi8<0xC1, MRM1r, (outs GR64:$dst), (ins GR64:$src1, i8imm:$src2),
|
2007-07-31 20:11:57 +00:00
|
|
|
"ror{q}\t{$src2, $dst|$dst, $src2}",
|
2006-09-08 06:48:29 +00:00
|
|
|
[(set GR64:$dst, (rotr GR64:$src1, (i8 imm:$src2)))]>;
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
def ROR64r1 : RI<0xD1, MRM1r, (outs GR64:$dst), (ins GR64:$src1),
|
2007-07-31 20:11:57 +00:00
|
|
|
"ror{q}\t$dst",
|
2006-09-08 06:48:29 +00:00
|
|
|
[(set GR64:$dst, (rotr GR64:$src1, (i8 1)))]>;
|
|
|
|
} // isTwoAddress
|
|
|
|
|
2007-09-11 19:55:27 +00:00
|
|
|
let Uses = [CL] in
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
def ROR64mCL : RI<0xD3, MRM1m, (outs), (ins i64mem:$dst),
|
2007-07-31 20:11:57 +00:00
|
|
|
"ror{q}\t{%cl, $dst|$dst, %CL}",
|
2007-09-11 19:55:27 +00:00
|
|
|
[(store (rotr (loadi64 addr:$dst), CL), addr:$dst)]>;
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
def ROR64mi : RIi8<0xC1, MRM1m, (outs), (ins i64mem:$dst, i8imm:$src),
|
2007-07-31 20:11:57 +00:00
|
|
|
"ror{q}\t{$src, $dst|$dst, $src}",
|
2006-09-08 06:48:29 +00:00
|
|
|
[(store (rotr (loadi64 addr:$dst), (i8 imm:$src)), addr:$dst)]>;
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
def ROR64m1 : RI<0xD1, MRM1m, (outs), (ins i64mem:$dst),
|
2007-07-31 20:11:57 +00:00
|
|
|
"ror{q}\t$dst",
|
2006-09-08 06:48:29 +00:00
|
|
|
[(store (rotr (loadi64 addr:$dst), (i8 1)), addr:$dst)]>;
|
|
|
|
|
|
|
|
// Double shift instructions (generalizations of rotate)
|
|
|
|
let isTwoAddress = 1 in {
|
2007-09-11 19:55:27 +00:00
|
|
|
let Uses = [CL] in {
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
def SHLD64rrCL : RI<0xA5, MRMDestReg, (outs GR64:$dst), (ins GR64:$src1, GR64:$src2),
|
2007-09-14 23:17:45 +00:00
|
|
|
"shld{q}\t{%cl, $src2, $dst|$dst, $src2, %CL}",
|
|
|
|
[(set GR64:$dst, (X86shld GR64:$src1, GR64:$src2, CL))]>, TB;
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
def SHRD64rrCL : RI<0xAD, MRMDestReg, (outs GR64:$dst), (ins GR64:$src1, GR64:$src2),
|
2007-09-14 23:17:45 +00:00
|
|
|
"shrd{q}\t{%cl, $src2, $dst|$dst, $src2, %CL}",
|
|
|
|
[(set GR64:$dst, (X86shrd GR64:$src1, GR64:$src2, CL))]>, TB;
|
2007-09-11 19:55:27 +00:00
|
|
|
}
|
2006-09-08 06:48:29 +00:00
|
|
|
|
|
|
|
let isCommutable = 1 in { // FIXME: Update X86InstrInfo::commuteInstruction
|
|
|
|
def SHLD64rri8 : RIi8<0xA4, MRMDestReg,
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
(outs GR64:$dst), (ins GR64:$src1, GR64:$src2, i8imm:$src3),
|
2007-09-14 23:17:45 +00:00
|
|
|
"shld{q}\t{$src3, $src2, $dst|$dst, $src2, $src3}",
|
|
|
|
[(set GR64:$dst, (X86shld GR64:$src1, GR64:$src2,
|
|
|
|
(i8 imm:$src3)))]>,
|
|
|
|
TB;
|
2006-09-08 06:48:29 +00:00
|
|
|
def SHRD64rri8 : RIi8<0xAC, MRMDestReg,
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
(outs GR64:$dst), (ins GR64:$src1, GR64:$src2, i8imm:$src3),
|
2007-09-14 23:17:45 +00:00
|
|
|
"shrd{q}\t{$src3, $src2, $dst|$dst, $src2, $src3}",
|
|
|
|
[(set GR64:$dst, (X86shrd GR64:$src1, GR64:$src2,
|
|
|
|
(i8 imm:$src3)))]>,
|
2006-09-08 06:48:29 +00:00
|
|
|
TB;
|
|
|
|
} // isCommutable
|
|
|
|
} // isTwoAddress
|
|
|
|
|
2007-09-11 19:55:27 +00:00
|
|
|
let Uses = [CL] in {
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
def SHLD64mrCL : RI<0xA5, MRMDestMem, (outs), (ins i64mem:$dst, GR64:$src2),
|
2007-09-14 23:17:45 +00:00
|
|
|
"shld{q}\t{%cl, $src2, $dst|$dst, $src2, %CL}",
|
|
|
|
[(store (X86shld (loadi64 addr:$dst), GR64:$src2, CL),
|
|
|
|
addr:$dst)]>, TB;
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
def SHRD64mrCL : RI<0xAD, MRMDestMem, (outs), (ins i64mem:$dst, GR64:$src2),
|
2007-09-14 23:17:45 +00:00
|
|
|
"shrd{q}\t{%cl, $src2, $dst|$dst, $src2, %CL}",
|
|
|
|
[(store (X86shrd (loadi64 addr:$dst), GR64:$src2, CL),
|
|
|
|
addr:$dst)]>, TB;
|
2007-09-11 19:55:27 +00:00
|
|
|
}
|
2006-09-08 06:48:29 +00:00
|
|
|
def SHLD64mri8 : RIi8<0xA4, MRMDestMem,
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
(outs), (ins i64mem:$dst, GR64:$src2, i8imm:$src3),
|
2007-09-14 23:17:45 +00:00
|
|
|
"shld{q}\t{$src3, $src2, $dst|$dst, $src2, $src3}",
|
|
|
|
[(store (X86shld (loadi64 addr:$dst), GR64:$src2,
|
|
|
|
(i8 imm:$src3)), addr:$dst)]>,
|
2006-09-08 06:48:29 +00:00
|
|
|
TB;
|
|
|
|
def SHRD64mri8 : RIi8<0xAC, MRMDestMem,
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
(outs), (ins i64mem:$dst, GR64:$src2, i8imm:$src3),
|
2007-09-14 23:17:45 +00:00
|
|
|
"shrd{q}\t{$src3, $src2, $dst|$dst, $src2, $src3}",
|
|
|
|
[(store (X86shrd (loadi64 addr:$dst), GR64:$src2,
|
|
|
|
(i8 imm:$src3)), addr:$dst)]>,
|
2006-09-08 06:48:29 +00:00
|
|
|
TB;
|
2007-09-14 21:48:26 +00:00
|
|
|
} // Defs = [EFLAGS]
|
2006-09-08 06:48:29 +00:00
|
|
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// Logical Instructions...
|
|
|
|
//
|
|
|
|
|
2009-01-21 19:45:31 +00:00
|
|
|
let isTwoAddress = 1 , AddedComplexity = 15 in
|
2007-07-31 20:11:57 +00:00
|
|
|
def NOT64r : RI<0xF7, MRM2r, (outs GR64:$dst), (ins GR64:$src), "not{q}\t$dst",
|
2006-09-08 06:48:29 +00:00
|
|
|
[(set GR64:$dst, (not GR64:$src))]>;
|
2007-07-31 20:11:57 +00:00
|
|
|
def NOT64m : RI<0xF7, MRM2m, (outs), (ins i64mem:$dst), "not{q}\t$dst",
|
2006-09-08 06:48:29 +00:00
|
|
|
[(store (not (loadi64 addr:$dst)), addr:$dst)]>;
|
|
|
|
|
2007-09-14 21:48:26 +00:00
|
|
|
let Defs = [EFLAGS] in {
|
2009-09-02 00:55:49 +00:00
|
|
|
def AND64i32 : RI<0x25, RawFrm, (outs), (ins i32imm:$src),
|
|
|
|
"and{q}\t{$src, %rax|%rax, $src}", []>;
|
|
|
|
|
2006-09-08 06:48:29 +00:00
|
|
|
let isTwoAddress = 1 in {
|
|
|
|
let isCommutable = 1 in
|
|
|
|
def AND64rr : RI<0x21, MRMDestReg,
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
(outs GR64:$dst), (ins GR64:$src1, GR64:$src2),
|
2007-07-31 20:11:57 +00:00
|
|
|
"and{q}\t{$src2, $dst|$dst, $src2}",
|
2009-03-03 19:53:46 +00:00
|
|
|
[(set GR64:$dst, (and GR64:$src1, GR64:$src2)),
|
|
|
|
(implicit EFLAGS)]>;
|
2006-09-08 06:48:29 +00:00
|
|
|
def AND64rm : RI<0x23, MRMSrcMem,
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
(outs GR64:$dst), (ins GR64:$src1, i64mem:$src2),
|
2007-07-31 20:11:57 +00:00
|
|
|
"and{q}\t{$src2, $dst|$dst, $src2}",
|
2009-03-03 19:53:46 +00:00
|
|
|
[(set GR64:$dst, (and GR64:$src1, (load addr:$src2))),
|
|
|
|
(implicit EFLAGS)]>;
|
2006-09-08 06:48:29 +00:00
|
|
|
def AND64ri8 : RIi8<0x83, MRM4r,
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
(outs GR64:$dst), (ins GR64:$src1, i64i8imm:$src2),
|
2007-07-31 20:11:57 +00:00
|
|
|
"and{q}\t{$src2, $dst|$dst, $src2}",
|
2009-03-03 19:53:46 +00:00
|
|
|
[(set GR64:$dst, (and GR64:$src1, i64immSExt8:$src2)),
|
|
|
|
(implicit EFLAGS)]>;
|
2008-12-19 18:25:21 +00:00
|
|
|
def AND64ri32 : RIi32<0x81, MRM4r,
|
|
|
|
(outs GR64:$dst), (ins GR64:$src1, i64i32imm:$src2),
|
|
|
|
"and{q}\t{$src2, $dst|$dst, $src2}",
|
2009-03-03 19:53:46 +00:00
|
|
|
[(set GR64:$dst, (and GR64:$src1, i64immSExt32:$src2)),
|
|
|
|
(implicit EFLAGS)]>;
|
2006-09-08 06:48:29 +00:00
|
|
|
} // isTwoAddress
|
|
|
|
|
|
|
|
def AND64mr : RI<0x21, MRMDestMem,
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
(outs), (ins i64mem:$dst, GR64:$src),
|
2007-07-31 20:11:57 +00:00
|
|
|
"and{q}\t{$src, $dst|$dst, $src}",
|
2009-03-03 19:53:46 +00:00
|
|
|
[(store (and (load addr:$dst), GR64:$src), addr:$dst),
|
|
|
|
(implicit EFLAGS)]>;
|
2006-09-08 06:48:29 +00:00
|
|
|
def AND64mi8 : RIi8<0x83, MRM4m,
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
(outs), (ins i64mem:$dst, i64i8imm :$src),
|
2007-07-31 20:11:57 +00:00
|
|
|
"and{q}\t{$src, $dst|$dst, $src}",
|
2009-03-03 19:53:46 +00:00
|
|
|
[(store (and (load addr:$dst), i64immSExt8:$src), addr:$dst),
|
|
|
|
(implicit EFLAGS)]>;
|
2008-12-19 18:25:21 +00:00
|
|
|
def AND64mi32 : RIi32<0x81, MRM4m,
|
|
|
|
(outs), (ins i64mem:$dst, i64i32imm:$src),
|
|
|
|
"and{q}\t{$src, $dst|$dst, $src}",
|
2009-03-03 19:53:46 +00:00
|
|
|
[(store (and (loadi64 addr:$dst), i64immSExt32:$src), addr:$dst),
|
|
|
|
(implicit EFLAGS)]>;
|
2006-09-08 06:48:29 +00:00
|
|
|
|
|
|
|
let isTwoAddress = 1 in {
|
|
|
|
let isCommutable = 1 in
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
def OR64rr : RI<0x09, MRMDestReg, (outs GR64:$dst), (ins GR64:$src1, GR64:$src2),
|
2007-07-31 20:11:57 +00:00
|
|
|
"or{q}\t{$src2, $dst|$dst, $src2}",
|
2009-03-03 19:53:46 +00:00
|
|
|
[(set GR64:$dst, (or GR64:$src1, GR64:$src2)),
|
|
|
|
(implicit EFLAGS)]>;
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
def OR64rm : RI<0x0B, MRMSrcMem , (outs GR64:$dst), (ins GR64:$src1, i64mem:$src2),
|
2007-07-31 20:11:57 +00:00
|
|
|
"or{q}\t{$src2, $dst|$dst, $src2}",
|
2009-03-03 19:53:46 +00:00
|
|
|
[(set GR64:$dst, (or GR64:$src1, (load addr:$src2))),
|
|
|
|
(implicit EFLAGS)]>;
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
def OR64ri8 : RIi8<0x83, MRM1r, (outs GR64:$dst), (ins GR64:$src1, i64i8imm:$src2),
|
2007-07-31 20:11:57 +00:00
|
|
|
"or{q}\t{$src2, $dst|$dst, $src2}",
|
2009-03-03 19:53:46 +00:00
|
|
|
[(set GR64:$dst, (or GR64:$src1, i64immSExt8:$src2)),
|
|
|
|
(implicit EFLAGS)]>;
|
2008-12-19 18:25:21 +00:00
|
|
|
def OR64ri32 : RIi32<0x81, MRM1r, (outs GR64:$dst), (ins GR64:$src1, i64i32imm:$src2),
|
|
|
|
"or{q}\t{$src2, $dst|$dst, $src2}",
|
2009-03-03 19:53:46 +00:00
|
|
|
[(set GR64:$dst, (or GR64:$src1, i64immSExt32:$src2)),
|
|
|
|
(implicit EFLAGS)]>;
|
2006-09-08 06:48:29 +00:00
|
|
|
} // isTwoAddress
|
|
|
|
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
def OR64mr : RI<0x09, MRMDestMem, (outs), (ins i64mem:$dst, GR64:$src),
|
2007-07-31 20:11:57 +00:00
|
|
|
"or{q}\t{$src, $dst|$dst, $src}",
|
2009-03-03 19:53:46 +00:00
|
|
|
[(store (or (load addr:$dst), GR64:$src), addr:$dst),
|
|
|
|
(implicit EFLAGS)]>;
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
def OR64mi8 : RIi8<0x83, MRM1m, (outs), (ins i64mem:$dst, i64i8imm:$src),
|
2007-07-31 20:11:57 +00:00
|
|
|
"or{q}\t{$src, $dst|$dst, $src}",
|
2009-03-03 19:53:46 +00:00
|
|
|
[(store (or (load addr:$dst), i64immSExt8:$src), addr:$dst),
|
|
|
|
(implicit EFLAGS)]>;
|
2008-12-19 18:25:21 +00:00
|
|
|
def OR64mi32 : RIi32<0x81, MRM1m, (outs), (ins i64mem:$dst, i64i32imm:$src),
|
|
|
|
"or{q}\t{$src, $dst|$dst, $src}",
|
2009-03-03 19:53:46 +00:00
|
|
|
[(store (or (loadi64 addr:$dst), i64immSExt32:$src), addr:$dst),
|
|
|
|
(implicit EFLAGS)]>;
|
2006-09-08 06:48:29 +00:00
|
|
|
|
2009-09-11 19:01:56 +00:00
|
|
|
def OR64i32 : RIi32<0x0D, RawFrm, (outs), (ins i32imm:$src),
|
|
|
|
"or{q}\t{$src, %rax|%rax, $src}", []>;
|
|
|
|
|
2006-09-08 06:48:29 +00:00
|
|
|
let isTwoAddress = 1 in {
|
2008-08-30 08:54:22 +00:00
|
|
|
let isCommutable = 1 in
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
def XOR64rr : RI<0x31, MRMDestReg, (outs GR64:$dst), (ins GR64:$src1, GR64:$src2),
|
2007-07-31 20:11:57 +00:00
|
|
|
"xor{q}\t{$src2, $dst|$dst, $src2}",
|
2009-03-03 19:53:46 +00:00
|
|
|
[(set GR64:$dst, (xor GR64:$src1, GR64:$src2)),
|
|
|
|
(implicit EFLAGS)]>;
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
def XOR64rm : RI<0x33, MRMSrcMem, (outs GR64:$dst), (ins GR64:$src1, i64mem:$src2),
|
2007-07-31 20:11:57 +00:00
|
|
|
"xor{q}\t{$src2, $dst|$dst, $src2}",
|
2009-03-03 19:53:46 +00:00
|
|
|
[(set GR64:$dst, (xor GR64:$src1, (load addr:$src2))),
|
|
|
|
(implicit EFLAGS)]>;
|
2008-12-19 18:25:21 +00:00
|
|
|
def XOR64ri8 : RIi8<0x83, MRM6r, (outs GR64:$dst), (ins GR64:$src1, i64i8imm:$src2),
|
|
|
|
"xor{q}\t{$src2, $dst|$dst, $src2}",
|
2009-03-03 19:53:46 +00:00
|
|
|
[(set GR64:$dst, (xor GR64:$src1, i64immSExt8:$src2)),
|
|
|
|
(implicit EFLAGS)]>;
|
2006-09-08 06:48:29 +00:00
|
|
|
def XOR64ri32 : RIi32<0x81, MRM6r,
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
(outs GR64:$dst), (ins GR64:$src1, i64i32imm:$src2),
|
2007-07-31 20:11:57 +00:00
|
|
|
"xor{q}\t{$src2, $dst|$dst, $src2}",
|
2009-03-03 19:53:46 +00:00
|
|
|
[(set GR64:$dst, (xor GR64:$src1, i64immSExt32:$src2)),
|
|
|
|
(implicit EFLAGS)]>;
|
2006-09-08 06:48:29 +00:00
|
|
|
} // isTwoAddress
|
|
|
|
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
def XOR64mr : RI<0x31, MRMDestMem, (outs), (ins i64mem:$dst, GR64:$src),
|
2007-07-31 20:11:57 +00:00
|
|
|
"xor{q}\t{$src, $dst|$dst, $src}",
|
2009-03-03 19:53:46 +00:00
|
|
|
[(store (xor (load addr:$dst), GR64:$src), addr:$dst),
|
|
|
|
(implicit EFLAGS)]>;
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
def XOR64mi8 : RIi8<0x83, MRM6m, (outs), (ins i64mem:$dst, i64i8imm :$src),
|
2007-07-31 20:11:57 +00:00
|
|
|
"xor{q}\t{$src, $dst|$dst, $src}",
|
2009-03-03 19:53:46 +00:00
|
|
|
[(store (xor (load addr:$dst), i64immSExt8:$src), addr:$dst),
|
|
|
|
(implicit EFLAGS)]>;
|
2008-12-19 18:25:21 +00:00
|
|
|
def XOR64mi32 : RIi32<0x81, MRM6m, (outs), (ins i64mem:$dst, i64i32imm:$src),
|
|
|
|
"xor{q}\t{$src, $dst|$dst, $src}",
|
2009-03-03 19:53:46 +00:00
|
|
|
[(store (xor (loadi64 addr:$dst), i64immSExt32:$src), addr:$dst),
|
|
|
|
(implicit EFLAGS)]>;
|
2009-09-10 19:52:26 +00:00
|
|
|
|
|
|
|
def XOR64i32 : RIi32<0x35, RawFrm, (outs), (ins i32imm:$src),
|
|
|
|
"xor{q}\t{$src, %rax|%rax, $src}", []>;
|
|
|
|
|
2007-09-14 21:48:26 +00:00
|
|
|
} // Defs = [EFLAGS]
|
2006-09-08 06:48:29 +00:00
|
|
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// Comparison Instructions...
|
|
|
|
//
|
|
|
|
|
|
|
|
// Integer comparison
|
2007-09-14 21:48:26 +00:00
|
|
|
let Defs = [EFLAGS] in {
|
2009-09-01 18:14:18 +00:00
|
|
|
def TEST64i32 : RI<0xa9, RawFrm, (outs), (ins i32imm:$src),
|
|
|
|
"test{q}\t{$src, %rax|%rax, $src}", []>;
|
2006-09-08 06:48:29 +00:00
|
|
|
let isCommutable = 1 in
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
def TEST64rr : RI<0x85, MRMDestReg, (outs), (ins GR64:$src1, GR64:$src2),
|
2007-07-31 20:11:57 +00:00
|
|
|
"test{q}\t{$src2, $src1|$src1, $src2}",
|
2007-09-29 00:00:36 +00:00
|
|
|
[(X86cmp (and GR64:$src1, GR64:$src2), 0),
|
2007-09-25 01:57:46 +00:00
|
|
|
(implicit EFLAGS)]>;
|
2007-09-29 00:00:36 +00:00
|
|
|
def TEST64rm : RI<0x85, MRMSrcMem, (outs), (ins GR64:$src1, i64mem:$src2),
|
2007-09-25 01:57:46 +00:00
|
|
|
"test{q}\t{$src2, $src1|$src1, $src2}",
|
2007-09-29 00:00:36 +00:00
|
|
|
[(X86cmp (and GR64:$src1, (loadi64 addr:$src2)), 0),
|
2007-09-25 01:57:46 +00:00
|
|
|
(implicit EFLAGS)]>;
|
2007-09-29 00:00:36 +00:00
|
|
|
def TEST64ri32 : RIi32<0xF7, MRM0r, (outs),
|
2007-09-25 01:57:46 +00:00
|
|
|
(ins GR64:$src1, i64i32imm:$src2),
|
|
|
|
"test{q}\t{$src2, $src1|$src1, $src2}",
|
2007-09-29 00:00:36 +00:00
|
|
|
[(X86cmp (and GR64:$src1, i64immSExt32:$src2), 0),
|
2007-09-25 01:57:46 +00:00
|
|
|
(implicit EFLAGS)]>;
|
2007-09-29 00:00:36 +00:00
|
|
|
def TEST64mi32 : RIi32<0xF7, MRM0m, (outs),
|
2007-09-25 01:57:46 +00:00
|
|
|
(ins i64mem:$src1, i64i32imm:$src2),
|
|
|
|
"test{q}\t{$src2, $src1|$src1, $src2}",
|
2007-09-29 00:00:36 +00:00
|
|
|
[(X86cmp (and (loadi64 addr:$src1), i64immSExt32:$src2), 0),
|
2007-09-25 01:57:46 +00:00
|
|
|
(implicit EFLAGS)]>;
|
|
|
|
|
2009-09-02 00:55:49 +00:00
|
|
|
|
|
|
|
def CMP64i32 : RI<0x3D, RawFrm, (outs), (ins i32imm:$src),
|
|
|
|
"cmp{q}\t{$src, %rax|%rax, $src}", []>;
|
2007-09-29 00:00:36 +00:00
|
|
|
def CMP64rr : RI<0x39, MRMDestReg, (outs), (ins GR64:$src1, GR64:$src2),
|
2007-09-25 01:57:46 +00:00
|
|
|
"cmp{q}\t{$src2, $src1|$src1, $src2}",
|
2007-09-29 00:00:36 +00:00
|
|
|
[(X86cmp GR64:$src1, GR64:$src2),
|
2007-09-25 01:57:46 +00:00
|
|
|
(implicit EFLAGS)]>;
|
2009-09-16 21:11:23 +00:00
|
|
|
def CMP64mrmrr : RI<0x3B, MRMSrcReg, (outs), (ins GR64:$src1, GR64:$src2),
|
|
|
|
"cmp{q}\t{$src2, $src1|$src1, $src2}", []>;
|
2007-09-29 00:00:36 +00:00
|
|
|
def CMP64mr : RI<0x39, MRMDestMem, (outs), (ins i64mem:$src1, GR64:$src2),
|
2007-09-25 01:57:46 +00:00
|
|
|
"cmp{q}\t{$src2, $src1|$src1, $src2}",
|
2007-09-29 00:00:36 +00:00
|
|
|
[(X86cmp (loadi64 addr:$src1), GR64:$src2),
|
2007-09-25 01:57:46 +00:00
|
|
|
(implicit EFLAGS)]>;
|
2007-09-29 00:00:36 +00:00
|
|
|
def CMP64rm : RI<0x3B, MRMSrcMem, (outs), (ins GR64:$src1, i64mem:$src2),
|
2007-09-25 01:57:46 +00:00
|
|
|
"cmp{q}\t{$src2, $src1|$src1, $src2}",
|
2007-09-29 00:00:36 +00:00
|
|
|
[(X86cmp GR64:$src1, (loadi64 addr:$src2)),
|
2007-09-25 01:57:46 +00:00
|
|
|
(implicit EFLAGS)]>;
|
2008-12-19 18:25:21 +00:00
|
|
|
def CMP64ri8 : RIi8<0x83, MRM7r, (outs), (ins GR64:$src1, i64i8imm:$src2),
|
|
|
|
"cmp{q}\t{$src2, $src1|$src1, $src2}",
|
|
|
|
[(X86cmp GR64:$src1, i64immSExt8:$src2),
|
|
|
|
(implicit EFLAGS)]>;
|
2007-09-29 00:00:36 +00:00
|
|
|
def CMP64ri32 : RIi32<0x81, MRM7r, (outs), (ins GR64:$src1, i64i32imm:$src2),
|
2007-09-25 01:57:46 +00:00
|
|
|
"cmp{q}\t{$src2, $src1|$src1, $src2}",
|
2007-09-29 00:00:36 +00:00
|
|
|
[(X86cmp GR64:$src1, i64immSExt32:$src2),
|
2007-09-25 01:57:46 +00:00
|
|
|
(implicit EFLAGS)]>;
|
2008-12-19 18:25:21 +00:00
|
|
|
def CMP64mi8 : RIi8<0x83, MRM7m, (outs), (ins i64mem:$src1, i64i8imm:$src2),
|
|
|
|
"cmp{q}\t{$src2, $src1|$src1, $src2}",
|
|
|
|
[(X86cmp (loadi64 addr:$src1), i64immSExt8:$src2),
|
|
|
|
(implicit EFLAGS)]>;
|
2007-09-29 00:00:36 +00:00
|
|
|
def CMP64mi32 : RIi32<0x81, MRM7m, (outs),
|
2007-09-25 01:57:46 +00:00
|
|
|
(ins i64mem:$src1, i64i32imm:$src2),
|
|
|
|
"cmp{q}\t{$src2, $src1|$src1, $src2}",
|
2007-09-29 00:00:36 +00:00
|
|
|
[(X86cmp (loadi64 addr:$src1), i64immSExt32:$src2),
|
2007-09-25 01:57:46 +00:00
|
|
|
(implicit EFLAGS)]>;
|
|
|
|
} // Defs = [EFLAGS]
|
|
|
|
|
2008-12-23 22:45:23 +00:00
|
|
|
// Bit tests.
|
|
|
|
// TODO: BTC, BTR, and BTS
|
|
|
|
let Defs = [EFLAGS] in {
|
2008-12-25 01:32:49 +00:00
|
|
|
def BT64rr : RI<0xA3, MRMDestReg, (outs), (ins GR64:$src1, GR64:$src2),
|
2008-12-23 22:45:23 +00:00
|
|
|
"bt{q}\t{$src2, $src1|$src1, $src2}",
|
|
|
|
[(X86bt GR64:$src1, GR64:$src2),
|
2008-12-25 01:32:49 +00:00
|
|
|
(implicit EFLAGS)]>, TB;
|
2009-01-13 23:23:30 +00:00
|
|
|
|
|
|
|
// Unlike with the register+register form, the memory+register form of the
|
|
|
|
// bt instruction does not ignore the high bits of the index. From ISel's
|
|
|
|
// perspective, this is pretty bizarre. Disable these instructions for now.
|
|
|
|
//def BT64mr : RI<0xA3, MRMDestMem, (outs), (ins i64mem:$src1, GR64:$src2),
|
|
|
|
// "bt{q}\t{$src2, $src1|$src1, $src2}",
|
|
|
|
// [(X86bt (loadi64 addr:$src1), GR64:$src2),
|
|
|
|
// (implicit EFLAGS)]>, TB;
|
2009-01-13 20:33:23 +00:00
|
|
|
|
|
|
|
def BT64ri8 : Ii8<0xBA, MRM4r, (outs), (ins GR64:$src1, i64i8imm:$src2),
|
|
|
|
"bt{q}\t{$src2, $src1|$src1, $src2}",
|
|
|
|
[(X86bt GR64:$src1, i64immSExt8:$src2),
|
|
|
|
(implicit EFLAGS)]>, TB;
|
|
|
|
// Note that these instructions don't need FastBTMem because that
|
|
|
|
// only applies when the other operand is in a register. When it's
|
|
|
|
// an immediate, bt is still fast.
|
|
|
|
def BT64mi8 : Ii8<0xBA, MRM4m, (outs), (ins i64mem:$src1, i64i8imm:$src2),
|
|
|
|
"bt{q}\t{$src2, $src1|$src1, $src2}",
|
|
|
|
[(X86bt (loadi64 addr:$src1), i64immSExt8:$src2),
|
|
|
|
(implicit EFLAGS)]>, TB;
|
2008-12-23 22:45:23 +00:00
|
|
|
} // Defs = [EFLAGS]
|
|
|
|
|
2006-09-08 06:48:29 +00:00
|
|
|
// Conditional moves
|
2007-09-25 01:57:46 +00:00
|
|
|
let Uses = [EFLAGS], isTwoAddress = 1 in {
|
2007-10-05 23:13:21 +00:00
|
|
|
let isCommutable = 1 in {
|
2006-09-08 06:48:29 +00:00
|
|
|
def CMOVB64rr : RI<0x42, MRMSrcReg, // if <u, GR64 = GR64
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
(outs GR64:$dst), (ins GR64:$src1, GR64:$src2),
|
2007-07-31 20:11:57 +00:00
|
|
|
"cmovb\t{$src2, $dst|$dst, $src2}",
|
2006-09-08 06:48:29 +00:00
|
|
|
[(set GR64:$dst, (X86cmov GR64:$src1, GR64:$src2,
|
2007-09-29 00:00:36 +00:00
|
|
|
X86_COND_B, EFLAGS))]>, TB;
|
2006-09-08 06:48:29 +00:00
|
|
|
def CMOVAE64rr: RI<0x43, MRMSrcReg, // if >=u, GR64 = GR64
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
(outs GR64:$dst), (ins GR64:$src1, GR64:$src2),
|
2007-07-31 20:11:57 +00:00
|
|
|
"cmovae\t{$src2, $dst|$dst, $src2}",
|
2006-09-08 06:48:29 +00:00
|
|
|
[(set GR64:$dst, (X86cmov GR64:$src1, GR64:$src2,
|
2007-09-29 00:00:36 +00:00
|
|
|
X86_COND_AE, EFLAGS))]>, TB;
|
2006-09-08 06:48:29 +00:00
|
|
|
def CMOVE64rr : RI<0x44, MRMSrcReg, // if ==, GR64 = GR64
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
(outs GR64:$dst), (ins GR64:$src1, GR64:$src2),
|
2007-07-31 20:11:57 +00:00
|
|
|
"cmove\t{$src2, $dst|$dst, $src2}",
|
2006-09-08 06:48:29 +00:00
|
|
|
[(set GR64:$dst, (X86cmov GR64:$src1, GR64:$src2,
|
2007-09-29 00:00:36 +00:00
|
|
|
X86_COND_E, EFLAGS))]>, TB;
|
2006-09-08 06:48:29 +00:00
|
|
|
def CMOVNE64rr: RI<0x45, MRMSrcReg, // if !=, GR64 = GR64
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
(outs GR64:$dst), (ins GR64:$src1, GR64:$src2),
|
2007-07-31 20:11:57 +00:00
|
|
|
"cmovne\t{$src2, $dst|$dst, $src2}",
|
2006-09-08 06:48:29 +00:00
|
|
|
[(set GR64:$dst, (X86cmov GR64:$src1, GR64:$src2,
|
2007-09-29 00:00:36 +00:00
|
|
|
X86_COND_NE, EFLAGS))]>, TB;
|
2006-09-08 06:48:29 +00:00
|
|
|
def CMOVBE64rr: RI<0x46, MRMSrcReg, // if <=u, GR64 = GR64
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
(outs GR64:$dst), (ins GR64:$src1, GR64:$src2),
|
2007-07-31 20:11:57 +00:00
|
|
|
"cmovbe\t{$src2, $dst|$dst, $src2}",
|
2006-09-08 06:48:29 +00:00
|
|
|
[(set GR64:$dst, (X86cmov GR64:$src1, GR64:$src2,
|
2007-09-29 00:00:36 +00:00
|
|
|
X86_COND_BE, EFLAGS))]>, TB;
|
2006-09-08 06:48:29 +00:00
|
|
|
def CMOVA64rr : RI<0x47, MRMSrcReg, // if >u, GR64 = GR64
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
(outs GR64:$dst), (ins GR64:$src1, GR64:$src2),
|
2007-07-31 20:11:57 +00:00
|
|
|
"cmova\t{$src2, $dst|$dst, $src2}",
|
2006-09-08 06:48:29 +00:00
|
|
|
[(set GR64:$dst, (X86cmov GR64:$src1, GR64:$src2,
|
2007-09-29 00:00:36 +00:00
|
|
|
X86_COND_A, EFLAGS))]>, TB;
|
2006-09-08 06:48:29 +00:00
|
|
|
def CMOVL64rr : RI<0x4C, MRMSrcReg, // if <s, GR64 = GR64
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
(outs GR64:$dst), (ins GR64:$src1, GR64:$src2),
|
2007-07-31 20:11:57 +00:00
|
|
|
"cmovl\t{$src2, $dst|$dst, $src2}",
|
2006-09-08 06:48:29 +00:00
|
|
|
[(set GR64:$dst, (X86cmov GR64:$src1, GR64:$src2,
|
2007-09-29 00:00:36 +00:00
|
|
|
X86_COND_L, EFLAGS))]>, TB;
|
2006-09-08 06:48:29 +00:00
|
|
|
def CMOVGE64rr: RI<0x4D, MRMSrcReg, // if >=s, GR64 = GR64
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
(outs GR64:$dst), (ins GR64:$src1, GR64:$src2),
|
2007-07-31 20:11:57 +00:00
|
|
|
"cmovge\t{$src2, $dst|$dst, $src2}",
|
2006-09-08 06:48:29 +00:00
|
|
|
[(set GR64:$dst, (X86cmov GR64:$src1, GR64:$src2,
|
2007-09-29 00:00:36 +00:00
|
|
|
X86_COND_GE, EFLAGS))]>, TB;
|
2006-09-08 06:48:29 +00:00
|
|
|
def CMOVLE64rr: RI<0x4E, MRMSrcReg, // if <=s, GR64 = GR64
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
(outs GR64:$dst), (ins GR64:$src1, GR64:$src2),
|
2007-07-31 20:11:57 +00:00
|
|
|
"cmovle\t{$src2, $dst|$dst, $src2}",
|
2006-09-08 06:48:29 +00:00
|
|
|
[(set GR64:$dst, (X86cmov GR64:$src1, GR64:$src2,
|
2007-09-29 00:00:36 +00:00
|
|
|
X86_COND_LE, EFLAGS))]>, TB;
|
2006-09-08 06:48:29 +00:00
|
|
|
def CMOVG64rr : RI<0x4F, MRMSrcReg, // if >s, GR64 = GR64
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
(outs GR64:$dst), (ins GR64:$src1, GR64:$src2),
|
2007-07-31 20:11:57 +00:00
|
|
|
"cmovg\t{$src2, $dst|$dst, $src2}",
|
2006-09-08 06:48:29 +00:00
|
|
|
[(set GR64:$dst, (X86cmov GR64:$src1, GR64:$src2,
|
2007-09-29 00:00:36 +00:00
|
|
|
X86_COND_G, EFLAGS))]>, TB;
|
2006-09-08 06:48:29 +00:00
|
|
|
def CMOVS64rr : RI<0x48, MRMSrcReg, // if signed, GR64 = GR64
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
(outs GR64:$dst), (ins GR64:$src1, GR64:$src2),
|
2007-07-31 20:11:57 +00:00
|
|
|
"cmovs\t{$src2, $dst|$dst, $src2}",
|
2006-09-08 06:48:29 +00:00
|
|
|
[(set GR64:$dst, (X86cmov GR64:$src1, GR64:$src2,
|
2007-09-29 00:00:36 +00:00
|
|
|
X86_COND_S, EFLAGS))]>, TB;
|
2006-09-08 06:48:29 +00:00
|
|
|
def CMOVNS64rr: RI<0x49, MRMSrcReg, // if !signed, GR64 = GR64
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
(outs GR64:$dst), (ins GR64:$src1, GR64:$src2),
|
2007-07-31 20:11:57 +00:00
|
|
|
"cmovns\t{$src2, $dst|$dst, $src2}",
|
2006-09-08 06:48:29 +00:00
|
|
|
[(set GR64:$dst, (X86cmov GR64:$src1, GR64:$src2,
|
2007-09-29 00:00:36 +00:00
|
|
|
X86_COND_NS, EFLAGS))]>, TB;
|
2006-09-08 06:48:29 +00:00
|
|
|
def CMOVP64rr : RI<0x4A, MRMSrcReg, // if parity, GR64 = GR64
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
(outs GR64:$dst), (ins GR64:$src1, GR64:$src2),
|
2007-07-31 20:11:57 +00:00
|
|
|
"cmovp\t{$src2, $dst|$dst, $src2}",
|
2006-09-08 06:48:29 +00:00
|
|
|
[(set GR64:$dst, (X86cmov GR64:$src1, GR64:$src2,
|
2007-09-29 00:00:36 +00:00
|
|
|
X86_COND_P, EFLAGS))]>, TB;
|
2006-09-08 06:48:29 +00:00
|
|
|
def CMOVNP64rr : RI<0x4B, MRMSrcReg, // if !parity, GR64 = GR64
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
(outs GR64:$dst), (ins GR64:$src1, GR64:$src2),
|
2007-07-31 20:11:57 +00:00
|
|
|
"cmovnp\t{$src2, $dst|$dst, $src2}",
|
2006-09-08 06:48:29 +00:00
|
|
|
[(set GR64:$dst, (X86cmov GR64:$src1, GR64:$src2,
|
2007-09-29 00:00:36 +00:00
|
|
|
X86_COND_NP, EFLAGS))]>, TB;
|
2009-01-07 00:35:10 +00:00
|
|
|
def CMOVO64rr : RI<0x40, MRMSrcReg, // if overflow, GR64 = GR64
|
|
|
|
(outs GR64:$dst), (ins GR64:$src1, GR64:$src2),
|
|
|
|
"cmovo\t{$src2, $dst|$dst, $src2}",
|
|
|
|
[(set GR64:$dst, (X86cmov GR64:$src1, GR64:$src2,
|
|
|
|
X86_COND_O, EFLAGS))]>, TB;
|
|
|
|
def CMOVNO64rr : RI<0x41, MRMSrcReg, // if !overflow, GR64 = GR64
|
|
|
|
(outs GR64:$dst), (ins GR64:$src1, GR64:$src2),
|
|
|
|
"cmovno\t{$src2, $dst|$dst, $src2}",
|
|
|
|
[(set GR64:$dst, (X86cmov GR64:$src1, GR64:$src2,
|
|
|
|
X86_COND_NO, EFLAGS))]>, TB;
|
2007-10-05 23:13:21 +00:00
|
|
|
} // isCommutable = 1
|
|
|
|
|
|
|
|
def CMOVB64rm : RI<0x42, MRMSrcMem, // if <u, GR64 = [mem64]
|
|
|
|
(outs GR64:$dst), (ins GR64:$src1, i64mem:$src2),
|
|
|
|
"cmovb\t{$src2, $dst|$dst, $src2}",
|
|
|
|
[(set GR64:$dst, (X86cmov GR64:$src1, (loadi64 addr:$src2),
|
|
|
|
X86_COND_B, EFLAGS))]>, TB;
|
|
|
|
def CMOVAE64rm: RI<0x43, MRMSrcMem, // if >=u, GR64 = [mem64]
|
|
|
|
(outs GR64:$dst), (ins GR64:$src1, i64mem:$src2),
|
|
|
|
"cmovae\t{$src2, $dst|$dst, $src2}",
|
|
|
|
[(set GR64:$dst, (X86cmov GR64:$src1, (loadi64 addr:$src2),
|
|
|
|
X86_COND_AE, EFLAGS))]>, TB;
|
|
|
|
def CMOVE64rm : RI<0x44, MRMSrcMem, // if ==, GR64 = [mem64]
|
|
|
|
(outs GR64:$dst), (ins GR64:$src1, i64mem:$src2),
|
|
|
|
"cmove\t{$src2, $dst|$dst, $src2}",
|
|
|
|
[(set GR64:$dst, (X86cmov GR64:$src1, (loadi64 addr:$src2),
|
|
|
|
X86_COND_E, EFLAGS))]>, TB;
|
|
|
|
def CMOVNE64rm: RI<0x45, MRMSrcMem, // if !=, GR64 = [mem64]
|
|
|
|
(outs GR64:$dst), (ins GR64:$src1, i64mem:$src2),
|
|
|
|
"cmovne\t{$src2, $dst|$dst, $src2}",
|
|
|
|
[(set GR64:$dst, (X86cmov GR64:$src1, (loadi64 addr:$src2),
|
|
|
|
X86_COND_NE, EFLAGS))]>, TB;
|
|
|
|
def CMOVBE64rm: RI<0x46, MRMSrcMem, // if <=u, GR64 = [mem64]
|
|
|
|
(outs GR64:$dst), (ins GR64:$src1, i64mem:$src2),
|
|
|
|
"cmovbe\t{$src2, $dst|$dst, $src2}",
|
|
|
|
[(set GR64:$dst, (X86cmov GR64:$src1, (loadi64 addr:$src2),
|
|
|
|
X86_COND_BE, EFLAGS))]>, TB;
|
|
|
|
def CMOVA64rm : RI<0x47, MRMSrcMem, // if >u, GR64 = [mem64]
|
|
|
|
(outs GR64:$dst), (ins GR64:$src1, i64mem:$src2),
|
|
|
|
"cmova\t{$src2, $dst|$dst, $src2}",
|
|
|
|
[(set GR64:$dst, (X86cmov GR64:$src1, (loadi64 addr:$src2),
|
|
|
|
X86_COND_A, EFLAGS))]>, TB;
|
|
|
|
def CMOVL64rm : RI<0x4C, MRMSrcMem, // if <s, GR64 = [mem64]
|
|
|
|
(outs GR64:$dst), (ins GR64:$src1, i64mem:$src2),
|
|
|
|
"cmovl\t{$src2, $dst|$dst, $src2}",
|
|
|
|
[(set GR64:$dst, (X86cmov GR64:$src1, (loadi64 addr:$src2),
|
|
|
|
X86_COND_L, EFLAGS))]>, TB;
|
|
|
|
def CMOVGE64rm: RI<0x4D, MRMSrcMem, // if >=s, GR64 = [mem64]
|
|
|
|
(outs GR64:$dst), (ins GR64:$src1, i64mem:$src2),
|
|
|
|
"cmovge\t{$src2, $dst|$dst, $src2}",
|
|
|
|
[(set GR64:$dst, (X86cmov GR64:$src1, (loadi64 addr:$src2),
|
|
|
|
X86_COND_GE, EFLAGS))]>, TB;
|
|
|
|
def CMOVLE64rm: RI<0x4E, MRMSrcMem, // if <=s, GR64 = [mem64]
|
|
|
|
(outs GR64:$dst), (ins GR64:$src1, i64mem:$src2),
|
|
|
|
"cmovle\t{$src2, $dst|$dst, $src2}",
|
|
|
|
[(set GR64:$dst, (X86cmov GR64:$src1, (loadi64 addr:$src2),
|
|
|
|
X86_COND_LE, EFLAGS))]>, TB;
|
|
|
|
def CMOVG64rm : RI<0x4F, MRMSrcMem, // if >s, GR64 = [mem64]
|
|
|
|
(outs GR64:$dst), (ins GR64:$src1, i64mem:$src2),
|
|
|
|
"cmovg\t{$src2, $dst|$dst, $src2}",
|
|
|
|
[(set GR64:$dst, (X86cmov GR64:$src1, (loadi64 addr:$src2),
|
|
|
|
X86_COND_G, EFLAGS))]>, TB;
|
|
|
|
def CMOVS64rm : RI<0x48, MRMSrcMem, // if signed, GR64 = [mem64]
|
|
|
|
(outs GR64:$dst), (ins GR64:$src1, i64mem:$src2),
|
|
|
|
"cmovs\t{$src2, $dst|$dst, $src2}",
|
|
|
|
[(set GR64:$dst, (X86cmov GR64:$src1, (loadi64 addr:$src2),
|
|
|
|
X86_COND_S, EFLAGS))]>, TB;
|
|
|
|
def CMOVNS64rm: RI<0x49, MRMSrcMem, // if !signed, GR64 = [mem64]
|
|
|
|
(outs GR64:$dst), (ins GR64:$src1, i64mem:$src2),
|
|
|
|
"cmovns\t{$src2, $dst|$dst, $src2}",
|
|
|
|
[(set GR64:$dst, (X86cmov GR64:$src1, (loadi64 addr:$src2),
|
|
|
|
X86_COND_NS, EFLAGS))]>, TB;
|
|
|
|
def CMOVP64rm : RI<0x4A, MRMSrcMem, // if parity, GR64 = [mem64]
|
|
|
|
(outs GR64:$dst), (ins GR64:$src1, i64mem:$src2),
|
|
|
|
"cmovp\t{$src2, $dst|$dst, $src2}",
|
|
|
|
[(set GR64:$dst, (X86cmov GR64:$src1, (loadi64 addr:$src2),
|
|
|
|
X86_COND_P, EFLAGS))]>, TB;
|
2006-09-08 06:48:29 +00:00
|
|
|
def CMOVNP64rm : RI<0x4B, MRMSrcMem, // if !parity, GR64 = [mem64]
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
(outs GR64:$dst), (ins GR64:$src1, i64mem:$src2),
|
2007-07-31 20:11:57 +00:00
|
|
|
"cmovnp\t{$src2, $dst|$dst, $src2}",
|
2006-09-08 06:48:29 +00:00
|
|
|
[(set GR64:$dst, (X86cmov GR64:$src1, (loadi64 addr:$src2),
|
2007-09-25 01:57:46 +00:00
|
|
|
X86_COND_NP, EFLAGS))]>, TB;
|
2009-01-07 00:35:10 +00:00
|
|
|
def CMOVO64rm : RI<0x40, MRMSrcMem, // if overflow, GR64 = [mem64]
|
|
|
|
(outs GR64:$dst), (ins GR64:$src1, i64mem:$src2),
|
|
|
|
"cmovo\t{$src2, $dst|$dst, $src2}",
|
|
|
|
[(set GR64:$dst, (X86cmov GR64:$src1, (loadi64 addr:$src2),
|
|
|
|
X86_COND_O, EFLAGS))]>, TB;
|
|
|
|
def CMOVNO64rm : RI<0x41, MRMSrcMem, // if !overflow, GR64 = [mem64]
|
|
|
|
(outs GR64:$dst), (ins GR64:$src1, i64mem:$src2),
|
|
|
|
"cmovno\t{$src2, $dst|$dst, $src2}",
|
|
|
|
[(set GR64:$dst, (X86cmov GR64:$src1, (loadi64 addr:$src2),
|
|
|
|
X86_COND_NO, EFLAGS))]>, TB;
|
2006-09-08 06:48:29 +00:00
|
|
|
} // isTwoAddress
|
|
|
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// Conversion Instructions...
|
|
|
|
//
|
|
|
|
|
|
|
|
// f64 -> signed i64
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
def Int_CVTSD2SI64rr: RSDI<0x2D, MRMSrcReg, (outs GR64:$dst), (ins VR128:$src),
|
2007-07-31 20:11:57 +00:00
|
|
|
"cvtsd2si{q}\t{$src, $dst|$dst, $src}",
|
2007-07-23 03:07:27 +00:00
|
|
|
[(set GR64:$dst,
|
|
|
|
(int_x86_sse2_cvtsd2si64 VR128:$src))]>;
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
def Int_CVTSD2SI64rm: RSDI<0x2D, MRMSrcMem, (outs GR64:$dst), (ins f128mem:$src),
|
2007-07-31 20:11:57 +00:00
|
|
|
"cvtsd2si{q}\t{$src, $dst|$dst, $src}",
|
2007-07-23 03:07:27 +00:00
|
|
|
[(set GR64:$dst, (int_x86_sse2_cvtsd2si64
|
|
|
|
(load addr:$src)))]>;
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
def CVTTSD2SI64rr: RSDI<0x2C, MRMSrcReg, (outs GR64:$dst), (ins FR64:$src),
|
2007-07-31 20:11:57 +00:00
|
|
|
"cvttsd2si{q}\t{$src, $dst|$dst, $src}",
|
2006-09-08 06:48:29 +00:00
|
|
|
[(set GR64:$dst, (fp_to_sint FR64:$src))]>;
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
def CVTTSD2SI64rm: RSDI<0x2C, MRMSrcMem, (outs GR64:$dst), (ins f64mem:$src),
|
2007-07-31 20:11:57 +00:00
|
|
|
"cvttsd2si{q}\t{$src, $dst|$dst, $src}",
|
2006-09-08 06:48:29 +00:00
|
|
|
[(set GR64:$dst, (fp_to_sint (loadf64 addr:$src)))]>;
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
def Int_CVTTSD2SI64rr: RSDI<0x2C, MRMSrcReg, (outs GR64:$dst), (ins VR128:$src),
|
2007-07-31 20:11:57 +00:00
|
|
|
"cvttsd2si{q}\t{$src, $dst|$dst, $src}",
|
2007-07-23 03:07:27 +00:00
|
|
|
[(set GR64:$dst,
|
|
|
|
(int_x86_sse2_cvttsd2si64 VR128:$src))]>;
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
def Int_CVTTSD2SI64rm: RSDI<0x2C, MRMSrcMem, (outs GR64:$dst), (ins f128mem:$src),
|
2007-07-31 20:11:57 +00:00
|
|
|
"cvttsd2si{q}\t{$src, $dst|$dst, $src}",
|
2007-07-23 03:07:27 +00:00
|
|
|
[(set GR64:$dst,
|
|
|
|
(int_x86_sse2_cvttsd2si64
|
|
|
|
(load addr:$src)))]>;
|
2006-09-08 06:48:29 +00:00
|
|
|
|
|
|
|
// Signed i64 -> f64
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
def CVTSI2SD64rr: RSDI<0x2A, MRMSrcReg, (outs FR64:$dst), (ins GR64:$src),
|
2007-07-31 20:11:57 +00:00
|
|
|
"cvtsi2sd{q}\t{$src, $dst|$dst, $src}",
|
2006-09-08 06:48:29 +00:00
|
|
|
[(set FR64:$dst, (sint_to_fp GR64:$src))]>;
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
def CVTSI2SD64rm: RSDI<0x2A, MRMSrcMem, (outs FR64:$dst), (ins i64mem:$src),
|
2007-07-31 20:11:57 +00:00
|
|
|
"cvtsi2sd{q}\t{$src, $dst|$dst, $src}",
|
2006-09-08 06:48:29 +00:00
|
|
|
[(set FR64:$dst, (sint_to_fp (loadi64 addr:$src)))]>;
|
2008-01-11 07:37:44 +00:00
|
|
|
|
2006-09-08 06:48:29 +00:00
|
|
|
let isTwoAddress = 1 in {
|
|
|
|
def Int_CVTSI2SD64rr: RSDI<0x2A, MRMSrcReg,
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
(outs VR128:$dst), (ins VR128:$src1, GR64:$src2),
|
2007-07-31 20:11:57 +00:00
|
|
|
"cvtsi2sd{q}\t{$src2, $dst|$dst, $src2}",
|
2007-07-23 03:07:27 +00:00
|
|
|
[(set VR128:$dst,
|
|
|
|
(int_x86_sse2_cvtsi642sd VR128:$src1,
|
|
|
|
GR64:$src2))]>;
|
2006-09-08 06:48:29 +00:00
|
|
|
def Int_CVTSI2SD64rm: RSDI<0x2A, MRMSrcMem,
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
(outs VR128:$dst), (ins VR128:$src1, i64mem:$src2),
|
2007-07-31 20:11:57 +00:00
|
|
|
"cvtsi2sd{q}\t{$src2, $dst|$dst, $src2}",
|
2007-07-23 03:07:27 +00:00
|
|
|
[(set VR128:$dst,
|
|
|
|
(int_x86_sse2_cvtsi642sd VR128:$src1,
|
|
|
|
(loadi64 addr:$src2)))]>;
|
2006-09-08 06:48:29 +00:00
|
|
|
} // isTwoAddress
|
|
|
|
|
|
|
|
// Signed i64 -> f32
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
def CVTSI2SS64rr: RSSI<0x2A, MRMSrcReg, (outs FR32:$dst), (ins GR64:$src),
|
2007-07-31 20:11:57 +00:00
|
|
|
"cvtsi2ss{q}\t{$src, $dst|$dst, $src}",
|
2006-09-08 06:48:29 +00:00
|
|
|
[(set FR32:$dst, (sint_to_fp GR64:$src))]>;
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
def CVTSI2SS64rm: RSSI<0x2A, MRMSrcMem, (outs FR32:$dst), (ins i64mem:$src),
|
2007-07-31 20:11:57 +00:00
|
|
|
"cvtsi2ss{q}\t{$src, $dst|$dst, $src}",
|
2006-09-08 06:48:29 +00:00
|
|
|
[(set FR32:$dst, (sint_to_fp (loadi64 addr:$src)))]>;
|
2008-01-11 07:37:44 +00:00
|
|
|
|
|
|
|
let isTwoAddress = 1 in {
|
|
|
|
def Int_CVTSI2SS64rr : RSSI<0x2A, MRMSrcReg,
|
|
|
|
(outs VR128:$dst), (ins VR128:$src1, GR64:$src2),
|
|
|
|
"cvtsi2ss{q}\t{$src2, $dst|$dst, $src2}",
|
|
|
|
[(set VR128:$dst,
|
|
|
|
(int_x86_sse_cvtsi642ss VR128:$src1,
|
|
|
|
GR64:$src2))]>;
|
|
|
|
def Int_CVTSI2SS64rm : RSSI<0x2A, MRMSrcMem,
|
|
|
|
(outs VR128:$dst), (ins VR128:$src1, i64mem:$src2),
|
|
|
|
"cvtsi2ss{q}\t{$src2, $dst|$dst, $src2}",
|
|
|
|
[(set VR128:$dst,
|
|
|
|
(int_x86_sse_cvtsi642ss VR128:$src1,
|
|
|
|
(loadi64 addr:$src2)))]>;
|
|
|
|
}
|
2006-09-08 06:48:29 +00:00
|
|
|
|
|
|
|
// f32 -> signed i64
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
def Int_CVTSS2SI64rr: RSSI<0x2D, MRMSrcReg, (outs GR64:$dst), (ins VR128:$src),
|
2007-07-31 20:11:57 +00:00
|
|
|
"cvtss2si{q}\t{$src, $dst|$dst, $src}",
|
2007-07-23 03:07:27 +00:00
|
|
|
[(set GR64:$dst,
|
|
|
|
(int_x86_sse_cvtss2si64 VR128:$src))]>;
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
def Int_CVTSS2SI64rm: RSSI<0x2D, MRMSrcMem, (outs GR64:$dst), (ins f32mem:$src),
|
2007-07-31 20:11:57 +00:00
|
|
|
"cvtss2si{q}\t{$src, $dst|$dst, $src}",
|
2007-07-23 03:07:27 +00:00
|
|
|
[(set GR64:$dst, (int_x86_sse_cvtss2si64
|
|
|
|
(load addr:$src)))]>;
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
def CVTTSS2SI64rr: RSSI<0x2C, MRMSrcReg, (outs GR64:$dst), (ins FR32:$src),
|
2007-07-31 20:11:57 +00:00
|
|
|
"cvttss2si{q}\t{$src, $dst|$dst, $src}",
|
2006-09-08 06:48:29 +00:00
|
|
|
[(set GR64:$dst, (fp_to_sint FR32:$src))]>;
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
def CVTTSS2SI64rm: RSSI<0x2C, MRMSrcMem, (outs GR64:$dst), (ins f32mem:$src),
|
2007-07-31 20:11:57 +00:00
|
|
|
"cvttss2si{q}\t{$src, $dst|$dst, $src}",
|
2006-09-08 06:48:29 +00:00
|
|
|
[(set GR64:$dst, (fp_to_sint (loadf32 addr:$src)))]>;
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
def Int_CVTTSS2SI64rr: RSSI<0x2C, MRMSrcReg, (outs GR64:$dst), (ins VR128:$src),
|
2007-07-31 20:11:57 +00:00
|
|
|
"cvttss2si{q}\t{$src, $dst|$dst, $src}",
|
2007-07-23 03:07:27 +00:00
|
|
|
[(set GR64:$dst,
|
|
|
|
(int_x86_sse_cvttss2si64 VR128:$src))]>;
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
def Int_CVTTSS2SI64rm: RSSI<0x2C, MRMSrcMem, (outs GR64:$dst), (ins f32mem:$src),
|
2007-07-31 20:11:57 +00:00
|
|
|
"cvttss2si{q}\t{$src, $dst|$dst, $src}",
|
2007-07-23 03:07:27 +00:00
|
|
|
[(set GR64:$dst,
|
|
|
|
(int_x86_sse_cvttss2si64 (load addr:$src)))]>;
|
|
|
|
|
2006-09-08 06:48:29 +00:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// Alias Instructions
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2007-09-17 14:55:08 +00:00
|
|
|
// Alias instructions that map movr0 to xor. Use xorl instead of xorq; it's
|
|
|
|
// equivalent due to implicit zero-extending, and it sometimes has a smaller
|
|
|
|
// encoding.
|
2009-07-14 20:19:57 +00:00
|
|
|
// FIXME: AddedComplexity gives this a higher priority than MOV64ri32. Remove
|
2006-09-08 06:48:29 +00:00
|
|
|
// when we have a better way to specify isel priority.
|
2009-07-14 20:19:57 +00:00
|
|
|
let AddedComplexity = 1 in
|
|
|
|
def : Pat<(i64 0),
|
2009-07-16 06:31:37 +00:00
|
|
|
(SUBREG_TO_REG (i64 0), (MOV32r0), x86_subreg_32bit)>;
|
2009-07-14 20:19:57 +00:00
|
|
|
|
2006-09-08 06:48:29 +00:00
|
|
|
|
|
|
|
// Materialize i64 constant where top 32-bits are zero.
|
2009-02-05 08:42:55 +00:00
|
|
|
let AddedComplexity = 1, isReMaterializable = 1, isAsCheapAsAMove = 1 in
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
def MOV64ri64i32 : Ii32<0xB8, AddRegFrm, (outs GR64:$dst), (ins i64i32imm:$src),
|
2007-07-31 20:11:57 +00:00
|
|
|
"mov{l}\t{$src, ${dst:subreg32}|${dst:subreg32}, $src}",
|
2006-09-08 06:48:29 +00:00
|
|
|
[(set GR64:$dst, i64immZExt32:$src)]>;
|
|
|
|
|
2008-05-04 21:36:32 +00:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// Thread Local Storage Instructions
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2009-04-24 12:59:40 +00:00
|
|
|
// All calls clobber the non-callee saved registers. RSP is marked as
|
|
|
|
// a use to prevent stack-pointer assignments that appear immediately
|
|
|
|
// before calls from potentially appearing dead.
|
|
|
|
let Defs = [RAX, RCX, RDX, RSI, RDI, R8, R9, R10, R11,
|
|
|
|
FP0, FP1, FP2, FP3, FP4, FP5, FP6, ST0, ST1,
|
|
|
|
MM0, MM1, MM2, MM3, MM4, MM5, MM6, MM7,
|
|
|
|
XMM0, XMM1, XMM2, XMM3, XMM4, XMM5, XMM6, XMM7,
|
|
|
|
XMM8, XMM9, XMM10, XMM11, XMM12, XMM13, XMM14, XMM15, EFLAGS],
|
|
|
|
Uses = [RSP] in
|
2009-06-20 20:38:48 +00:00
|
|
|
def TLS_addr64 : I<0, Pseudo, (outs), (ins lea64mem:$sym),
|
2009-04-27 15:13:28 +00:00
|
|
|
".byte\t0x66; "
|
2009-06-20 20:38:48 +00:00
|
|
|
"leaq\t$sym(%rip), %rdi; "
|
2009-04-27 15:13:28 +00:00
|
|
|
".word\t0x6666; "
|
|
|
|
"rex64; "
|
|
|
|
"call\t__tls_get_addr@PLT",
|
2009-06-20 20:38:48 +00:00
|
|
|
[(X86tlsaddr tls64addr:$sym)]>,
|
2009-04-17 14:35:58 +00:00
|
|
|
Requires<[In64BitMode]>;
|
2008-03-04 21:13:33 +00:00
|
|
|
|
2009-08-11 22:24:40 +00:00
|
|
|
let AddedComplexity = 5, isCodeGenOnly = 1 in
|
2009-01-26 01:24:32 +00:00
|
|
|
def MOV64GSrm : RI<0x8B, MRMSrcMem, (outs GR64:$dst), (ins i64mem:$src),
|
|
|
|
"movq\t%gs:$src, $dst",
|
|
|
|
[(set GR64:$dst, (gsload addr:$src))]>, SegGS;
|
|
|
|
|
2009-08-11 22:24:40 +00:00
|
|
|
let AddedComplexity = 5, isCodeGenOnly = 1 in
|
2009-05-05 18:52:19 +00:00
|
|
|
def MOV64FSrm : RI<0x8B, MRMSrcMem, (outs GR64:$dst), (ins i64mem:$src),
|
|
|
|
"movq\t%fs:$src, $dst",
|
|
|
|
[(set GR64:$dst, (fsload addr:$src))]>, SegFS;
|
|
|
|
|
2008-03-04 21:13:33 +00:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// Atomic Instructions
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
let Defs = [RAX, EFLAGS], Uses = [RAX] in {
|
2008-04-18 20:55:36 +00:00
|
|
|
def LCMPXCHG64 : RI<0xB1, MRMDestMem, (outs), (ins i64mem:$ptr, GR64:$swap),
|
2009-04-27 15:13:28 +00:00
|
|
|
"lock\n\t"
|
|
|
|
"cmpxchgq\t$swap,$ptr",
|
2008-03-04 21:13:33 +00:00
|
|
|
[(X86cas addr:$ptr, GR64:$swap, 8)]>, TB, LOCK;
|
|
|
|
}
|
|
|
|
|
2008-08-06 15:52:50 +00:00
|
|
|
let Constraints = "$val = $dst" in {
|
|
|
|
let Defs = [EFLAGS] in
|
2008-04-18 20:55:36 +00:00
|
|
|
def LXADD64 : RI<0xC1, MRMSrcMem, (outs GR64:$dst), (ins i64mem:$ptr,GR64:$val),
|
2009-04-27 15:13:28 +00:00
|
|
|
"lock\n\t"
|
|
|
|
"xadd\t$val, $ptr",
|
2008-06-25 08:15:39 +00:00
|
|
|
[(set GR64:$dst, (atomic_load_add_64 addr:$ptr, GR64:$val))]>,
|
2008-03-04 21:13:33 +00:00
|
|
|
TB, LOCK;
|
2009-07-30 08:33:02 +00:00
|
|
|
|
2008-04-19 02:05:42 +00:00
|
|
|
def XCHG64rm : RI<0x87, MRMSrcMem, (outs GR64:$dst), (ins i64mem:$ptr,GR64:$val),
|
2008-08-19 23:09:18 +00:00
|
|
|
"xchg\t$val, $ptr",
|
2008-04-19 02:05:42 +00:00
|
|
|
[(set GR64:$dst, (atomic_swap_64 addr:$ptr, GR64:$val))]>;
|
2008-03-04 21:13:33 +00:00
|
|
|
}
|
|
|
|
|
2009-07-30 08:33:02 +00:00
|
|
|
// Optimized codegen when the non-memory output is not used.
|
|
|
|
// FIXME: Use normal add / sub instructions and add lock prefix dynamically.
|
|
|
|
def LOCK_ADD64mr : RI<0x03, MRMDestMem, (outs), (ins i64mem:$dst, GR64:$src2),
|
|
|
|
"lock\n\t"
|
|
|
|
"add{q}\t{$src2, $dst|$dst, $src2}", []>, LOCK;
|
|
|
|
def LOCK_ADD64mi8 : RIi8<0x83, MRM0m, (outs),
|
|
|
|
(ins i64mem:$dst, i64i8imm :$src2),
|
|
|
|
"lock\n\t"
|
|
|
|
"add{q}\t{$src2, $dst|$dst, $src2}", []>, LOCK;
|
|
|
|
def LOCK_ADD64mi32 : RIi32<0x81, MRM0m, (outs),
|
|
|
|
(ins i64mem:$dst, i64i32imm :$src2),
|
|
|
|
"lock\n\t"
|
|
|
|
"add{q}\t{$src2, $dst|$dst, $src2}", []>, LOCK;
|
|
|
|
def LOCK_SUB64mr : RI<0x29, MRMDestMem, (outs), (ins i64mem:$dst, GR64:$src2),
|
|
|
|
"lock\n\t"
|
|
|
|
"sub{q}\t{$src2, $dst|$dst, $src2}", []>, LOCK;
|
|
|
|
def LOCK_SUB64mi8 : RIi8<0x83, MRM5m, (outs),
|
|
|
|
(ins i64mem:$dst, i64i8imm :$src2),
|
|
|
|
"lock\n\t"
|
|
|
|
"sub{q}\t{$src2, $dst|$dst, $src2}", []>, LOCK;
|
|
|
|
def LOCK_SUB64mi32 : RIi32<0x81, MRM5m, (outs),
|
|
|
|
(ins i64mem:$dst, i64i32imm:$src2),
|
|
|
|
"lock\n\t"
|
|
|
|
"sub{q}\t{$src2, $dst|$dst, $src2}", []>, LOCK;
|
|
|
|
def LOCK_INC64m : RI<0xFF, MRM0m, (outs), (ins i64mem:$dst),
|
|
|
|
"lock\n\t"
|
|
|
|
"inc{q}\t$dst", []>, LOCK;
|
|
|
|
def LOCK_DEC64m : RI<0xFF, MRM1m, (outs), (ins i64mem:$dst),
|
|
|
|
"lock\n\t"
|
|
|
|
"dec{q}\t$dst", []>, LOCK;
|
|
|
|
|
2008-08-20 00:48:50 +00:00
|
|
|
// Atomic exchange, and, or, xor
|
|
|
|
let Constraints = "$val = $dst", Defs = [EFLAGS],
|
|
|
|
usesCustomDAGSchedInserter = 1 in {
|
|
|
|
def ATOMAND64 : I<0, Pseudo, (outs GR64:$dst),(ins i64mem:$ptr, GR64:$val),
|
2008-12-07 03:49:52 +00:00
|
|
|
"#ATOMAND64 PSEUDO!",
|
2008-08-28 02:44:49 +00:00
|
|
|
[(set GR64:$dst, (atomic_load_and_64 addr:$ptr, GR64:$val))]>;
|
2008-08-20 00:48:50 +00:00
|
|
|
def ATOMOR64 : I<0, Pseudo, (outs GR64:$dst),(ins i64mem:$ptr, GR64:$val),
|
2008-12-07 03:49:52 +00:00
|
|
|
"#ATOMOR64 PSEUDO!",
|
2008-08-28 02:44:49 +00:00
|
|
|
[(set GR64:$dst, (atomic_load_or_64 addr:$ptr, GR64:$val))]>;
|
2008-08-20 00:48:50 +00:00
|
|
|
def ATOMXOR64 : I<0, Pseudo,(outs GR64:$dst),(ins i64mem:$ptr, GR64:$val),
|
2008-12-07 03:49:52 +00:00
|
|
|
"#ATOMXOR64 PSEUDO!",
|
2008-08-28 02:44:49 +00:00
|
|
|
[(set GR64:$dst, (atomic_load_xor_64 addr:$ptr, GR64:$val))]>;
|
2008-08-20 00:48:50 +00:00
|
|
|
def ATOMNAND64 : I<0, Pseudo,(outs GR64:$dst),(ins i64mem:$ptr, GR64:$val),
|
2008-12-07 03:49:52 +00:00
|
|
|
"#ATOMNAND64 PSEUDO!",
|
2008-08-28 02:44:49 +00:00
|
|
|
[(set GR64:$dst, (atomic_load_nand_64 addr:$ptr, GR64:$val))]>;
|
2008-08-20 00:48:50 +00:00
|
|
|
def ATOMMIN64: I<0, Pseudo, (outs GR64:$dst), (ins i64mem:$ptr, GR64:$val),
|
2008-12-07 03:49:52 +00:00
|
|
|
"#ATOMMIN64 PSEUDO!",
|
2008-08-28 02:44:49 +00:00
|
|
|
[(set GR64:$dst, (atomic_load_min_64 addr:$ptr, GR64:$val))]>;
|
2008-08-20 00:48:50 +00:00
|
|
|
def ATOMMAX64: I<0, Pseudo, (outs GR64:$dst),(ins i64mem:$ptr, GR64:$val),
|
2008-12-07 03:49:52 +00:00
|
|
|
"#ATOMMAX64 PSEUDO!",
|
2008-08-28 02:44:49 +00:00
|
|
|
[(set GR64:$dst, (atomic_load_max_64 addr:$ptr, GR64:$val))]>;
|
2008-08-20 00:48:50 +00:00
|
|
|
def ATOMUMIN64: I<0, Pseudo, (outs GR64:$dst),(ins i64mem:$ptr, GR64:$val),
|
2008-12-07 03:49:52 +00:00
|
|
|
"#ATOMUMIN64 PSEUDO!",
|
2008-08-28 02:44:49 +00:00
|
|
|
[(set GR64:$dst, (atomic_load_umin_64 addr:$ptr, GR64:$val))]>;
|
2008-08-20 00:48:50 +00:00
|
|
|
def ATOMUMAX64: I<0, Pseudo, (outs GR64:$dst),(ins i64mem:$ptr, GR64:$val),
|
2008-12-07 03:49:52 +00:00
|
|
|
"#ATOMUMAX64 PSEUDO!",
|
2008-08-28 02:44:49 +00:00
|
|
|
[(set GR64:$dst, (atomic_load_umax_64 addr:$ptr, GR64:$val))]>;
|
2008-08-20 00:48:50 +00:00
|
|
|
}
|
2008-03-04 21:13:33 +00:00
|
|
|
|
2009-09-16 21:55:34 +00:00
|
|
|
// Segmentation support instructions
|
|
|
|
|
|
|
|
// i16mem operand in LAR64rm and GR32 operand in LAR32rr is not a typo.
|
|
|
|
def LAR64rm : RI<0x02, MRMSrcMem, (outs GR64:$dst), (ins i16mem:$src),
|
|
|
|
"lar{q}\t{$src, $dst|$dst, $src}", []>, TB;
|
|
|
|
def LAR64rr : RI<0x02, MRMSrcReg, (outs GR64:$dst), (ins GR32:$src),
|
|
|
|
"lar{q}\t{$src, $dst|$dst, $src}", []>, TB;
|
2009-09-16 22:59:28 +00:00
|
|
|
|
|
|
|
// String manipulation instructions
|
|
|
|
|
|
|
|
def LODSQ : RI<0xAD, RawFrm, (outs), (ins), "lodsq", []>;
|
2009-09-16 21:55:34 +00:00
|
|
|
|
2006-09-08 06:48:29 +00:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// Non-Instruction Patterns
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2009-07-11 22:50:33 +00:00
|
|
|
// ConstantPool GlobalAddress, ExternalSymbol, and JumpTable when not in small
|
|
|
|
// code model mode, should use 'movabs'. FIXME: This is really a hack, the
|
|
|
|
// 'movabs' predicate should handle this sort of thing.
|
2006-11-30 21:55:46 +00:00
|
|
|
def : Pat<(i64 (X86Wrapper tconstpool :$dst)),
|
2009-08-06 11:23:24 +00:00
|
|
|
(MOV64ri tconstpool :$dst)>, Requires<[FarData]>;
|
2006-11-30 21:55:46 +00:00
|
|
|
def : Pat<(i64 (X86Wrapper tjumptable :$dst)),
|
2009-08-06 11:23:24 +00:00
|
|
|
(MOV64ri tjumptable :$dst)>, Requires<[FarData]>;
|
2006-11-30 21:55:46 +00:00
|
|
|
def : Pat<(i64 (X86Wrapper tglobaladdr :$dst)),
|
2009-08-06 11:23:24 +00:00
|
|
|
(MOV64ri tglobaladdr :$dst)>, Requires<[FarData]>;
|
2006-11-30 21:55:46 +00:00
|
|
|
def : Pat<(i64 (X86Wrapper texternalsym:$dst)),
|
2009-08-06 11:23:24 +00:00
|
|
|
(MOV64ri texternalsym:$dst)>, Requires<[FarData]>;
|
2006-11-30 21:55:46 +00:00
|
|
|
|
2009-07-11 23:17:29 +00:00
|
|
|
// In static codegen with small code model, we can get the address of a label
|
|
|
|
// into a register with 'movl'. FIXME: This is a hack, the 'imm' predicate of
|
|
|
|
// the MOV64ri64i32 should accept these.
|
|
|
|
def : Pat<(i64 (X86Wrapper tconstpool :$dst)),
|
|
|
|
(MOV64ri64i32 tconstpool :$dst)>, Requires<[SmallCode]>;
|
|
|
|
def : Pat<(i64 (X86Wrapper tjumptable :$dst)),
|
|
|
|
(MOV64ri64i32 tjumptable :$dst)>, Requires<[SmallCode]>;
|
|
|
|
def : Pat<(i64 (X86Wrapper tglobaladdr :$dst)),
|
|
|
|
(MOV64ri64i32 tglobaladdr :$dst)>, Requires<[SmallCode]>;
|
|
|
|
def : Pat<(i64 (X86Wrapper texternalsym:$dst)),
|
|
|
|
(MOV64ri64i32 texternalsym:$dst)>, Requires<[SmallCode]>;
|
|
|
|
|
2009-08-06 11:23:24 +00:00
|
|
|
// In kernel code model, we can get the address of a label
|
|
|
|
// into a register with 'movq'. FIXME: This is a hack, the 'imm' predicate of
|
|
|
|
// the MOV64ri32 should accept these.
|
|
|
|
def : Pat<(i64 (X86Wrapper tconstpool :$dst)),
|
|
|
|
(MOV64ri32 tconstpool :$dst)>, Requires<[KernelCode]>;
|
|
|
|
def : Pat<(i64 (X86Wrapper tjumptable :$dst)),
|
|
|
|
(MOV64ri32 tjumptable :$dst)>, Requires<[KernelCode]>;
|
|
|
|
def : Pat<(i64 (X86Wrapper tglobaladdr :$dst)),
|
|
|
|
(MOV64ri32 tglobaladdr :$dst)>, Requires<[KernelCode]>;
|
|
|
|
def : Pat<(i64 (X86Wrapper texternalsym:$dst)),
|
|
|
|
(MOV64ri32 texternalsym:$dst)>, Requires<[KernelCode]>;
|
2009-07-11 23:17:29 +00:00
|
|
|
|
Reimplement rip-relative addressing in the X86-64 backend. The new
implementation primarily differs from the former in that the asmprinter
doesn't make a zillion decisions about whether or not something will be
RIP relative or not. Instead, those decisions are made by isel lowering
and propagated through to the asm printer. To achieve this, we:
1. Represent RIP relative addresses by setting the base of the X86 addr
mode to X86::RIP.
2. When ISel Lowering decides that it is safe to use RIP, it lowers to
X86ISD::WrapperRIP. When it is unsafe to use RIP, it lowers to
X86ISD::Wrapper as before.
3. This removes isRIPRel from X86ISelAddressMode, representing it with
a basereg of RIP instead.
4. The addressing mode matching logic in isel is greatly simplified.
5. The asmprinter is greatly simplified, notably the "NotRIPRel" predicate
passed through various printoperand routines is gone now.
6. The various symbol printing routines in asmprinter now no longer infer
when to emit (%rip), they just print the symbol.
I think this is a big improvement over the previous situation. It does have
two small caveats though: 1. I implemented a horrible "no-rip" modifier for
the inline asm "P" constraint modifier. This is a short term hack, there is
a much better, but more involved, solution. 2. I had to xfail an
-aggressive-remat testcase because it isn't handling the use of RIP in the
constant-pool reading instruction. This specific test is easy to fix without
-aggressive-remat, which I intend to do next.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74372 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-27 04:16:01 +00:00
|
|
|
// If we have small model and -static mode, it is safe to store global addresses
|
|
|
|
// directly as immediates. FIXME: This is really a hack, the 'imm' predicate
|
2009-07-11 22:50:33 +00:00
|
|
|
// for MOV64mi32 should handle this sort of thing.
|
2006-12-05 19:50:18 +00:00
|
|
|
def : Pat<(store (i64 (X86Wrapper tconstpool:$src)), addr:$dst),
|
|
|
|
(MOV64mi32 addr:$dst, tconstpool:$src)>,
|
2009-08-06 11:23:24 +00:00
|
|
|
Requires<[NearData, IsStatic]>;
|
2006-12-05 19:50:18 +00:00
|
|
|
def : Pat<(store (i64 (X86Wrapper tjumptable:$src)), addr:$dst),
|
|
|
|
(MOV64mi32 addr:$dst, tjumptable:$src)>,
|
2009-08-06 11:23:24 +00:00
|
|
|
Requires<[NearData, IsStatic]>;
|
2006-11-30 21:55:46 +00:00
|
|
|
def : Pat<(store (i64 (X86Wrapper tglobaladdr:$src)), addr:$dst),
|
2006-12-05 19:50:18 +00:00
|
|
|
(MOV64mi32 addr:$dst, tglobaladdr:$src)>,
|
2009-08-06 11:23:24 +00:00
|
|
|
Requires<[NearData, IsStatic]>;
|
2006-11-30 21:55:46 +00:00
|
|
|
def : Pat<(store (i64 (X86Wrapper texternalsym:$src)), addr:$dst),
|
2006-12-05 19:50:18 +00:00
|
|
|
(MOV64mi32 addr:$dst, texternalsym:$src)>,
|
2009-08-06 11:23:24 +00:00
|
|
|
Requires<[NearData, IsStatic]>;
|
2006-11-30 21:55:46 +00:00
|
|
|
|
2006-09-08 06:48:29 +00:00
|
|
|
// Calls
|
|
|
|
// Direct PC relative function call for small code model. 32-bit displacement
|
|
|
|
// sign extended to 64-bit.
|
|
|
|
def : Pat<(X86call (i64 tglobaladdr:$dst)),
|
2009-08-03 08:12:53 +00:00
|
|
|
(CALL64pcrel32 tglobaladdr:$dst)>, Requires<[NotWin64]>;
|
2006-09-08 06:48:29 +00:00
|
|
|
def : Pat<(X86call (i64 texternalsym:$dst)),
|
2009-08-03 08:12:53 +00:00
|
|
|
(CALL64pcrel32 texternalsym:$dst)>, Requires<[NotWin64]>;
|
|
|
|
|
|
|
|
def : Pat<(X86call (i64 tglobaladdr:$dst)),
|
|
|
|
(WINCALL64pcrel32 tglobaladdr:$dst)>, Requires<[IsWin64]>;
|
|
|
|
def : Pat<(X86call (i64 texternalsym:$dst)),
|
|
|
|
(WINCALL64pcrel32 texternalsym:$dst)>, Requires<[IsWin64]>;
|
2006-09-08 06:48:29 +00:00
|
|
|
|
2007-10-11 19:40:01 +00:00
|
|
|
// tailcall stuff
|
|
|
|
def : Pat<(X86tcret GR64:$dst, imm:$off),
|
|
|
|
(TCRETURNri64 GR64:$dst, imm:$off)>;
|
|
|
|
|
|
|
|
def : Pat<(X86tcret (i64 tglobaladdr:$dst), imm:$off),
|
|
|
|
(TCRETURNdi64 texternalsym:$dst, imm:$off)>;
|
|
|
|
|
|
|
|
def : Pat<(X86tcret (i64 texternalsym:$dst), imm:$off),
|
|
|
|
(TCRETURNdi64 texternalsym:$dst, imm:$off)>;
|
|
|
|
|
2007-09-17 14:35:24 +00:00
|
|
|
// Comparisons.
|
|
|
|
|
|
|
|
// TEST R,R is smaller than CMP R,0
|
2007-09-29 00:00:36 +00:00
|
|
|
def : Pat<(parallel (X86cmp GR64:$src1, 0), (implicit EFLAGS)),
|
2007-09-17 14:35:24 +00:00
|
|
|
(TEST64rr GR64:$src1, GR64:$src1)>;
|
|
|
|
|
2009-01-07 01:00:24 +00:00
|
|
|
// Conditional moves with folded loads with operands swapped and conditions
|
|
|
|
// inverted.
|
|
|
|
def : Pat<(X86cmov (loadi64 addr:$src1), GR64:$src2, X86_COND_B, EFLAGS),
|
|
|
|
(CMOVAE64rm GR64:$src2, addr:$src1)>;
|
|
|
|
def : Pat<(X86cmov (loadi64 addr:$src1), GR64:$src2, X86_COND_AE, EFLAGS),
|
|
|
|
(CMOVB64rm GR64:$src2, addr:$src1)>;
|
|
|
|
def : Pat<(X86cmov (loadi64 addr:$src1), GR64:$src2, X86_COND_E, EFLAGS),
|
|
|
|
(CMOVNE64rm GR64:$src2, addr:$src1)>;
|
|
|
|
def : Pat<(X86cmov (loadi64 addr:$src1), GR64:$src2, X86_COND_NE, EFLAGS),
|
|
|
|
(CMOVE64rm GR64:$src2, addr:$src1)>;
|
|
|
|
def : Pat<(X86cmov (loadi64 addr:$src1), GR64:$src2, X86_COND_BE, EFLAGS),
|
|
|
|
(CMOVA64rm GR64:$src2, addr:$src1)>;
|
|
|
|
def : Pat<(X86cmov (loadi64 addr:$src1), GR64:$src2, X86_COND_A, EFLAGS),
|
|
|
|
(CMOVBE64rm GR64:$src2, addr:$src1)>;
|
|
|
|
def : Pat<(X86cmov (loadi64 addr:$src1), GR64:$src2, X86_COND_L, EFLAGS),
|
|
|
|
(CMOVGE64rm GR64:$src2, addr:$src1)>;
|
|
|
|
def : Pat<(X86cmov (loadi64 addr:$src1), GR64:$src2, X86_COND_GE, EFLAGS),
|
|
|
|
(CMOVL64rm GR64:$src2, addr:$src1)>;
|
|
|
|
def : Pat<(X86cmov (loadi64 addr:$src1), GR64:$src2, X86_COND_LE, EFLAGS),
|
|
|
|
(CMOVG64rm GR64:$src2, addr:$src1)>;
|
|
|
|
def : Pat<(X86cmov (loadi64 addr:$src1), GR64:$src2, X86_COND_G, EFLAGS),
|
|
|
|
(CMOVLE64rm GR64:$src2, addr:$src1)>;
|
|
|
|
def : Pat<(X86cmov (loadi64 addr:$src1), GR64:$src2, X86_COND_P, EFLAGS),
|
|
|
|
(CMOVNP64rm GR64:$src2, addr:$src1)>;
|
|
|
|
def : Pat<(X86cmov (loadi64 addr:$src1), GR64:$src2, X86_COND_NP, EFLAGS),
|
|
|
|
(CMOVP64rm GR64:$src2, addr:$src1)>;
|
|
|
|
def : Pat<(X86cmov (loadi64 addr:$src1), GR64:$src2, X86_COND_S, EFLAGS),
|
|
|
|
(CMOVNS64rm GR64:$src2, addr:$src1)>;
|
|
|
|
def : Pat<(X86cmov (loadi64 addr:$src1), GR64:$src2, X86_COND_NS, EFLAGS),
|
|
|
|
(CMOVS64rm GR64:$src2, addr:$src1)>;
|
|
|
|
def : Pat<(X86cmov (loadi64 addr:$src1), GR64:$src2, X86_COND_O, EFLAGS),
|
|
|
|
(CMOVNO64rm GR64:$src2, addr:$src1)>;
|
|
|
|
def : Pat<(X86cmov (loadi64 addr:$src1), GR64:$src2, X86_COND_NO, EFLAGS),
|
|
|
|
(CMOVO64rm GR64:$src2, addr:$src1)>;
|
2008-03-13 05:47:01 +00:00
|
|
|
|
2008-01-23 20:39:46 +00:00
|
|
|
// zextload bool -> zextload byte
|
2006-09-08 06:48:29 +00:00
|
|
|
def : Pat<(zextloadi64i1 addr:$src), (MOVZX64rm8 addr:$src)>;
|
|
|
|
|
|
|
|
// extload
|
2008-08-27 17:33:15 +00:00
|
|
|
// When extloading from 16-bit and smaller memory locations into 64-bit registers,
|
|
|
|
// use zero-extending loads so that the entire 64-bit register is defined, avoiding
|
|
|
|
// partial-register updates.
|
|
|
|
def : Pat<(extloadi64i1 addr:$src), (MOVZX64rm8 addr:$src)>;
|
|
|
|
def : Pat<(extloadi64i8 addr:$src), (MOVZX64rm8 addr:$src)>;
|
|
|
|
def : Pat<(extloadi64i16 addr:$src), (MOVZX64rm16 addr:$src)>;
|
|
|
|
// For other extloads, use subregs, since the high contents of the register are
|
|
|
|
// defined after an extload.
|
2008-08-20 21:27:32 +00:00
|
|
|
def : Pat<(extloadi64i32 addr:$src),
|
2009-08-26 14:59:13 +00:00
|
|
|
(SUBREG_TO_REG (i64 0), (MOV32rm addr:$src),
|
2008-08-20 21:27:32 +00:00
|
|
|
x86_subreg_32bit)>;
|
2009-08-26 14:59:13 +00:00
|
|
|
|
|
|
|
// anyext. Define these to do an explicit zero-extend to
|
|
|
|
// avoid partial-register updates.
|
|
|
|
def : Pat<(i64 (anyext GR8 :$src)), (MOVZX64rr8 GR8 :$src)>;
|
|
|
|
def : Pat<(i64 (anyext GR16:$src)), (MOVZX64rr16 GR16 :$src)>;
|
|
|
|
def : Pat<(i64 (anyext GR32:$src)),
|
|
|
|
(SUBREG_TO_REG (i64 0), GR32:$src, x86_subreg_32bit)>;
|
2006-09-08 06:48:29 +00:00
|
|
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// Some peepholes
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2008-10-17 01:33:43 +00:00
|
|
|
// Odd encoding trick: -128 fits into an 8-bit immediate field while
|
|
|
|
// +128 doesn't, so in this special case use a sub instead of an add.
|
|
|
|
def : Pat<(add GR64:$src1, 128),
|
|
|
|
(SUB64ri8 GR64:$src1, -128)>;
|
|
|
|
def : Pat<(store (add (loadi64 addr:$dst), 128), addr:$dst),
|
|
|
|
(SUB64mi8 addr:$dst, -128)>;
|
|
|
|
|
|
|
|
// The same trick applies for 32-bit immediate fields in 64-bit
|
|
|
|
// instructions.
|
|
|
|
def : Pat<(add GR64:$src1, 0x0000000080000000),
|
|
|
|
(SUB64ri32 GR64:$src1, 0xffffffff80000000)>;
|
|
|
|
def : Pat<(store (add (loadi64 addr:$dst), 0x00000000800000000), addr:$dst),
|
|
|
|
(SUB64mi32 addr:$dst, 0xffffffff80000000)>;
|
|
|
|
|
2008-08-07 02:54:50 +00:00
|
|
|
// r & (2^32-1) ==> movz
|
2008-10-17 01:33:43 +00:00
|
|
|
def : Pat<(and GR64:$src, 0x00000000FFFFFFFF),
|
Implement x86 h-register extract support.
- Add patterns for h-register extract, which avoids a shift and mask,
and in some cases a temporary register.
- Add address-mode matching for turning (X>>(8-n))&(255<<n), where
n is a valid address-mode scale value, into an h-register extract
and a scaled-offset address.
- Replace X86's MOV32to32_ and related instructions with the new
target-independent COPY_TO_SUBREG instruction.
On x86-64 there are complicated constraints on h registers, and
CodeGen doesn't currently provide a high-level way to express all of them,
so they are handled with a bunch of special code. This code currently only
supports extracts where the result is used by a zero-extend or a store,
though these are fairly common.
These transformations are not always beneficial; since there are only
4 h registers, they sometimes require extra move instructions, and
this sometimes increases register pressure because it can force out
values that would otherwise be in one of those registers. However,
this appears to be relatively uncommon.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68962 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-13 16:09:41 +00:00
|
|
|
(MOVZX64rr32 (EXTRACT_SUBREG GR64:$src, x86_subreg_32bit))>;
|
2008-07-30 18:09:17 +00:00
|
|
|
// r & (2^16-1) ==> movz
|
|
|
|
def : Pat<(and GR64:$src, 0xffff),
|
|
|
|
(MOVZX64rr16 (i16 (EXTRACT_SUBREG GR64:$src, x86_subreg_16bit)))>;
|
|
|
|
// r & (2^8-1) ==> movz
|
|
|
|
def : Pat<(and GR64:$src, 0xff),
|
|
|
|
(MOVZX64rr8 (i8 (EXTRACT_SUBREG GR64:$src, x86_subreg_8bit)))>;
|
|
|
|
// r & (2^8-1) ==> movz
|
|
|
|
def : Pat<(and GR32:$src1, 0xff),
|
Implement x86 h-register extract support.
- Add patterns for h-register extract, which avoids a shift and mask,
and in some cases a temporary register.
- Add address-mode matching for turning (X>>(8-n))&(255<<n), where
n is a valid address-mode scale value, into an h-register extract
and a scaled-offset address.
- Replace X86's MOV32to32_ and related instructions with the new
target-independent COPY_TO_SUBREG instruction.
On x86-64 there are complicated constraints on h registers, and
CodeGen doesn't currently provide a high-level way to express all of them,
so they are handled with a bunch of special code. This code currently only
supports extracts where the result is used by a zero-extend or a store,
though these are fairly common.
These transformations are not always beneficial; since there are only
4 h registers, they sometimes require extra move instructions, and
this sometimes increases register pressure because it can force out
values that would otherwise be in one of those registers. However,
this appears to be relatively uncommon.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68962 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-13 16:09:41 +00:00
|
|
|
(MOVZX32rr8 (EXTRACT_SUBREG GR32:$src1, x86_subreg_8bit))>,
|
2008-07-30 18:09:17 +00:00
|
|
|
Requires<[In64BitMode]>;
|
|
|
|
// r & (2^8-1) ==> movz
|
|
|
|
def : Pat<(and GR16:$src1, 0xff),
|
|
|
|
(MOVZX16rr8 (i8 (EXTRACT_SUBREG GR16:$src1, x86_subreg_8bit)))>,
|
|
|
|
Requires<[In64BitMode]>;
|
2008-03-13 05:47:01 +00:00
|
|
|
|
2008-08-20 21:27:32 +00:00
|
|
|
// sext_inreg patterns
|
|
|
|
def : Pat<(sext_inreg GR64:$src, i32),
|
Implement x86 h-register extract support.
- Add patterns for h-register extract, which avoids a shift and mask,
and in some cases a temporary register.
- Add address-mode matching for turning (X>>(8-n))&(255<<n), where
n is a valid address-mode scale value, into an h-register extract
and a scaled-offset address.
- Replace X86's MOV32to32_ and related instructions with the new
target-independent COPY_TO_SUBREG instruction.
On x86-64 there are complicated constraints on h registers, and
CodeGen doesn't currently provide a high-level way to express all of them,
so they are handled with a bunch of special code. This code currently only
supports extracts where the result is used by a zero-extend or a store,
though these are fairly common.
These transformations are not always beneficial; since there are only
4 h registers, they sometimes require extra move instructions, and
this sometimes increases register pressure because it can force out
values that would otherwise be in one of those registers. However,
this appears to be relatively uncommon.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68962 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-13 16:09:41 +00:00
|
|
|
(MOVSX64rr32 (EXTRACT_SUBREG GR64:$src, x86_subreg_32bit))>;
|
2008-08-20 21:27:32 +00:00
|
|
|
def : Pat<(sext_inreg GR64:$src, i16),
|
Implement x86 h-register extract support.
- Add patterns for h-register extract, which avoids a shift and mask,
and in some cases a temporary register.
- Add address-mode matching for turning (X>>(8-n))&(255<<n), where
n is a valid address-mode scale value, into an h-register extract
and a scaled-offset address.
- Replace X86's MOV32to32_ and related instructions with the new
target-independent COPY_TO_SUBREG instruction.
On x86-64 there are complicated constraints on h registers, and
CodeGen doesn't currently provide a high-level way to express all of them,
so they are handled with a bunch of special code. This code currently only
supports extracts where the result is used by a zero-extend or a store,
though these are fairly common.
These transformations are not always beneficial; since there are only
4 h registers, they sometimes require extra move instructions, and
this sometimes increases register pressure because it can force out
values that would otherwise be in one of those registers. However,
this appears to be relatively uncommon.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68962 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-13 16:09:41 +00:00
|
|
|
(MOVSX64rr16 (EXTRACT_SUBREG GR64:$src, x86_subreg_16bit))>;
|
2008-08-20 21:27:32 +00:00
|
|
|
def : Pat<(sext_inreg GR64:$src, i8),
|
Implement x86 h-register extract support.
- Add patterns for h-register extract, which avoids a shift and mask,
and in some cases a temporary register.
- Add address-mode matching for turning (X>>(8-n))&(255<<n), where
n is a valid address-mode scale value, into an h-register extract
and a scaled-offset address.
- Replace X86's MOV32to32_ and related instructions with the new
target-independent COPY_TO_SUBREG instruction.
On x86-64 there are complicated constraints on h registers, and
CodeGen doesn't currently provide a high-level way to express all of them,
so they are handled with a bunch of special code. This code currently only
supports extracts where the result is used by a zero-extend or a store,
though these are fairly common.
These transformations are not always beneficial; since there are only
4 h registers, they sometimes require extra move instructions, and
this sometimes increases register pressure because it can force out
values that would otherwise be in one of those registers. However,
this appears to be relatively uncommon.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68962 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-13 16:09:41 +00:00
|
|
|
(MOVSX64rr8 (EXTRACT_SUBREG GR64:$src, x86_subreg_8bit))>;
|
2008-08-20 21:27:32 +00:00
|
|
|
def : Pat<(sext_inreg GR32:$src, i8),
|
Implement x86 h-register extract support.
- Add patterns for h-register extract, which avoids a shift and mask,
and in some cases a temporary register.
- Add address-mode matching for turning (X>>(8-n))&(255<<n), where
n is a valid address-mode scale value, into an h-register extract
and a scaled-offset address.
- Replace X86's MOV32to32_ and related instructions with the new
target-independent COPY_TO_SUBREG instruction.
On x86-64 there are complicated constraints on h registers, and
CodeGen doesn't currently provide a high-level way to express all of them,
so they are handled with a bunch of special code. This code currently only
supports extracts where the result is used by a zero-extend or a store,
though these are fairly common.
These transformations are not always beneficial; since there are only
4 h registers, they sometimes require extra move instructions, and
this sometimes increases register pressure because it can force out
values that would otherwise be in one of those registers. However,
this appears to be relatively uncommon.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68962 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-13 16:09:41 +00:00
|
|
|
(MOVSX32rr8 (EXTRACT_SUBREG GR32:$src, x86_subreg_8bit))>,
|
2008-08-20 21:27:32 +00:00
|
|
|
Requires<[In64BitMode]>;
|
|
|
|
def : Pat<(sext_inreg GR16:$src, i8),
|
|
|
|
(MOVSX16rr8 (i8 (EXTRACT_SUBREG GR16:$src, x86_subreg_8bit)))>,
|
|
|
|
Requires<[In64BitMode]>;
|
|
|
|
|
|
|
|
// trunc patterns
|
|
|
|
def : Pat<(i32 (trunc GR64:$src)),
|
Implement x86 h-register extract support.
- Add patterns for h-register extract, which avoids a shift and mask,
and in some cases a temporary register.
- Add address-mode matching for turning (X>>(8-n))&(255<<n), where
n is a valid address-mode scale value, into an h-register extract
and a scaled-offset address.
- Replace X86's MOV32to32_ and related instructions with the new
target-independent COPY_TO_SUBREG instruction.
On x86-64 there are complicated constraints on h registers, and
CodeGen doesn't currently provide a high-level way to express all of them,
so they are handled with a bunch of special code. This code currently only
supports extracts where the result is used by a zero-extend or a store,
though these are fairly common.
These transformations are not always beneficial; since there are only
4 h registers, they sometimes require extra move instructions, and
this sometimes increases register pressure because it can force out
values that would otherwise be in one of those registers. However,
this appears to be relatively uncommon.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68962 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-13 16:09:41 +00:00
|
|
|
(EXTRACT_SUBREG GR64:$src, x86_subreg_32bit)>;
|
2008-08-20 21:27:32 +00:00
|
|
|
def : Pat<(i16 (trunc GR64:$src)),
|
Implement x86 h-register extract support.
- Add patterns for h-register extract, which avoids a shift and mask,
and in some cases a temporary register.
- Add address-mode matching for turning (X>>(8-n))&(255<<n), where
n is a valid address-mode scale value, into an h-register extract
and a scaled-offset address.
- Replace X86's MOV32to32_ and related instructions with the new
target-independent COPY_TO_SUBREG instruction.
On x86-64 there are complicated constraints on h registers, and
CodeGen doesn't currently provide a high-level way to express all of them,
so they are handled with a bunch of special code. This code currently only
supports extracts where the result is used by a zero-extend or a store,
though these are fairly common.
These transformations are not always beneficial; since there are only
4 h registers, they sometimes require extra move instructions, and
this sometimes increases register pressure because it can force out
values that would otherwise be in one of those registers. However,
this appears to be relatively uncommon.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68962 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-13 16:09:41 +00:00
|
|
|
(EXTRACT_SUBREG GR64:$src, x86_subreg_16bit)>;
|
2008-08-20 21:27:32 +00:00
|
|
|
def : Pat<(i8 (trunc GR64:$src)),
|
Implement x86 h-register extract support.
- Add patterns for h-register extract, which avoids a shift and mask,
and in some cases a temporary register.
- Add address-mode matching for turning (X>>(8-n))&(255<<n), where
n is a valid address-mode scale value, into an h-register extract
and a scaled-offset address.
- Replace X86's MOV32to32_ and related instructions with the new
target-independent COPY_TO_SUBREG instruction.
On x86-64 there are complicated constraints on h registers, and
CodeGen doesn't currently provide a high-level way to express all of them,
so they are handled with a bunch of special code. This code currently only
supports extracts where the result is used by a zero-extend or a store,
though these are fairly common.
These transformations are not always beneficial; since there are only
4 h registers, they sometimes require extra move instructions, and
this sometimes increases register pressure because it can force out
values that would otherwise be in one of those registers. However,
this appears to be relatively uncommon.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68962 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-13 16:09:41 +00:00
|
|
|
(EXTRACT_SUBREG GR64:$src, x86_subreg_8bit)>;
|
2008-08-20 21:27:32 +00:00
|
|
|
def : Pat<(i8 (trunc GR32:$src)),
|
Implement x86 h-register extract support.
- Add patterns for h-register extract, which avoids a shift and mask,
and in some cases a temporary register.
- Add address-mode matching for turning (X>>(8-n))&(255<<n), where
n is a valid address-mode scale value, into an h-register extract
and a scaled-offset address.
- Replace X86's MOV32to32_ and related instructions with the new
target-independent COPY_TO_SUBREG instruction.
On x86-64 there are complicated constraints on h registers, and
CodeGen doesn't currently provide a high-level way to express all of them,
so they are handled with a bunch of special code. This code currently only
supports extracts where the result is used by a zero-extend or a store,
though these are fairly common.
These transformations are not always beneficial; since there are only
4 h registers, they sometimes require extra move instructions, and
this sometimes increases register pressure because it can force out
values that would otherwise be in one of those registers. However,
this appears to be relatively uncommon.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68962 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-13 16:09:41 +00:00
|
|
|
(EXTRACT_SUBREG GR32:$src, x86_subreg_8bit)>,
|
2008-08-20 21:27:32 +00:00
|
|
|
Requires<[In64BitMode]>;
|
|
|
|
def : Pat<(i8 (trunc GR16:$src)),
|
Implement x86 h-register extract support.
- Add patterns for h-register extract, which avoids a shift and mask,
and in some cases a temporary register.
- Add address-mode matching for turning (X>>(8-n))&(255<<n), where
n is a valid address-mode scale value, into an h-register extract
and a scaled-offset address.
- Replace X86's MOV32to32_ and related instructions with the new
target-independent COPY_TO_SUBREG instruction.
On x86-64 there are complicated constraints on h registers, and
CodeGen doesn't currently provide a high-level way to express all of them,
so they are handled with a bunch of special code. This code currently only
supports extracts where the result is used by a zero-extend or a store,
though these are fairly common.
These transformations are not always beneficial; since there are only
4 h registers, they sometimes require extra move instructions, and
this sometimes increases register pressure because it can force out
values that would otherwise be in one of those registers. However,
this appears to be relatively uncommon.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68962 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-13 16:09:41 +00:00
|
|
|
(EXTRACT_SUBREG GR16:$src, x86_subreg_8bit)>,
|
|
|
|
Requires<[In64BitMode]>;
|
|
|
|
|
|
|
|
// h-register tricks.
|
2009-05-31 17:52:18 +00:00
|
|
|
// For now, be conservative on x86-64 and use an h-register extract only if the
|
|
|
|
// value is immediately zero-extended or stored, which are somewhat common
|
|
|
|
// cases. This uses a bunch of code to prevent a register requiring a REX prefix
|
|
|
|
// from being allocated in the same instruction as the h register, as there's
|
|
|
|
// currently no way to describe this requirement to the register allocator.
|
Implement x86 h-register extract support.
- Add patterns for h-register extract, which avoids a shift and mask,
and in some cases a temporary register.
- Add address-mode matching for turning (X>>(8-n))&(255<<n), where
n is a valid address-mode scale value, into an h-register extract
and a scaled-offset address.
- Replace X86's MOV32to32_ and related instructions with the new
target-independent COPY_TO_SUBREG instruction.
On x86-64 there are complicated constraints on h registers, and
CodeGen doesn't currently provide a high-level way to express all of them,
so they are handled with a bunch of special code. This code currently only
supports extracts where the result is used by a zero-extend or a store,
though these are fairly common.
These transformations are not always beneficial; since there are only
4 h registers, they sometimes require extra move instructions, and
this sometimes increases register pressure because it can force out
values that would otherwise be in one of those registers. However,
this appears to be relatively uncommon.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68962 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-13 16:09:41 +00:00
|
|
|
|
|
|
|
// h-register extract and zero-extend.
|
|
|
|
def : Pat<(and (srl_su GR64:$src, (i8 8)), (i64 255)),
|
|
|
|
(SUBREG_TO_REG
|
|
|
|
(i64 0),
|
|
|
|
(MOVZX32_NOREXrr8
|
2009-04-27 16:33:14 +00:00
|
|
|
(EXTRACT_SUBREG (COPY_TO_REGCLASS GR64:$src, GR64_ABCD),
|
Implement x86 h-register extract support.
- Add patterns for h-register extract, which avoids a shift and mask,
and in some cases a temporary register.
- Add address-mode matching for turning (X>>(8-n))&(255<<n), where
n is a valid address-mode scale value, into an h-register extract
and a scaled-offset address.
- Replace X86's MOV32to32_ and related instructions with the new
target-independent COPY_TO_SUBREG instruction.
On x86-64 there are complicated constraints on h registers, and
CodeGen doesn't currently provide a high-level way to express all of them,
so they are handled with a bunch of special code. This code currently only
supports extracts where the result is used by a zero-extend or a store,
though these are fairly common.
These transformations are not always beneficial; since there are only
4 h registers, they sometimes require extra move instructions, and
this sometimes increases register pressure because it can force out
values that would otherwise be in one of those registers. However,
this appears to be relatively uncommon.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68962 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-13 16:09:41 +00:00
|
|
|
x86_subreg_8bit_hi)),
|
|
|
|
x86_subreg_32bit)>;
|
|
|
|
def : Pat<(and (srl_su GR32:$src, (i8 8)), (i32 255)),
|
|
|
|
(MOVZX32_NOREXrr8
|
2009-04-27 16:33:14 +00:00
|
|
|
(EXTRACT_SUBREG (COPY_TO_REGCLASS GR32:$src, GR32_ABCD),
|
Implement x86 h-register extract support.
- Add patterns for h-register extract, which avoids a shift and mask,
and in some cases a temporary register.
- Add address-mode matching for turning (X>>(8-n))&(255<<n), where
n is a valid address-mode scale value, into an h-register extract
and a scaled-offset address.
- Replace X86's MOV32to32_ and related instructions with the new
target-independent COPY_TO_SUBREG instruction.
On x86-64 there are complicated constraints on h registers, and
CodeGen doesn't currently provide a high-level way to express all of them,
so they are handled with a bunch of special code. This code currently only
supports extracts where the result is used by a zero-extend or a store,
though these are fairly common.
These transformations are not always beneficial; since there are only
4 h registers, they sometimes require extra move instructions, and
this sometimes increases register pressure because it can force out
values that would otherwise be in one of those registers. However,
this appears to be relatively uncommon.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68962 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-13 16:09:41 +00:00
|
|
|
x86_subreg_8bit_hi))>,
|
|
|
|
Requires<[In64BitMode]>;
|
|
|
|
def : Pat<(srl_su GR16:$src, (i8 8)),
|
|
|
|
(EXTRACT_SUBREG
|
|
|
|
(MOVZX32_NOREXrr8
|
2009-04-27 16:33:14 +00:00
|
|
|
(EXTRACT_SUBREG (COPY_TO_REGCLASS GR16:$src, GR16_ABCD),
|
Implement x86 h-register extract support.
- Add patterns for h-register extract, which avoids a shift and mask,
and in some cases a temporary register.
- Add address-mode matching for turning (X>>(8-n))&(255<<n), where
n is a valid address-mode scale value, into an h-register extract
and a scaled-offset address.
- Replace X86's MOV32to32_ and related instructions with the new
target-independent COPY_TO_SUBREG instruction.
On x86-64 there are complicated constraints on h registers, and
CodeGen doesn't currently provide a high-level way to express all of them,
so they are handled with a bunch of special code. This code currently only
supports extracts where the result is used by a zero-extend or a store,
though these are fairly common.
These transformations are not always beneficial; since there are only
4 h registers, they sometimes require extra move instructions, and
this sometimes increases register pressure because it can force out
values that would otherwise be in one of those registers. However,
this appears to be relatively uncommon.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68962 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-13 16:09:41 +00:00
|
|
|
x86_subreg_8bit_hi)),
|
|
|
|
x86_subreg_16bit)>,
|
|
|
|
Requires<[In64BitMode]>;
|
2009-05-29 01:44:43 +00:00
|
|
|
def : Pat<(i32 (zext (srl_su GR16:$src, (i8 8)))),
|
|
|
|
(MOVZX32_NOREXrr8
|
|
|
|
(EXTRACT_SUBREG (COPY_TO_REGCLASS GR16:$src, GR16_ABCD),
|
|
|
|
x86_subreg_8bit_hi))>,
|
|
|
|
Requires<[In64BitMode]>;
|
2009-08-26 14:59:13 +00:00
|
|
|
def : Pat<(i32 (anyext (srl_su GR16:$src, (i8 8)))),
|
|
|
|
(MOVZX32_NOREXrr8
|
|
|
|
(EXTRACT_SUBREG (COPY_TO_REGCLASS GR16:$src, GR16_ABCD),
|
|
|
|
x86_subreg_8bit_hi))>,
|
|
|
|
Requires<[In64BitMode]>;
|
2009-05-29 01:44:43 +00:00
|
|
|
def : Pat<(i64 (zext (srl_su GR16:$src, (i8 8)))),
|
2009-08-26 14:59:13 +00:00
|
|
|
(SUBREG_TO_REG
|
|
|
|
(i64 0),
|
|
|
|
(MOVZX32_NOREXrr8
|
|
|
|
(EXTRACT_SUBREG (COPY_TO_REGCLASS GR16:$src, GR16_ABCD),
|
|
|
|
x86_subreg_8bit_hi)),
|
|
|
|
x86_subreg_32bit)>;
|
|
|
|
def : Pat<(i64 (anyext (srl_su GR16:$src, (i8 8)))),
|
2009-05-29 01:44:43 +00:00
|
|
|
(SUBREG_TO_REG
|
|
|
|
(i64 0),
|
|
|
|
(MOVZX32_NOREXrr8
|
|
|
|
(EXTRACT_SUBREG (COPY_TO_REGCLASS GR16:$src, GR16_ABCD),
|
|
|
|
x86_subreg_8bit_hi)),
|
|
|
|
x86_subreg_32bit)>;
|
Implement x86 h-register extract support.
- Add patterns for h-register extract, which avoids a shift and mask,
and in some cases a temporary register.
- Add address-mode matching for turning (X>>(8-n))&(255<<n), where
n is a valid address-mode scale value, into an h-register extract
and a scaled-offset address.
- Replace X86's MOV32to32_ and related instructions with the new
target-independent COPY_TO_SUBREG instruction.
On x86-64 there are complicated constraints on h registers, and
CodeGen doesn't currently provide a high-level way to express all of them,
so they are handled with a bunch of special code. This code currently only
supports extracts where the result is used by a zero-extend or a store,
though these are fairly common.
These transformations are not always beneficial; since there are only
4 h registers, they sometimes require extra move instructions, and
this sometimes increases register pressure because it can force out
values that would otherwise be in one of those registers. However,
this appears to be relatively uncommon.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68962 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-13 16:09:41 +00:00
|
|
|
|
|
|
|
// h-register extract and store.
|
|
|
|
def : Pat<(store (i8 (trunc_su (srl_su GR64:$src, (i8 8)))), addr:$dst),
|
|
|
|
(MOV8mr_NOREX
|
|
|
|
addr:$dst,
|
2009-04-27 16:33:14 +00:00
|
|
|
(EXTRACT_SUBREG (COPY_TO_REGCLASS GR64:$src, GR64_ABCD),
|
Implement x86 h-register extract support.
- Add patterns for h-register extract, which avoids a shift and mask,
and in some cases a temporary register.
- Add address-mode matching for turning (X>>(8-n))&(255<<n), where
n is a valid address-mode scale value, into an h-register extract
and a scaled-offset address.
- Replace X86's MOV32to32_ and related instructions with the new
target-independent COPY_TO_SUBREG instruction.
On x86-64 there are complicated constraints on h registers, and
CodeGen doesn't currently provide a high-level way to express all of them,
so they are handled with a bunch of special code. This code currently only
supports extracts where the result is used by a zero-extend or a store,
though these are fairly common.
These transformations are not always beneficial; since there are only
4 h registers, they sometimes require extra move instructions, and
this sometimes increases register pressure because it can force out
values that would otherwise be in one of those registers. However,
this appears to be relatively uncommon.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68962 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-13 16:09:41 +00:00
|
|
|
x86_subreg_8bit_hi))>;
|
|
|
|
def : Pat<(store (i8 (trunc_su (srl_su GR32:$src, (i8 8)))), addr:$dst),
|
|
|
|
(MOV8mr_NOREX
|
|
|
|
addr:$dst,
|
2009-04-27 16:33:14 +00:00
|
|
|
(EXTRACT_SUBREG (COPY_TO_REGCLASS GR32:$src, GR32_ABCD),
|
Implement x86 h-register extract support.
- Add patterns for h-register extract, which avoids a shift and mask,
and in some cases a temporary register.
- Add address-mode matching for turning (X>>(8-n))&(255<<n), where
n is a valid address-mode scale value, into an h-register extract
and a scaled-offset address.
- Replace X86's MOV32to32_ and related instructions with the new
target-independent COPY_TO_SUBREG instruction.
On x86-64 there are complicated constraints on h registers, and
CodeGen doesn't currently provide a high-level way to express all of them,
so they are handled with a bunch of special code. This code currently only
supports extracts where the result is used by a zero-extend or a store,
though these are fairly common.
These transformations are not always beneficial; since there are only
4 h registers, they sometimes require extra move instructions, and
this sometimes increases register pressure because it can force out
values that would otherwise be in one of those registers. However,
this appears to be relatively uncommon.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68962 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-13 16:09:41 +00:00
|
|
|
x86_subreg_8bit_hi))>,
|
|
|
|
Requires<[In64BitMode]>;
|
|
|
|
def : Pat<(store (i8 (trunc_su (srl_su GR16:$src, (i8 8)))), addr:$dst),
|
|
|
|
(MOV8mr_NOREX
|
|
|
|
addr:$dst,
|
2009-04-27 16:33:14 +00:00
|
|
|
(EXTRACT_SUBREG (COPY_TO_REGCLASS GR16:$src, GR16_ABCD),
|
Implement x86 h-register extract support.
- Add patterns for h-register extract, which avoids a shift and mask,
and in some cases a temporary register.
- Add address-mode matching for turning (X>>(8-n))&(255<<n), where
n is a valid address-mode scale value, into an h-register extract
and a scaled-offset address.
- Replace X86's MOV32to32_ and related instructions with the new
target-independent COPY_TO_SUBREG instruction.
On x86-64 there are complicated constraints on h registers, and
CodeGen doesn't currently provide a high-level way to express all of them,
so they are handled with a bunch of special code. This code currently only
supports extracts where the result is used by a zero-extend or a store,
though these are fairly common.
These transformations are not always beneficial; since there are only
4 h registers, they sometimes require extra move instructions, and
this sometimes increases register pressure because it can force out
values that would otherwise be in one of those registers. However,
this appears to be relatively uncommon.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68962 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-13 16:09:41 +00:00
|
|
|
x86_subreg_8bit_hi))>,
|
2008-08-20 21:27:32 +00:00
|
|
|
Requires<[In64BitMode]>;
|
|
|
|
|
2006-09-08 06:48:29 +00:00
|
|
|
// (shl x, 1) ==> (add x, x)
|
|
|
|
def : Pat<(shl GR64:$src1, (i8 1)), (ADD64rr GR64:$src1, GR64:$src1)>;
|
|
|
|
|
2008-08-30 02:03:58 +00:00
|
|
|
// (shl x (and y, 63)) ==> (shl x, y)
|
|
|
|
def : Pat<(shl GR64:$src1, (and CL:$amt, 63)),
|
|
|
|
(SHL64rCL GR64:$src1)>;
|
|
|
|
def : Pat<(store (shl (loadi64 addr:$dst), (and CL:$amt, 63)), addr:$dst),
|
|
|
|
(SHL64mCL addr:$dst)>;
|
|
|
|
|
|
|
|
def : Pat<(srl GR64:$src1, (and CL:$amt, 63)),
|
|
|
|
(SHR64rCL GR64:$src1)>;
|
|
|
|
def : Pat<(store (srl (loadi64 addr:$dst), (and CL:$amt, 63)), addr:$dst),
|
|
|
|
(SHR64mCL addr:$dst)>;
|
|
|
|
|
|
|
|
def : Pat<(sra GR64:$src1, (and CL:$amt, 63)),
|
|
|
|
(SAR64rCL GR64:$src1)>;
|
|
|
|
def : Pat<(store (sra (loadi64 addr:$dst), (and CL:$amt, 63)), addr:$dst),
|
|
|
|
(SAR64mCL addr:$dst)>;
|
|
|
|
|
2006-09-08 06:48:29 +00:00
|
|
|
// (or (x >> c) | (y << (64 - c))) ==> (shrd64 x, y, c)
|
|
|
|
def : Pat<(or (srl GR64:$src1, CL:$amt),
|
|
|
|
(shl GR64:$src2, (sub 64, CL:$amt))),
|
|
|
|
(SHRD64rrCL GR64:$src1, GR64:$src2)>;
|
|
|
|
|
|
|
|
def : Pat<(store (or (srl (loadi64 addr:$dst), CL:$amt),
|
|
|
|
(shl GR64:$src2, (sub 64, CL:$amt))), addr:$dst),
|
|
|
|
(SHRD64mrCL addr:$dst, GR64:$src2)>;
|
|
|
|
|
2008-10-17 01:23:35 +00:00
|
|
|
def : Pat<(or (srl GR64:$src1, (i8 (trunc RCX:$amt))),
|
|
|
|
(shl GR64:$src2, (i8 (trunc (sub 64, RCX:$amt))))),
|
|
|
|
(SHRD64rrCL GR64:$src1, GR64:$src2)>;
|
|
|
|
|
|
|
|
def : Pat<(store (or (srl (loadi64 addr:$dst), (i8 (trunc RCX:$amt))),
|
|
|
|
(shl GR64:$src2, (i8 (trunc (sub 64, RCX:$amt))))),
|
|
|
|
addr:$dst),
|
|
|
|
(SHRD64mrCL addr:$dst, GR64:$src2)>;
|
|
|
|
|
|
|
|
def : Pat<(shrd GR64:$src1, (i8 imm:$amt1), GR64:$src2, (i8 imm:$amt2)),
|
|
|
|
(SHRD64rri8 GR64:$src1, GR64:$src2, (i8 imm:$amt1))>;
|
|
|
|
|
|
|
|
def : Pat<(store (shrd (loadi64 addr:$dst), (i8 imm:$amt1),
|
|
|
|
GR64:$src2, (i8 imm:$amt2)), addr:$dst),
|
|
|
|
(SHRD64mri8 addr:$dst, GR64:$src2, (i8 imm:$amt1))>;
|
|
|
|
|
2006-09-08 06:48:29 +00:00
|
|
|
// (or (x << c) | (y >> (64 - c))) ==> (shld64 x, y, c)
|
|
|
|
def : Pat<(or (shl GR64:$src1, CL:$amt),
|
|
|
|
(srl GR64:$src2, (sub 64, CL:$amt))),
|
|
|
|
(SHLD64rrCL GR64:$src1, GR64:$src2)>;
|
|
|
|
|
|
|
|
def : Pat<(store (or (shl (loadi64 addr:$dst), CL:$amt),
|
|
|
|
(srl GR64:$src2, (sub 64, CL:$amt))), addr:$dst),
|
|
|
|
(SHLD64mrCL addr:$dst, GR64:$src2)>;
|
2006-11-16 23:33:25 +00:00
|
|
|
|
2008-10-17 01:23:35 +00:00
|
|
|
def : Pat<(or (shl GR64:$src1, (i8 (trunc RCX:$amt))),
|
|
|
|
(srl GR64:$src2, (i8 (trunc (sub 64, RCX:$amt))))),
|
|
|
|
(SHLD64rrCL GR64:$src1, GR64:$src2)>;
|
|
|
|
|
|
|
|
def : Pat<(store (or (shl (loadi64 addr:$dst), (i8 (trunc RCX:$amt))),
|
|
|
|
(srl GR64:$src2, (i8 (trunc (sub 64, RCX:$amt))))),
|
|
|
|
addr:$dst),
|
|
|
|
(SHLD64mrCL addr:$dst, GR64:$src2)>;
|
|
|
|
|
|
|
|
def : Pat<(shld GR64:$src1, (i8 imm:$amt1), GR64:$src2, (i8 imm:$amt2)),
|
|
|
|
(SHLD64rri8 GR64:$src1, GR64:$src2, (i8 imm:$amt1))>;
|
|
|
|
|
|
|
|
def : Pat<(store (shld (loadi64 addr:$dst), (i8 imm:$amt1),
|
|
|
|
GR64:$src2, (i8 imm:$amt2)), addr:$dst),
|
|
|
|
(SHLD64mri8 addr:$dst, GR64:$src2, (i8 imm:$amt1))>;
|
|
|
|
|
2007-05-17 06:35:11 +00:00
|
|
|
// X86 specific add which produces a flag.
|
|
|
|
def : Pat<(addc GR64:$src1, GR64:$src2),
|
|
|
|
(ADD64rr GR64:$src1, GR64:$src2)>;
|
|
|
|
def : Pat<(addc GR64:$src1, (load addr:$src2)),
|
|
|
|
(ADD64rm GR64:$src1, addr:$src2)>;
|
|
|
|
def : Pat<(addc GR64:$src1, i64immSExt8:$src2),
|
|
|
|
(ADD64ri8 GR64:$src1, i64immSExt8:$src2)>;
|
2008-12-19 18:25:21 +00:00
|
|
|
def : Pat<(addc GR64:$src1, i64immSExt32:$src2),
|
|
|
|
(ADD64ri32 GR64:$src1, imm:$src2)>;
|
2007-05-17 06:35:11 +00:00
|
|
|
|
|
|
|
def : Pat<(subc GR64:$src1, GR64:$src2),
|
|
|
|
(SUB64rr GR64:$src1, GR64:$src2)>;
|
|
|
|
def : Pat<(subc GR64:$src1, (load addr:$src2)),
|
|
|
|
(SUB64rm GR64:$src1, addr:$src2)>;
|
|
|
|
def : Pat<(subc GR64:$src1, i64immSExt8:$src2),
|
|
|
|
(SUB64ri8 GR64:$src1, i64immSExt8:$src2)>;
|
2008-12-19 18:25:21 +00:00
|
|
|
def : Pat<(subc GR64:$src1, imm:$src2),
|
|
|
|
(SUB64ri32 GR64:$src1, i64immSExt32:$src2)>;
|
2007-05-17 06:35:11 +00:00
|
|
|
|
2008-12-12 21:15:41 +00:00
|
|
|
//===----------------------------------------------------------------------===//
|
2009-03-04 19:44:21 +00:00
|
|
|
// EFLAGS-defining Patterns
|
2008-12-12 21:15:41 +00:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2009-03-04 19:44:21 +00:00
|
|
|
// Register-Register Addition with EFLAGS result
|
|
|
|
def : Pat<(parallel (X86add_flag GR64:$src1, GR64:$src2),
|
2008-12-12 21:15:41 +00:00
|
|
|
(implicit EFLAGS)),
|
|
|
|
(ADD64rr GR64:$src1, GR64:$src2)>;
|
|
|
|
|
2009-03-04 19:44:21 +00:00
|
|
|
// Register-Integer Addition with EFLAGS result
|
|
|
|
def : Pat<(parallel (X86add_flag GR64:$src1, i64immSExt8:$src2),
|
2008-12-12 21:15:41 +00:00
|
|
|
(implicit EFLAGS)),
|
|
|
|
(ADD64ri8 GR64:$src1, i64immSExt8:$src2)>;
|
2009-03-04 19:44:21 +00:00
|
|
|
def : Pat<(parallel (X86add_flag GR64:$src1, i64immSExt32:$src2),
|
2008-12-19 18:25:21 +00:00
|
|
|
(implicit EFLAGS)),
|
|
|
|
(ADD64ri32 GR64:$src1, i64immSExt32:$src2)>;
|
2008-12-12 21:15:41 +00:00
|
|
|
|
2009-03-04 19:44:21 +00:00
|
|
|
// Register-Memory Addition with EFLAGS result
|
|
|
|
def : Pat<(parallel (X86add_flag GR64:$src1, (loadi64 addr:$src2)),
|
2008-12-12 21:15:41 +00:00
|
|
|
(implicit EFLAGS)),
|
|
|
|
(ADD64rm GR64:$src1, addr:$src2)>;
|
|
|
|
|
2009-03-04 19:44:21 +00:00
|
|
|
// Memory-Register Addition with EFLAGS result
|
|
|
|
def : Pat<(parallel (store (X86add_flag (loadi64 addr:$dst), GR64:$src2),
|
2008-12-12 21:15:41 +00:00
|
|
|
addr:$dst),
|
|
|
|
(implicit EFLAGS)),
|
|
|
|
(ADD64mr addr:$dst, GR64:$src2)>;
|
2009-03-04 19:44:21 +00:00
|
|
|
def : Pat<(parallel (store (X86add_flag (loadi64 addr:$dst), i64immSExt8:$src2),
|
2008-12-12 21:15:41 +00:00
|
|
|
addr:$dst),
|
|
|
|
(implicit EFLAGS)),
|
|
|
|
(ADD64mi8 addr:$dst, i64immSExt8:$src2)>;
|
2009-03-04 19:44:21 +00:00
|
|
|
def : Pat<(parallel (store (X86add_flag (loadi64 addr:$dst), i64immSExt32:$src2),
|
2008-12-19 18:25:21 +00:00
|
|
|
addr:$dst),
|
|
|
|
(implicit EFLAGS)),
|
|
|
|
(ADD64mi32 addr:$dst, i64immSExt32:$src2)>;
|
2008-12-12 21:15:41 +00:00
|
|
|
|
2009-03-04 19:44:21 +00:00
|
|
|
// Register-Register Subtraction with EFLAGS result
|
|
|
|
def : Pat<(parallel (X86sub_flag GR64:$src1, GR64:$src2),
|
2008-12-12 21:15:41 +00:00
|
|
|
(implicit EFLAGS)),
|
|
|
|
(SUB64rr GR64:$src1, GR64:$src2)>;
|
|
|
|
|
2009-03-04 19:44:21 +00:00
|
|
|
// Register-Memory Subtraction with EFLAGS result
|
|
|
|
def : Pat<(parallel (X86sub_flag GR64:$src1, (loadi64 addr:$src2)),
|
2008-12-12 21:15:41 +00:00
|
|
|
(implicit EFLAGS)),
|
|
|
|
(SUB64rm GR64:$src1, addr:$src2)>;
|
|
|
|
|
2009-03-04 19:44:21 +00:00
|
|
|
// Register-Integer Subtraction with EFLAGS result
|
|
|
|
def : Pat<(parallel (X86sub_flag GR64:$src1, i64immSExt8:$src2),
|
2008-12-12 21:15:41 +00:00
|
|
|
(implicit EFLAGS)),
|
|
|
|
(SUB64ri8 GR64:$src1, i64immSExt8:$src2)>;
|
2009-03-04 19:44:21 +00:00
|
|
|
def : Pat<(parallel (X86sub_flag GR64:$src1, i64immSExt32:$src2),
|
2008-12-19 18:25:21 +00:00
|
|
|
(implicit EFLAGS)),
|
|
|
|
(SUB64ri32 GR64:$src1, i64immSExt32:$src2)>;
|
2008-12-12 21:15:41 +00:00
|
|
|
|
2009-03-04 19:44:21 +00:00
|
|
|
// Memory-Register Subtraction with EFLAGS result
|
|
|
|
def : Pat<(parallel (store (X86sub_flag (loadi64 addr:$dst), GR64:$src2),
|
2008-12-12 21:15:41 +00:00
|
|
|
addr:$dst),
|
|
|
|
(implicit EFLAGS)),
|
|
|
|
(SUB64mr addr:$dst, GR64:$src2)>;
|
|
|
|
|
2009-03-04 19:44:21 +00:00
|
|
|
// Memory-Integer Subtraction with EFLAGS result
|
|
|
|
def : Pat<(parallel (store (X86sub_flag (loadi64 addr:$dst), i64immSExt8:$src2),
|
2008-12-12 21:15:41 +00:00
|
|
|
addr:$dst),
|
|
|
|
(implicit EFLAGS)),
|
|
|
|
(SUB64mi8 addr:$dst, i64immSExt8:$src2)>;
|
2009-03-04 19:44:21 +00:00
|
|
|
def : Pat<(parallel (store (X86sub_flag (loadi64 addr:$dst), i64immSExt32:$src2),
|
2008-12-19 18:25:21 +00:00
|
|
|
addr:$dst),
|
|
|
|
(implicit EFLAGS)),
|
|
|
|
(SUB64mi32 addr:$dst, i64immSExt32:$src2)>;
|
2008-12-12 21:15:41 +00:00
|
|
|
|
2009-03-04 19:44:21 +00:00
|
|
|
// Register-Register Signed Integer Multiplication with EFLAGS result
|
|
|
|
def : Pat<(parallel (X86smul_flag GR64:$src1, GR64:$src2),
|
2008-12-12 21:15:41 +00:00
|
|
|
(implicit EFLAGS)),
|
|
|
|
(IMUL64rr GR64:$src1, GR64:$src2)>;
|
|
|
|
|
2009-03-04 19:44:21 +00:00
|
|
|
// Register-Memory Signed Integer Multiplication with EFLAGS result
|
|
|
|
def : Pat<(parallel (X86smul_flag GR64:$src1, (loadi64 addr:$src2)),
|
2008-12-12 21:15:41 +00:00
|
|
|
(implicit EFLAGS)),
|
|
|
|
(IMUL64rm GR64:$src1, addr:$src2)>;
|
|
|
|
|
2009-03-04 19:44:21 +00:00
|
|
|
// Register-Integer Signed Integer Multiplication with EFLAGS result
|
|
|
|
def : Pat<(parallel (X86smul_flag GR64:$src1, i64immSExt8:$src2),
|
2008-12-12 21:15:41 +00:00
|
|
|
(implicit EFLAGS)),
|
|
|
|
(IMUL64rri8 GR64:$src1, i64immSExt8:$src2)>;
|
2009-03-04 19:44:21 +00:00
|
|
|
def : Pat<(parallel (X86smul_flag GR64:$src1, i64immSExt32:$src2),
|
2008-12-19 18:25:21 +00:00
|
|
|
(implicit EFLAGS)),
|
|
|
|
(IMUL64rri32 GR64:$src1, i64immSExt32:$src2)>;
|
2008-12-12 21:15:41 +00:00
|
|
|
|
2009-03-04 19:44:21 +00:00
|
|
|
// Memory-Integer Signed Integer Multiplication with EFLAGS result
|
|
|
|
def : Pat<(parallel (X86smul_flag (loadi64 addr:$src1), i64immSExt8:$src2),
|
2008-12-12 21:15:41 +00:00
|
|
|
(implicit EFLAGS)),
|
|
|
|
(IMUL64rmi8 addr:$src1, i64immSExt8:$src2)>;
|
2009-03-04 19:44:21 +00:00
|
|
|
def : Pat<(parallel (X86smul_flag (loadi64 addr:$src1), i64immSExt32:$src2),
|
2008-12-19 18:25:21 +00:00
|
|
|
(implicit EFLAGS)),
|
|
|
|
(IMUL64rmi32 addr:$src1, i64immSExt32:$src2)>;
|
2007-05-17 06:35:11 +00:00
|
|
|
|
2009-03-04 19:44:21 +00:00
|
|
|
// INC and DEC with EFLAGS result. Note that these do not set CF.
|
2009-03-05 21:32:23 +00:00
|
|
|
def : Pat<(parallel (X86inc_flag GR16:$src), (implicit EFLAGS)),
|
|
|
|
(INC64_16r GR16:$src)>, Requires<[In64BitMode]>;
|
|
|
|
def : Pat<(parallel (store (i16 (X86inc_flag (loadi16 addr:$dst))), addr:$dst),
|
|
|
|
(implicit EFLAGS)),
|
|
|
|
(INC64_16m addr:$dst)>, Requires<[In64BitMode]>;
|
|
|
|
def : Pat<(parallel (X86dec_flag GR16:$src), (implicit EFLAGS)),
|
|
|
|
(DEC64_16r GR16:$src)>, Requires<[In64BitMode]>;
|
|
|
|
def : Pat<(parallel (store (i16 (X86dec_flag (loadi16 addr:$dst))), addr:$dst),
|
|
|
|
(implicit EFLAGS)),
|
|
|
|
(DEC64_16m addr:$dst)>, Requires<[In64BitMode]>;
|
|
|
|
|
|
|
|
def : Pat<(parallel (X86inc_flag GR32:$src), (implicit EFLAGS)),
|
|
|
|
(INC64_32r GR32:$src)>, Requires<[In64BitMode]>;
|
|
|
|
def : Pat<(parallel (store (i32 (X86inc_flag (loadi32 addr:$dst))), addr:$dst),
|
|
|
|
(implicit EFLAGS)),
|
|
|
|
(INC64_32m addr:$dst)>, Requires<[In64BitMode]>;
|
|
|
|
def : Pat<(parallel (X86dec_flag GR32:$src), (implicit EFLAGS)),
|
|
|
|
(DEC64_32r GR32:$src)>, Requires<[In64BitMode]>;
|
|
|
|
def : Pat<(parallel (store (i32 (X86dec_flag (loadi32 addr:$dst))), addr:$dst),
|
|
|
|
(implicit EFLAGS)),
|
|
|
|
(DEC64_32m addr:$dst)>, Requires<[In64BitMode]>;
|
|
|
|
|
2009-03-04 19:44:21 +00:00
|
|
|
def : Pat<(parallel (X86inc_flag GR64:$src), (implicit EFLAGS)),
|
|
|
|
(INC64r GR64:$src)>;
|
|
|
|
def : Pat<(parallel (store (i64 (X86inc_flag (loadi64 addr:$dst))), addr:$dst),
|
|
|
|
(implicit EFLAGS)),
|
|
|
|
(INC64m addr:$dst)>;
|
|
|
|
def : Pat<(parallel (X86dec_flag GR64:$src), (implicit EFLAGS)),
|
|
|
|
(DEC64r GR64:$src)>;
|
|
|
|
def : Pat<(parallel (store (i64 (X86dec_flag (loadi64 addr:$dst))), addr:$dst),
|
|
|
|
(implicit EFLAGS)),
|
|
|
|
(DEC64m addr:$dst)>;
|
|
|
|
|
2006-11-16 23:33:25 +00:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// X86-64 SSE Instructions
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
// Move instructions...
|
|
|
|
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
def MOV64toPQIrr : RPDI<0x6E, MRMSrcReg, (outs VR128:$dst), (ins GR64:$src),
|
2007-07-31 20:11:57 +00:00
|
|
|
"mov{d|q}\t{$src, $dst|$dst, $src}",
|
2006-11-16 23:33:25 +00:00
|
|
|
[(set VR128:$dst,
|
|
|
|
(v2i64 (scalar_to_vector GR64:$src)))]>;
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
def MOVPQIto64rr : RPDI<0x7E, MRMDestReg, (outs GR64:$dst), (ins VR128:$src),
|
2007-07-31 20:11:57 +00:00
|
|
|
"mov{d|q}\t{$src, $dst|$dst, $src}",
|
2006-11-16 23:33:25 +00:00
|
|
|
[(set GR64:$dst, (vector_extract (v2i64 VR128:$src),
|
|
|
|
(iPTR 0)))]>;
|
2006-12-14 21:55:39 +00:00
|
|
|
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
def MOV64toSDrr : RPDI<0x6E, MRMSrcReg, (outs FR64:$dst), (ins GR64:$src),
|
2007-07-31 20:11:57 +00:00
|
|
|
"mov{d|q}\t{$src, $dst|$dst, $src}",
|
2006-12-14 21:55:39 +00:00
|
|
|
[(set FR64:$dst, (bitconvert GR64:$src))]>;
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
def MOV64toSDrm : RPDI<0x6E, MRMSrcMem, (outs FR64:$dst), (ins i64mem:$src),
|
2008-08-25 04:11:42 +00:00
|
|
|
"movq\t{$src, $dst|$dst, $src}",
|
2006-12-14 21:55:39 +00:00
|
|
|
[(set FR64:$dst, (bitconvert (loadi64 addr:$src)))]>;
|
|
|
|
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
def MOVSDto64rr : RPDI<0x7E, MRMDestReg, (outs GR64:$dst), (ins FR64:$src),
|
2007-07-31 20:11:57 +00:00
|
|
|
"mov{d|q}\t{$src, $dst|$dst, $src}",
|
2006-12-14 21:55:39 +00:00
|
|
|
[(set GR64:$dst, (bitconvert FR64:$src))]>;
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 01:14:50 +00:00
|
|
|
def MOVSDto64mr : RPDI<0x7E, MRMDestMem, (outs), (ins i64mem:$dst, FR64:$src),
|
2008-08-25 04:11:42 +00:00
|
|
|
"movq\t{$src, $dst|$dst, $src}",
|
2006-12-14 21:55:39 +00:00
|
|
|
[(store (i64 (bitconvert FR64:$src)), addr:$dst)]>;
|
2008-02-03 07:18:54 +00:00
|
|
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// X86-64 SSE4.1 Instructions
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2008-02-12 22:51:28 +00:00
|
|
|
/// SS41I_extract32 - SSE 4.1 extract 32 bits to int reg or memory destination
|
|
|
|
multiclass SS41I_extract64<bits<8> opc, string OpcodeStr> {
|
2008-10-29 23:07:17 +00:00
|
|
|
def rr : SS4AIi8<opc, MRMDestReg, (outs GR64:$dst),
|
2008-02-12 22:51:28 +00:00
|
|
|
(ins VR128:$src1, i32i8imm:$src2),
|
|
|
|
!strconcat(OpcodeStr,
|
|
|
|
"\t{$src2, $src1, $dst|$dst, $src1, $src2}"),
|
|
|
|
[(set GR64:$dst,
|
|
|
|
(extractelt (v2i64 VR128:$src1), imm:$src2))]>, OpSize, REX_W;
|
2008-03-14 07:39:27 +00:00
|
|
|
def mr : SS4AIi8<opc, MRMDestMem, (outs),
|
2008-02-12 22:51:28 +00:00
|
|
|
(ins i64mem:$dst, VR128:$src1, i32i8imm:$src2),
|
|
|
|
!strconcat(OpcodeStr,
|
|
|
|
"\t{$src2, $src1, $dst|$dst, $src1, $src2}"),
|
|
|
|
[(store (extractelt (v2i64 VR128:$src1), imm:$src2),
|
|
|
|
addr:$dst)]>, OpSize, REX_W;
|
|
|
|
}
|
|
|
|
|
|
|
|
defm PEXTRQ : SS41I_extract64<0x16, "pextrq">;
|
|
|
|
|
|
|
|
let isTwoAddress = 1 in {
|
|
|
|
multiclass SS41I_insert64<bits<8> opc, string OpcodeStr> {
|
2008-03-14 07:39:27 +00:00
|
|
|
def rr : SS4AIi8<opc, MRMSrcReg, (outs VR128:$dst),
|
2008-02-12 22:51:28 +00:00
|
|
|
(ins VR128:$src1, GR64:$src2, i32i8imm:$src3),
|
|
|
|
!strconcat(OpcodeStr,
|
|
|
|
"\t{$src3, $src2, $dst|$dst, $src2, $src3}"),
|
|
|
|
[(set VR128:$dst,
|
|
|
|
(v2i64 (insertelt VR128:$src1, GR64:$src2, imm:$src3)))]>,
|
|
|
|
OpSize, REX_W;
|
2008-03-14 07:39:27 +00:00
|
|
|
def rm : SS4AIi8<opc, MRMSrcMem, (outs VR128:$dst),
|
2008-02-12 22:51:28 +00:00
|
|
|
(ins VR128:$src1, i64mem:$src2, i32i8imm:$src3),
|
|
|
|
!strconcat(OpcodeStr,
|
|
|
|
"\t{$src3, $src2, $dst|$dst, $src2, $src3}"),
|
|
|
|
[(set VR128:$dst,
|
|
|
|
(v2i64 (insertelt VR128:$src1, (loadi64 addr:$src2),
|
|
|
|
imm:$src3)))]>, OpSize, REX_W;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
defm PINSRQ : SS41I_insert64<0x22, "pinsrq">;
|
2009-09-03 17:18:51 +00:00
|
|
|
|
|
|
|
// -disable-16bit support.
|
|
|
|
def : Pat<(truncstorei16 (i64 imm:$src), addr:$dst),
|
|
|
|
(MOV16mi addr:$dst, imm:$src)>;
|
|
|
|
def : Pat<(truncstorei16 GR64:$src, addr:$dst),
|
|
|
|
(MOV16mr addr:$dst, (EXTRACT_SUBREG GR64:$src, x86_subreg_16bit))>;
|
|
|
|
def : Pat<(i64 (sextloadi16 addr:$dst)),
|
|
|
|
(MOVSX64rm16 addr:$dst)>;
|
|
|
|
def : Pat<(i64 (zextloadi16 addr:$dst)),
|
|
|
|
(MOVZX64rm16 addr:$dst)>;
|
|
|
|
def : Pat<(i64 (extloadi16 addr:$dst)),
|
|
|
|
(MOVZX64rm16 addr:$dst)>;
|