2015-02-28 02:32:11 +08:00
|
|
|
; RUN: llc < %s -O0 -verify-machineinstrs -fast-isel-abort=1 -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr7 | FileCheck %s --check-prefix=ELF64
|
2013-08-27 03:42:51 +08:00
|
|
|
|
|
|
|
; zext
|
|
|
|
|
2015-07-24 09:07:50 +08:00
|
|
|
define i32 @zext_8_32(i8 %a) nounwind {
|
2013-08-27 03:42:51 +08:00
|
|
|
; ELF64: zext_8_32
|
|
|
|
%r = zext i8 %a to i32
|
2015-04-24 02:30:38 +08:00
|
|
|
; ELF64: clrlwi {{[0-9]+}}, {{[0-9]+}}, 24
|
2013-08-27 03:42:51 +08:00
|
|
|
ret i32 %r
|
|
|
|
}
|
|
|
|
|
2015-07-24 09:07:50 +08:00
|
|
|
define i32 @zext_16_32(i16 %a) nounwind {
|
2013-08-27 03:42:51 +08:00
|
|
|
; ELF64: zext_16_32
|
|
|
|
%r = zext i16 %a to i32
|
2015-04-24 02:30:38 +08:00
|
|
|
; ELF64: clrlwi {{[0-9]+}}, {{[0-9]+}}, 16
|
2013-08-27 03:42:51 +08:00
|
|
|
ret i32 %r
|
|
|
|
}
|
|
|
|
|
2015-07-24 09:07:50 +08:00
|
|
|
define i64 @zext_8_64(i8 %a) nounwind {
|
2013-08-27 03:42:51 +08:00
|
|
|
; ELF64: zext_8_64
|
|
|
|
%r = zext i8 %a to i64
|
2017-09-23 17:50:12 +08:00
|
|
|
; ELF64: clrldi {{[0-9]+}}, {{[0-9]+}}, 56
|
2013-08-27 03:42:51 +08:00
|
|
|
ret i64 %r
|
|
|
|
}
|
|
|
|
|
2015-07-24 09:07:50 +08:00
|
|
|
define i64 @zext_16_64(i16 %a) nounwind {
|
2013-08-27 03:42:51 +08:00
|
|
|
; ELF64: zext_16_64
|
|
|
|
%r = zext i16 %a to i64
|
2017-09-23 17:50:12 +08:00
|
|
|
; ELF64: clrldi {{[0-9]+}}, {{[0-9]+}}, 48
|
2013-08-27 03:42:51 +08:00
|
|
|
ret i64 %r
|
|
|
|
}
|
|
|
|
|
2015-07-24 09:07:50 +08:00
|
|
|
define i64 @zext_32_64(i32 %a) nounwind {
|
2013-08-27 03:42:51 +08:00
|
|
|
; ELF64: zext_32_64
|
|
|
|
%r = zext i32 %a to i64
|
2017-09-23 17:50:12 +08:00
|
|
|
; ELF64: clrldi {{[0-9]+}}, {{[0-9]+}}, 32
|
2013-08-27 03:42:51 +08:00
|
|
|
ret i64 %r
|
|
|
|
}
|
|
|
|
|
|
|
|
; sext
|
|
|
|
|
2015-07-24 09:07:50 +08:00
|
|
|
define i32 @sext_8_32(i8 %a) nounwind {
|
2013-08-27 03:42:51 +08:00
|
|
|
; ELF64: sext_8_32
|
|
|
|
%r = sext i8 %a to i32
|
|
|
|
; ELF64: extsb
|
|
|
|
ret i32 %r
|
|
|
|
}
|
|
|
|
|
2015-07-24 09:07:50 +08:00
|
|
|
define i32 @sext_16_32(i16 %a) nounwind {
|
2013-08-27 03:42:51 +08:00
|
|
|
; ELF64: sext_16_32
|
|
|
|
%r = sext i16 %a to i32
|
|
|
|
; ELF64: extsh
|
|
|
|
ret i32 %r
|
|
|
|
}
|
|
|
|
|
2015-07-24 09:07:50 +08:00
|
|
|
define i64 @sext_8_64(i8 %a) nounwind {
|
2013-08-27 03:42:51 +08:00
|
|
|
; ELF64: sext_8_64
|
|
|
|
%r = sext i8 %a to i64
|
|
|
|
; ELF64: extsb
|
|
|
|
ret i64 %r
|
|
|
|
}
|
|
|
|
|
2015-07-24 09:07:50 +08:00
|
|
|
define i64 @sext_16_64(i16 %a) nounwind {
|
2013-08-27 03:42:51 +08:00
|
|
|
; ELF64: sext_16_64
|
|
|
|
%r = sext i16 %a to i64
|
|
|
|
; ELF64: extsh
|
|
|
|
ret i64 %r
|
|
|
|
}
|
|
|
|
|
2015-07-24 09:07:50 +08:00
|
|
|
define i64 @sext_32_64(i32 %a) nounwind {
|
2013-08-27 03:42:51 +08:00
|
|
|
; ELF64: sext_32_64
|
|
|
|
%r = sext i32 %a to i64
|
|
|
|
; ELF64: extsw
|
|
|
|
ret i64 %r
|
|
|
|
}
|