2013-01-13 19:37:04 +08:00
|
|
|
; RUN: llc < %s -march=x86-64 -mcpu=penryn | FileCheck -check-prefix=SSE41 %s
|
|
|
|
; RUN: llc < %s -march=x86-64 -mcpu=corei7-avx | FileCheck -check-prefix=AVX1 %s
|
|
|
|
; RUN: llc < %s -march=x86-64 -mcpu=core-avx2 | FileCheck -check-prefix=AVX2 %s
|
|
|
|
|
|
|
|
; PR14887
|
|
|
|
; These tests inject a store into the chain to test the inreg versions of pmovsx
|
|
|
|
|
|
|
|
define void @test1(<2 x i8>* %in, <2 x i64>* %out) nounwind {
|
|
|
|
%wide.load35 = load <2 x i8>* %in, align 1
|
|
|
|
%sext = sext <2 x i8> %wide.load35 to <2 x i64>
|
|
|
|
store <2 x i64> zeroinitializer, <2 x i64>* undef, align 8
|
|
|
|
store <2 x i64> %sext, <2 x i64>* %out, align 8
|
|
|
|
ret void
|
|
|
|
|
2013-07-14 04:38:47 +08:00
|
|
|
; SSE41-LABEL: test1:
|
2013-01-13 19:37:04 +08:00
|
|
|
; SSE41: pmovsxbq
|
|
|
|
|
2013-07-14 04:38:47 +08:00
|
|
|
; AVX1-LABEL: test1:
|
2013-01-13 19:37:04 +08:00
|
|
|
; AVX1: vpmovsxbq
|
|
|
|
|
2013-07-14 04:38:47 +08:00
|
|
|
; AVX2-LABEL: test1:
|
2013-01-13 19:37:04 +08:00
|
|
|
; AVX2: vpmovsxbq
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @test2(<4 x i8>* %in, <4 x i64>* %out) nounwind {
|
|
|
|
%wide.load35 = load <4 x i8>* %in, align 1
|
|
|
|
%sext = sext <4 x i8> %wide.load35 to <4 x i64>
|
|
|
|
store <4 x i64> zeroinitializer, <4 x i64>* undef, align 8
|
|
|
|
store <4 x i64> %sext, <4 x i64>* %out, align 8
|
|
|
|
ret void
|
|
|
|
|
2013-07-14 04:38:47 +08:00
|
|
|
; AVX2-LABEL: test2:
|
2013-01-13 19:37:04 +08:00
|
|
|
; AVX2: vpmovsxbq
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @test3(<4 x i8>* %in, <4 x i32>* %out) nounwind {
|
|
|
|
%wide.load35 = load <4 x i8>* %in, align 1
|
|
|
|
%sext = sext <4 x i8> %wide.load35 to <4 x i32>
|
|
|
|
store <4 x i32> zeroinitializer, <4 x i32>* undef, align 8
|
|
|
|
store <4 x i32> %sext, <4 x i32>* %out, align 8
|
|
|
|
ret void
|
|
|
|
|
2013-07-14 04:38:47 +08:00
|
|
|
; SSE41-LABEL: test3:
|
2013-01-13 19:37:04 +08:00
|
|
|
; SSE41: pmovsxbd
|
|
|
|
|
2013-07-14 04:38:47 +08:00
|
|
|
; AVX1-LABEL: test3:
|
2013-01-13 19:37:04 +08:00
|
|
|
; AVX1: vpmovsxbd
|
|
|
|
|
2013-07-14 04:38:47 +08:00
|
|
|
; AVX2-LABEL: test3:
|
2013-01-13 19:37:04 +08:00
|
|
|
; AVX2: vpmovsxbd
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @test4(<8 x i8>* %in, <8 x i32>* %out) nounwind {
|
|
|
|
%wide.load35 = load <8 x i8>* %in, align 1
|
|
|
|
%sext = sext <8 x i8> %wide.load35 to <8 x i32>
|
|
|
|
store <8 x i32> zeroinitializer, <8 x i32>* undef, align 8
|
|
|
|
store <8 x i32> %sext, <8 x i32>* %out, align 8
|
|
|
|
ret void
|
|
|
|
|
2013-07-14 04:38:47 +08:00
|
|
|
; AVX2-LABEL: test4:
|
2013-01-13 19:37:04 +08:00
|
|
|
; AVX2: vpmovsxbd
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @test5(<8 x i8>* %in, <8 x i16>* %out) nounwind {
|
|
|
|
%wide.load35 = load <8 x i8>* %in, align 1
|
|
|
|
%sext = sext <8 x i8> %wide.load35 to <8 x i16>
|
|
|
|
store <8 x i16> zeroinitializer, <8 x i16>* undef, align 8
|
|
|
|
store <8 x i16> %sext, <8 x i16>* %out, align 8
|
|
|
|
ret void
|
|
|
|
|
2013-07-14 04:38:47 +08:00
|
|
|
; SSE41-LABEL: test5:
|
2013-01-13 19:37:04 +08:00
|
|
|
; SSE41: pmovsxbw
|
|
|
|
|
2013-07-14 04:38:47 +08:00
|
|
|
; AVX1-LABEL: test5:
|
2013-01-13 19:37:04 +08:00
|
|
|
; AVX1: vpmovsxbw
|
|
|
|
|
2013-07-14 04:38:47 +08:00
|
|
|
; AVX2-LABEL: test5:
|
2013-01-13 19:37:04 +08:00
|
|
|
; AVX2: vpmovsxbw
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @test6(<16 x i8>* %in, <16 x i16>* %out) nounwind {
|
|
|
|
%wide.load35 = load <16 x i8>* %in, align 1
|
|
|
|
%sext = sext <16 x i8> %wide.load35 to <16 x i16>
|
|
|
|
store <16 x i16> zeroinitializer, <16 x i16>* undef, align 8
|
|
|
|
store <16 x i16> %sext, <16 x i16>* %out, align 8
|
|
|
|
ret void
|
|
|
|
|
2013-07-14 04:38:47 +08:00
|
|
|
; AVX2-LABEL: test6:
|
2013-01-13 19:37:04 +08:00
|
|
|
; FIXME: v16i8 -> v16i16 is scalarized.
|
|
|
|
; AVX2-NOT: pmovsx
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @test7(<2 x i16>* %in, <2 x i64>* %out) nounwind {
|
|
|
|
%wide.load35 = load <2 x i16>* %in, align 1
|
|
|
|
%sext = sext <2 x i16> %wide.load35 to <2 x i64>
|
|
|
|
store <2 x i64> zeroinitializer, <2 x i64>* undef, align 8
|
|
|
|
store <2 x i64> %sext, <2 x i64>* %out, align 8
|
|
|
|
ret void
|
|
|
|
|
|
|
|
|
2013-07-14 04:38:47 +08:00
|
|
|
; SSE41-LABEL: test7:
|
2013-01-13 19:37:04 +08:00
|
|
|
; SSE41: pmovsxwq
|
|
|
|
|
2013-07-14 04:38:47 +08:00
|
|
|
; AVX1-LABEL: test7:
|
2013-01-13 19:37:04 +08:00
|
|
|
; AVX1: vpmovsxwq
|
|
|
|
|
2013-07-14 04:38:47 +08:00
|
|
|
; AVX2-LABEL: test7:
|
2013-01-13 19:37:04 +08:00
|
|
|
; AVX2: vpmovsxwq
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @test8(<4 x i16>* %in, <4 x i64>* %out) nounwind {
|
|
|
|
%wide.load35 = load <4 x i16>* %in, align 1
|
|
|
|
%sext = sext <4 x i16> %wide.load35 to <4 x i64>
|
|
|
|
store <4 x i64> zeroinitializer, <4 x i64>* undef, align 8
|
|
|
|
store <4 x i64> %sext, <4 x i64>* %out, align 8
|
|
|
|
ret void
|
|
|
|
|
2013-07-14 04:38:47 +08:00
|
|
|
; AVX2-LABEL: test8:
|
2013-01-13 19:37:04 +08:00
|
|
|
; AVX2: vpmovsxwq
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @test9(<4 x i16>* %in, <4 x i32>* %out) nounwind {
|
|
|
|
%wide.load35 = load <4 x i16>* %in, align 1
|
|
|
|
%sext = sext <4 x i16> %wide.load35 to <4 x i32>
|
|
|
|
store <4 x i32> zeroinitializer, <4 x i32>* undef, align 8
|
|
|
|
store <4 x i32> %sext, <4 x i32>* %out, align 8
|
|
|
|
ret void
|
|
|
|
|
2013-07-14 04:38:47 +08:00
|
|
|
; SSE41-LABEL: test9:
|
2013-01-13 19:37:04 +08:00
|
|
|
; SSE41: pmovsxwd
|
|
|
|
|
2013-07-14 04:38:47 +08:00
|
|
|
; AVX1-LABEL: test9:
|
2013-01-13 19:37:04 +08:00
|
|
|
; AVX1: vpmovsxwd
|
|
|
|
|
2013-07-14 04:38:47 +08:00
|
|
|
; AVX2-LABEL: test9:
|
2013-01-13 19:37:04 +08:00
|
|
|
; AVX2: vpmovsxwd
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @test10(<8 x i16>* %in, <8 x i32>* %out) nounwind {
|
|
|
|
%wide.load35 = load <8 x i16>* %in, align 1
|
|
|
|
%sext = sext <8 x i16> %wide.load35 to <8 x i32>
|
|
|
|
store <8 x i32> zeroinitializer, <8 x i32>* undef, align 8
|
|
|
|
store <8 x i32> %sext, <8 x i32>* %out, align 8
|
|
|
|
ret void
|
|
|
|
|
2013-07-14 04:38:47 +08:00
|
|
|
; AVX2-LABEL: test10:
|
2013-01-13 19:37:04 +08:00
|
|
|
; AVX2: vpmovsxwd
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @test11(<2 x i32>* %in, <2 x i64>* %out) nounwind {
|
|
|
|
%wide.load35 = load <2 x i32>* %in, align 1
|
|
|
|
%sext = sext <2 x i32> %wide.load35 to <2 x i64>
|
|
|
|
store <2 x i64> zeroinitializer, <2 x i64>* undef, align 8
|
|
|
|
store <2 x i64> %sext, <2 x i64>* %out, align 8
|
|
|
|
ret void
|
|
|
|
|
2013-07-14 04:38:47 +08:00
|
|
|
; SSE41-LABEL: test11:
|
2013-01-13 19:37:04 +08:00
|
|
|
; SSE41: pmovsxdq
|
|
|
|
|
2013-07-14 04:38:47 +08:00
|
|
|
; AVX1-LABEL: test11:
|
2013-01-13 19:37:04 +08:00
|
|
|
; AVX1: vpmovsxdq
|
|
|
|
|
2013-07-14 04:38:47 +08:00
|
|
|
; AVX2-LABEL: test11:
|
2013-01-13 19:37:04 +08:00
|
|
|
; AVX2: vpmovsxdq
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @test12(<4 x i32>* %in, <4 x i64>* %out) nounwind {
|
|
|
|
%wide.load35 = load <4 x i32>* %in, align 1
|
|
|
|
%sext = sext <4 x i32> %wide.load35 to <4 x i64>
|
|
|
|
store <4 x i64> zeroinitializer, <4 x i64>* undef, align 8
|
|
|
|
store <4 x i64> %sext, <4 x i64>* %out, align 8
|
|
|
|
ret void
|
|
|
|
|
2013-07-14 04:38:47 +08:00
|
|
|
; AVX2-LABEL: test12:
|
2013-01-13 19:37:04 +08:00
|
|
|
; AVX2: vpmovsxdq
|
|
|
|
}
|