mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-11-02 07:11:49 +00:00
move string pseudo instructions to InstrCompiler consolidate 64-bit and 32-bit together.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115600 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
010496c6a7
commit
d3f033d969
@ -177,23 +177,6 @@ def BSR64rm : RI<0xBD, MRMSrcMem, (outs GR64:$dst), (ins i64mem:$src),
|
|||||||
[(set GR64:$dst, EFLAGS, (X86bsr (loadi64 addr:$src)))]>, TB;
|
[(set GR64:$dst, EFLAGS, (X86bsr (loadi64 addr:$src)))]>, TB;
|
||||||
} // Defs = [EFLAGS]
|
} // Defs = [EFLAGS]
|
||||||
|
|
||||||
// Repeat string ops
|
|
||||||
let Defs = [RCX,RDI,RSI], Uses = [RCX,RDI,RSI], isCodeGenOnly = 1 in
|
|
||||||
def REP_MOVSQ : RI<0xA5, RawFrm, (outs), (ins), "{rep;movsq|rep movsq}",
|
|
||||||
[(X86rep_movs i64)]>, REP;
|
|
||||||
let Defs = [RCX,RDI], Uses = [RAX,RCX,RDI], isCodeGenOnly = 1 in
|
|
||||||
def REP_STOSQ : RI<0xAB, RawFrm, (outs), (ins), "{rep;stosq|rep stosq}",
|
|
||||||
[(X86rep_stos i64)]>, REP;
|
|
||||||
|
|
||||||
let Defs = [EDI,ESI], Uses = [EDI,ESI,EFLAGS] in
|
|
||||||
def MOVSQ : RI<0xA5, RawFrm, (outs), (ins), "movsq", []>;
|
|
||||||
|
|
||||||
let Defs = [RCX,RDI], Uses = [RAX,RCX,RDI,EFLAGS] in
|
|
||||||
def STOSQ : RI<0xAB, RawFrm, (outs), (ins), "stosq", []>;
|
|
||||||
|
|
||||||
def SCAS64 : RI<0xAF, RawFrm, (outs), (ins), "scasq", []>;
|
|
||||||
|
|
||||||
def CMPS64 : RI<0xA7, RawFrm, (outs), (ins), "cmpsq", []>;
|
|
||||||
|
|
||||||
|
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
@ -146,6 +146,37 @@ def MOV64ri64i32 : Ii32<0xB8, AddRegFrm, (outs GR64:$dst), (ins i64i32imm:$src),
|
|||||||
"", [(set GR64:$dst, i64immZExt32:$src)]>;
|
"", [(set GR64:$dst, i64immZExt32:$src)]>;
|
||||||
|
|
||||||
|
|
||||||
|
//===----------------------------------------------------------------------===//
|
||||||
|
// String Pseudo Instructions
|
||||||
|
//
|
||||||
|
let Defs = [ECX,EDI,ESI], Uses = [ECX,EDI,ESI], isCodeGenOnly = 1 in {
|
||||||
|
def REP_MOVSB : I<0xA4, RawFrm, (outs), (ins), "{rep;movsb|rep movsb}",
|
||||||
|
[(X86rep_movs i8)]>, REP;
|
||||||
|
def REP_MOVSW : I<0xA5, RawFrm, (outs), (ins), "{rep;movsw|rep movsw}",
|
||||||
|
[(X86rep_movs i16)]>, REP, OpSize;
|
||||||
|
def REP_MOVSD : I<0xA5, RawFrm, (outs), (ins), "{rep;movsl|rep movsd}",
|
||||||
|
[(X86rep_movs i32)]>, REP;
|
||||||
|
}
|
||||||
|
|
||||||
|
let Defs = [RCX,RDI,RSI], Uses = [RCX,RDI,RSI], isCodeGenOnly = 1 in
|
||||||
|
def REP_MOVSQ : RI<0xA5, RawFrm, (outs), (ins), "{rep;movsq|rep movsq}",
|
||||||
|
[(X86rep_movs i64)]>, REP;
|
||||||
|
|
||||||
|
|
||||||
|
// FIXME: Should use "(X86rep_stos AL)" as the pattern.
|
||||||
|
let Defs = [ECX,EDI], Uses = [AL,ECX,EDI], isCodeGenOnly = 1 in
|
||||||
|
def REP_STOSB : I<0xAA, RawFrm, (outs), (ins), "{rep;stosb|rep stosb}",
|
||||||
|
[(X86rep_stos i8)]>, REP;
|
||||||
|
let Defs = [ECX,EDI], Uses = [AX,ECX,EDI], isCodeGenOnly = 1 in
|
||||||
|
def REP_STOSW : I<0xAB, RawFrm, (outs), (ins), "{rep;stosw|rep stosw}",
|
||||||
|
[(X86rep_stos i16)]>, REP, OpSize;
|
||||||
|
let Defs = [ECX,EDI], Uses = [EAX,ECX,EDI], isCodeGenOnly = 1 in
|
||||||
|
def REP_STOSD : I<0xAB, RawFrm, (outs), (ins), "{rep;stosl|rep stosd}",
|
||||||
|
[(X86rep_stos i32)]>, REP;
|
||||||
|
|
||||||
|
let Defs = [RCX,RDI], Uses = [RAX,RCX,RDI], isCodeGenOnly = 1 in
|
||||||
|
def REP_STOSQ : RI<0xAB, RawFrm, (outs), (ins), "{rep;stosq|rep stosq}",
|
||||||
|
[(X86rep_stos i64)]>, REP;
|
||||||
|
|
||||||
|
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
@ -641,32 +641,15 @@ def LEA32r : I<0x8D, MRMSrcMem,
|
|||||||
"lea{l}\t{$src|$dst}, {$dst|$src}",
|
"lea{l}\t{$src|$dst}, {$dst|$src}",
|
||||||
[(set GR32:$dst, lea32addr:$src)]>, Requires<[In32BitMode]>;
|
[(set GR32:$dst, lea32addr:$src)]>, Requires<[In32BitMode]>;
|
||||||
|
|
||||||
let Defs = [ECX,EDI,ESI], Uses = [ECX,EDI,ESI], isCodeGenOnly = 1 in {
|
|
||||||
def REP_MOVSB : I<0xA4, RawFrm, (outs), (ins), "{rep;movsb|rep movsb}",
|
|
||||||
[(X86rep_movs i8)]>, REP;
|
|
||||||
def REP_MOVSW : I<0xA5, RawFrm, (outs), (ins), "{rep;movsw|rep movsw}",
|
|
||||||
[(X86rep_movs i16)]>, REP, OpSize;
|
|
||||||
def REP_MOVSD : I<0xA5, RawFrm, (outs), (ins), "{rep;movsl|rep movsd}",
|
|
||||||
[(X86rep_movs i32)]>, REP;
|
|
||||||
}
|
|
||||||
|
|
||||||
// These uses the DF flag in the EFLAGS register to inc or dec EDI and ESI
|
// These uses the DF flag in the EFLAGS register to inc or dec EDI and ESI
|
||||||
let Defs = [EDI,ESI], Uses = [EDI,ESI,EFLAGS] in {
|
let Defs = [EDI,ESI], Uses = [EDI,ESI,EFLAGS] in {
|
||||||
def MOVSB : I<0xA4, RawFrm, (outs), (ins), "{movsb}", []>;
|
def MOVSB : I<0xA4, RawFrm, (outs), (ins), "{movsb}", []>;
|
||||||
def MOVSW : I<0xA5, RawFrm, (outs), (ins), "{movsw}", []>, OpSize;
|
def MOVSW : I<0xA5, RawFrm, (outs), (ins), "{movsw}", []>, OpSize;
|
||||||
def MOVSD : I<0xA5, RawFrm, (outs), (ins), "{movsl|movsd}", []>;
|
def MOVSD : I<0xA5, RawFrm, (outs), (ins), "{movsl|movsd}", []>;
|
||||||
|
def MOVSQ : RI<0xA5, RawFrm, (outs), (ins), "movsq", []>;
|
||||||
}
|
}
|
||||||
|
|
||||||
let Defs = [ECX,EDI], Uses = [AL,ECX,EDI], isCodeGenOnly = 1 in
|
|
||||||
def REP_STOSB : I<0xAA, RawFrm, (outs), (ins), "{rep;stosb|rep stosb}",
|
|
||||||
[(X86rep_stos i8)]>, REP;
|
|
||||||
let Defs = [ECX,EDI], Uses = [AX,ECX,EDI], isCodeGenOnly = 1 in
|
|
||||||
def REP_STOSW : I<0xAB, RawFrm, (outs), (ins), "{rep;stosw|rep stosw}",
|
|
||||||
[(X86rep_stos i16)]>, REP, OpSize;
|
|
||||||
let Defs = [ECX,EDI], Uses = [EAX,ECX,EDI], isCodeGenOnly = 1 in
|
|
||||||
def REP_STOSD : I<0xAB, RawFrm, (outs), (ins), "{rep;stosl|rep stosd}",
|
|
||||||
[(X86rep_stos i32)]>, REP;
|
|
||||||
|
|
||||||
// These uses the DF flag in the EFLAGS register to inc or dec EDI and ESI
|
// These uses the DF flag in the EFLAGS register to inc or dec EDI and ESI
|
||||||
let Defs = [EDI], Uses = [AL,EDI,EFLAGS] in
|
let Defs = [EDI], Uses = [AL,EDI,EFLAGS] in
|
||||||
def STOSB : I<0xAA, RawFrm, (outs), (ins), "{stosb}", []>;
|
def STOSB : I<0xAA, RawFrm, (outs), (ins), "{stosb}", []>;
|
||||||
@ -674,14 +657,18 @@ let Defs = [EDI], Uses = [AX,EDI,EFLAGS] in
|
|||||||
def STOSW : I<0xAB, RawFrm, (outs), (ins), "{stosw}", []>, OpSize;
|
def STOSW : I<0xAB, RawFrm, (outs), (ins), "{stosw}", []>, OpSize;
|
||||||
let Defs = [EDI], Uses = [EAX,EDI,EFLAGS] in
|
let Defs = [EDI], Uses = [EAX,EDI,EFLAGS] in
|
||||||
def STOSD : I<0xAB, RawFrm, (outs), (ins), "{stosl|stosd}", []>;
|
def STOSD : I<0xAB, RawFrm, (outs), (ins), "{stosl|stosd}", []>;
|
||||||
|
let Defs = [RCX,RDI], Uses = [RAX,RCX,RDI,EFLAGS] in
|
||||||
|
def STOSQ : RI<0xAB, RawFrm, (outs), (ins), "stosq", []>;
|
||||||
|
|
||||||
def SCAS8 : I<0xAE, RawFrm, (outs), (ins), "scas{b}", []>;
|
def SCAS8 : I<0xAE, RawFrm, (outs), (ins), "scas{b}", []>;
|
||||||
def SCAS16 : I<0xAF, RawFrm, (outs), (ins), "scas{w}", []>, OpSize;
|
def SCAS16 : I<0xAF, RawFrm, (outs), (ins), "scas{w}", []>, OpSize;
|
||||||
def SCAS32 : I<0xAF, RawFrm, (outs), (ins), "scas{l}", []>;
|
def SCAS32 : I<0xAF, RawFrm, (outs), (ins), "scas{l}", []>;
|
||||||
|
def SCAS64 : RI<0xAF, RawFrm, (outs), (ins), "scasq", []>;
|
||||||
|
|
||||||
def CMPS8 : I<0xA6, RawFrm, (outs), (ins), "cmps{b}", []>;
|
def CMPS8 : I<0xA6, RawFrm, (outs), (ins), "cmps{b}", []>;
|
||||||
def CMPS16 : I<0xA7, RawFrm, (outs), (ins), "cmps{w}", []>, OpSize;
|
def CMPS16 : I<0xA7, RawFrm, (outs), (ins), "cmps{w}", []>, OpSize;
|
||||||
def CMPS32 : I<0xA7, RawFrm, (outs), (ins), "cmps{l}", []>;
|
def CMPS32 : I<0xA7, RawFrm, (outs), (ins), "cmps{l}", []>;
|
||||||
|
def CMPS64 : RI<0xA7, RawFrm, (outs), (ins), "cmpsq", []>;
|
||||||
|
|
||||||
|
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
Loading…
Reference in New Issue
Block a user