AArch64: Constant fold converting vector setcc results to float.
[oota-llvm.git] / test / CodeGen / AArch64 / arm64-setcc-int-to-fp-combine.ll
1 ; RUN: llc < %s -asm-verbose=false -march=arm64 -aarch64-neon-syntax=apple | FileCheck %s
2
3 define <4 x float> @foo(<4 x float> %val, <4 x float> %test) nounwind {
4 ; CHECK-LABEL: foo:
5 ; CHECK-NEXT: fcmeq.4s  v0, v0, v1
6 ; CHECK-NEXT: fmov.4s v1, #1.00000000
7 ; CHECK-NEXT: and.16b v0, v0, v1
8 ; CHECK-NEXT: ret
9   %cmp = fcmp oeq <4 x float> %val, %test
10   %ext = zext <4 x i1> %cmp to <4 x i32>
11   %result = sitofp <4 x i32> %ext to <4 x float>
12   ret <4 x float> %result
13 }