2015-05-27 18:44:32 +00:00
|
|
|
; RUN: llc < %s -O0 -verify-machineinstrs -fast-isel-abort=1 -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr7 | FileCheck %s --check-prefix=ELF64
|
2013-12-22 00:04:03 +00:00
|
|
|
|
|
|
|
@a = global i8 1, align 1
|
|
|
|
@b = global i16 2, align 2
|
|
|
|
@c = global i32 4, align 4
|
|
|
|
|
2015-12-30 11:46:15 +00:00
|
|
|
define void @t1() nounwind {
|
2013-12-22 00:04:03 +00:00
|
|
|
; ELF64: t1
|
2015-05-27 18:44:32 +00:00
|
|
|
%1 = load i8, i8* @a, align 1
|
2013-12-22 00:04:03 +00:00
|
|
|
call void @foo1(i8 zeroext %1)
|
|
|
|
; ELF64: lbz
|
|
|
|
; ELF64-NOT: rldicl
|
|
|
|
; ELF64-NOT: rlwinm
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2015-12-30 11:46:15 +00:00
|
|
|
define void @t2() nounwind {
|
2013-12-22 00:04:03 +00:00
|
|
|
; ELF64: t2
|
2015-05-27 18:44:32 +00:00
|
|
|
%1 = load i16, i16* @b, align 2
|
2013-12-22 00:04:03 +00:00
|
|
|
call void @foo2(i16 zeroext %1)
|
|
|
|
; ELF64: lhz
|
|
|
|
; ELF64-NOT: rldicl
|
|
|
|
; ELF64-NOT: rlwinm
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2015-12-30 11:46:15 +00:00
|
|
|
define void @t2a() nounwind {
|
2013-12-22 00:04:03 +00:00
|
|
|
; ELF64: t2a
|
2015-05-27 18:44:32 +00:00
|
|
|
%1 = load i32, i32* @c, align 4
|
2013-12-22 00:04:03 +00:00
|
|
|
call void @foo3(i32 zeroext %1)
|
|
|
|
; ELF64: lwz
|
|
|
|
; ELF64-NOT: rldicl
|
|
|
|
; ELF64-NOT: rlwinm
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
declare void @foo1(i8 zeroext)
|
|
|
|
declare void @foo2(i16 zeroext)
|
|
|
|
declare void @foo3(i32 zeroext)
|
|
|
|
|
2015-12-30 11:46:15 +00:00
|
|
|
define i32 @t3() nounwind {
|
2013-12-22 00:04:03 +00:00
|
|
|
; ELF64: t3
|
2015-05-27 18:44:32 +00:00
|
|
|
%1 = load i8, i8* @a, align 1
|
2013-12-22 00:04:03 +00:00
|
|
|
%2 = zext i8 %1 to i32
|
|
|
|
; ELF64: lbz
|
|
|
|
; ELF64-NOT: rlwinm
|
|
|
|
ret i32 %2
|
|
|
|
}
|
|
|
|
|
2015-12-30 11:46:15 +00:00
|
|
|
define i32 @t4() nounwind {
|
2013-12-22 00:04:03 +00:00
|
|
|
; ELF64: t4
|
2015-05-27 18:44:32 +00:00
|
|
|
%1 = load i16, i16* @b, align 2
|
2013-12-22 00:04:03 +00:00
|
|
|
%2 = zext i16 %1 to i32
|
|
|
|
; ELF64: lhz
|
|
|
|
; ELF64-NOT: rlwinm
|
|
|
|
ret i32 %2
|
|
|
|
}
|
|
|
|
|
2015-12-30 11:46:15 +00:00
|
|
|
define i32 @t5() nounwind {
|
2013-12-22 00:04:03 +00:00
|
|
|
; ELF64: t5
|
2015-05-27 18:44:32 +00:00
|
|
|
%1 = load i16, i16* @b, align 2
|
2013-12-22 00:04:03 +00:00
|
|
|
%2 = sext i16 %1 to i32
|
|
|
|
; ELF64: lha
|
|
|
|
; ELF64-NOT: rlwinm
|
|
|
|
ret i32 %2
|
|
|
|
}
|
|
|
|
|
2015-12-30 11:46:15 +00:00
|
|
|
define i32 @t6() nounwind {
|
2013-12-22 00:04:03 +00:00
|
|
|
; ELF64: t6
|
2015-05-27 18:44:32 +00:00
|
|
|
%1 = load i8, i8* @a, align 2
|
2013-12-22 00:04:03 +00:00
|
|
|
%2 = sext i8 %1 to i32
|
|
|
|
; ELF64: lbz
|
|
|
|
; ELF64-NOT: rlwinm
|
|
|
|
ret i32 %2
|
|
|
|
}
|
|
|
|
|
2015-12-30 11:46:15 +00:00
|
|
|
define i64 @t7() nounwind {
|
2013-12-22 00:04:03 +00:00
|
|
|
; ELF64: t7
|
2015-05-27 18:44:32 +00:00
|
|
|
%1 = load i8, i8* @a, align 1
|
2013-12-22 00:04:03 +00:00
|
|
|
%2 = zext i8 %1 to i64
|
|
|
|
; ELF64: lbz
|
|
|
|
; ELF64-NOT: rldicl
|
|
|
|
ret i64 %2
|
|
|
|
}
|
|
|
|
|
2015-12-30 11:46:15 +00:00
|
|
|
define i64 @t8() nounwind {
|
2013-12-22 00:04:03 +00:00
|
|
|
; ELF64: t8
|
2015-05-27 18:44:32 +00:00
|
|
|
%1 = load i16, i16* @b, align 2
|
2013-12-22 00:04:03 +00:00
|
|
|
%2 = zext i16 %1 to i64
|
|
|
|
; ELF64: lhz
|
|
|
|
; ELF64-NOT: rldicl
|
|
|
|
ret i64 %2
|
|
|
|
}
|
|
|
|
|
2015-12-30 11:46:15 +00:00
|
|
|
define i64 @t9() nounwind {
|
2013-12-22 00:04:03 +00:00
|
|
|
; ELF64: t9
|
2015-05-27 18:44:32 +00:00
|
|
|
%1 = load i16, i16* @b, align 2
|
2013-12-22 00:04:03 +00:00
|
|
|
%2 = sext i16 %1 to i64
|
|
|
|
; ELF64: lha
|
|
|
|
; ELF64-NOT: extsh
|
|
|
|
ret i64 %2
|
|
|
|
}
|
|
|
|
|
2015-12-30 11:46:15 +00:00
|
|
|
define i64 @t10() nounwind {
|
2013-12-22 00:04:03 +00:00
|
|
|
; ELF64: t10
|
2015-05-27 18:44:32 +00:00
|
|
|
%1 = load i8, i8* @a, align 2
|
2013-12-22 00:04:03 +00:00
|
|
|
%2 = sext i8 %1 to i64
|
|
|
|
; ELF64: lbz
|
|
|
|
; ELF64: extsb
|
|
|
|
ret i64 %2
|
|
|
|
}
|
|
|
|
|
2015-12-30 11:46:15 +00:00
|
|
|
define i64 @t11() nounwind {
|
2013-12-22 00:04:03 +00:00
|
|
|
; ELF64: t11
|
2015-05-27 18:44:32 +00:00
|
|
|
%1 = load i32, i32* @c, align 4
|
2013-12-22 00:04:03 +00:00
|
|
|
%2 = zext i32 %1 to i64
|
|
|
|
; ELF64: lwz
|
|
|
|
; ELF64-NOT: rldicl
|
|
|
|
ret i64 %2
|
|
|
|
}
|
|
|
|
|
2015-12-30 11:46:15 +00:00
|
|
|
define i64 @t12() nounwind {
|
2013-12-22 00:04:03 +00:00
|
|
|
; ELF64: t12
|
2015-05-27 18:44:32 +00:00
|
|
|
%1 = load i32, i32* @c, align 4
|
2013-12-22 00:04:03 +00:00
|
|
|
%2 = sext i32 %1 to i64
|
|
|
|
; ELF64: lwa
|
|
|
|
; ELF64-NOT: extsw
|
|
|
|
ret i64 %2
|
|
|
|
}
|