mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-01 08:28:19 +00:00
32-to-64-bit sext_inreg pattern.
llvm-svn: 147004
This commit is contained in:
parent
13f23f5895
commit
ad193d95ae
@ -215,6 +215,8 @@ def DSLL64_32 : FR<0x3c, 0x00, (outs CPU64Regs:$rd), (ins CPURegs:$rt),
|
||||
|
||||
def SLL64_32 : FR<0x0, 0x00, (outs CPU64Regs:$rd), (ins CPURegs:$rt),
|
||||
"sll\t$rd, $rt, 0", [], IIAlu>;
|
||||
def SLL64_64 : FR<0x0, 0x00, (outs CPU64Regs:$rd), (ins CPU64Regs:$rt),
|
||||
"sll\t$rd, $rt, 0", [], IIAlu>;
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// Arbitrary patterns that map to one or more instructions
|
||||
@ -311,3 +313,6 @@ def : Pat<(i64 (anyext CPURegs:$src)), (SLL64_32 CPURegs:$src)>;
|
||||
def : Pat<(i64 (zext CPURegs:$src)), (DSRL (DSLL64_32 CPURegs:$src), 32)>;
|
||||
def : Pat<(i64 (sext CPURegs:$src)), (SLL64_32 CPURegs:$src)>;
|
||||
|
||||
// Sign extend in register
|
||||
def : Pat<(i64 (sext_inreg CPU64Regs:$src, i32)), (SLL64_64 CPU64Regs:$src)>;
|
||||
|
||||
|
@ -9,3 +9,11 @@ entry:
|
||||
%conv = zext i32 %add to i64
|
||||
ret i64 %conv
|
||||
}
|
||||
|
||||
define i64 @sext64_32(i32 %a) nounwind readnone {
|
||||
entry:
|
||||
; CHECK: sll ${{[0-9]+}}, ${{[0-9]+}}, 0
|
||||
%conv = sext i32 %a to i64
|
||||
ret i64 %conv
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user