mirror of
https://github.com/RPCSX/llvm.git
synced 2024-11-30 23:20:54 +00:00
[x86] Do not relax PUSHi16 to PUSHi32 (PR18414)
They do *different* things to %esp, so they are not equivalent. Rename PUSHi8 to PUSH32i8 and add the missing PUSH16i8. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198761 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
ab5b9489e9
commit
2634d1f6da
@ -217,9 +217,9 @@ static unsigned getRelaxedOpcodeArith(unsigned Op) {
|
||||
case X86::CMP64mi8: return X86::CMP64mi32;
|
||||
|
||||
// PUSH
|
||||
case X86::PUSHi8: return X86::PUSHi32;
|
||||
case X86::PUSHi16: return X86::PUSHi32;
|
||||
case X86::PUSH64i8: return X86::PUSH64i32;
|
||||
case X86::PUSH32i8: return X86::PUSHi32;
|
||||
case X86::PUSH16i8: return X86::PUSHi16;
|
||||
case X86::PUSH64i8: return X86::PUSH64i32;
|
||||
case X86::PUSH64i16: return X86::PUSH64i32;
|
||||
}
|
||||
}
|
||||
|
@ -917,7 +917,10 @@ def PUSH32rmr: I<0xFF, MRM6r, (outs), (ins GR32:$reg), "push{l}\t$reg",[],
|
||||
def PUSH32rmm: I<0xFF, MRM6m, (outs), (ins i32mem:$src), "push{l}\t$src",[],
|
||||
IIC_PUSH_MEM>, OpSize16, Requires<[Not64BitMode]>;
|
||||
|
||||
def PUSHi8 : Ii8<0x6a, RawFrm, (outs), (ins i32i8imm:$imm),
|
||||
def PUSH16i8 : Ii8<0x6a, RawFrm, (outs), (ins i16i8imm:$imm),
|
||||
"push{w}\t$imm", [], IIC_PUSH_IMM>, OpSize,
|
||||
Requires<[Not64BitMode]>;
|
||||
def PUSH32i8 : Ii8<0x6a, RawFrm, (outs), (ins i32i8imm:$imm),
|
||||
"push{l}\t$imm", [], IIC_PUSH_IMM>, OpSize16,
|
||||
Requires<[Not64BitMode]>;
|
||||
def PUSHi16 : Ii16<0x68, RawFrm, (outs), (ins i16imm:$imm),
|
||||
|
5
test/MC/X86/relax-insn.s
Normal file
5
test/MC/X86/relax-insn.s
Normal file
@ -0,0 +1,5 @@
|
||||
// RUN: llvm-mc -filetype=obj -triple i386-pc-linux-gnu %s -o %t
|
||||
// RUN: llvm-objdump -d %t | FileCheck %s
|
||||
|
||||
.global foo
|
||||
pushw $foo // CHECK: pushw
|
Loading…
Reference in New Issue
Block a user