1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 03:02:36 +01:00
llvm-mirror/test/CodeGen/PowerPC/fast-isel-ext.ll
Nemanja Ivanovic ce5d3e6fbd [PowerPC] Eliminate compares - add i32 sext/zext handling for SETULE/SETUGE
As mentioned in https://reviews.llvm.org/D33718, this simply adds another
pattern to the compare elimination sequence and is committed without a
differential revision.

llvm-svn: 314060
2017-09-23 09:50:12 +00:00

76 lines
1.4 KiB
LLVM

; RUN: llc < %s -O0 -verify-machineinstrs -fast-isel-abort=1 -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr7 | FileCheck %s --check-prefix=ELF64
; zext
define i32 @zext_8_32(i8 %a) nounwind {
; ELF64: zext_8_32
%r = zext i8 %a to i32
; ELF64: clrlwi {{[0-9]+}}, {{[0-9]+}}, 24
ret i32 %r
}
define i32 @zext_16_32(i16 %a) nounwind {
; ELF64: zext_16_32
%r = zext i16 %a to i32
; ELF64: clrlwi {{[0-9]+}}, {{[0-9]+}}, 16
ret i32 %r
}
define i64 @zext_8_64(i8 %a) nounwind {
; ELF64: zext_8_64
%r = zext i8 %a to i64
; ELF64: clrldi {{[0-9]+}}, {{[0-9]+}}, 56
ret i64 %r
}
define i64 @zext_16_64(i16 %a) nounwind {
; ELF64: zext_16_64
%r = zext i16 %a to i64
; ELF64: clrldi {{[0-9]+}}, {{[0-9]+}}, 48
ret i64 %r
}
define i64 @zext_32_64(i32 %a) nounwind {
; ELF64: zext_32_64
%r = zext i32 %a to i64
; ELF64: clrldi {{[0-9]+}}, {{[0-9]+}}, 32
ret i64 %r
}
; sext
define i32 @sext_8_32(i8 %a) nounwind {
; ELF64: sext_8_32
%r = sext i8 %a to i32
; ELF64: extsb
ret i32 %r
}
define i32 @sext_16_32(i16 %a) nounwind {
; ELF64: sext_16_32
%r = sext i16 %a to i32
; ELF64: extsh
ret i32 %r
}
define i64 @sext_8_64(i8 %a) nounwind {
; ELF64: sext_8_64
%r = sext i8 %a to i64
; ELF64: extsb
ret i64 %r
}
define i64 @sext_16_64(i16 %a) nounwind {
; ELF64: sext_16_64
%r = sext i16 %a to i64
; ELF64: extsh
ret i64 %r
}
define i64 @sext_32_64(i32 %a) nounwind {
; ELF64: sext_32_64
%r = sext i32 %a to i64
; ELF64: extsw
ret i64 %r
}