xref: /aosp_15_r20/external/llvm/test/CodeGen/X86/fold-vector-trunc-sitofp.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1; RUN: llc < %s -mtriple=i686-unknown -mattr=+avx | FileCheck %s
2; RUN: llc < %s -mtriple=x86_64-unknown -mattr=+avx | FileCheck %s
3
4; Check that constant integers are correctly being truncated before float conversion
5
6define <4 x float> @test1() {
7; CHECK-LABEL: test1
8; CHECK: movaps {{.*#+}} xmm0 = [-1.000000e+00,0.000000e+00,-1.000000e+00,0.000000e+00]
9; CHECK-NEXT: ret
10  %1 = trunc <4 x i3> <i3 -1, i3 -22, i3 7, i3 8> to <4 x i1>
11  %2 = sitofp <4 x i1> %1 to <4 x float>
12  ret <4 x float> %2
13}
14