blob: eba7fa88dc5df3c4209aabdb6ab8d1cd62d5bd00 [file] [log] [blame]
Craig Topper84d8fa32019-12-17 14:32:21 -08001; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2; RUN: llc < %s -mtriple=aarch64-apple-darwin | FileCheck %s
3
4; Check that the legalizer doesn't crash when scalarizing FP conversion
5; instructions' operands. The operands are all illegal on AArch64,
6; ensuring they are legalized. The results are all legal.
7
8define <1 x double> @test_sitofp(<1 x i1> %in) #0 {
9; CHECK-LABEL: test_sitofp:
10; CHECK: ; %bb.0: ; %entry
Craig Topper84d8fa32019-12-17 14:32:21 -080011; CHECK-NEXT: sbfx w8, w0, #0, #1
John Brawn0bb9a272020-01-27 15:51:06 +000012; CHECK-NEXT: scvtf d0, w8
Craig Topper84d8fa32019-12-17 14:32:21 -080013; CHECK-NEXT: ret
14entry:
15 %0 = call <1 x double> @llvm.experimental.constrained.sitofp.v1f64.v1i1(<1 x i1> %in, metadata !"round.dynamic", metadata !"fpexcept.strict") #0
16 ret <1 x double> %0
17}
18
19define <1 x double> @test_uitofp(<1 x i1> %in) #0 {
20; CHECK-LABEL: test_uitofp:
21; CHECK: ; %bb.0: ; %entry
Craig Topper84d8fa32019-12-17 14:32:21 -080022; CHECK-NEXT: and w8, w0, #0x1
John Brawn0bb9a272020-01-27 15:51:06 +000023; CHECK-NEXT: ucvtf d0, w8
Craig Topper84d8fa32019-12-17 14:32:21 -080024; CHECK-NEXT: ret
25entry:
26 %0 = call <1 x double> @llvm.experimental.constrained.uitofp.v1f64.v1i1(<1 x i1> %in, metadata !"round.dynamic", metadata !"fpexcept.strict") #0
27 ret <1 x double> %0
28}
29
30attributes #0 = { strictfp }
31
32declare <1 x double> @llvm.experimental.constrained.sitofp.v1f64.v1i1(<1 x i1>, metadata, metadata)
33declare <1 x double> @llvm.experimental.constrained.uitofp.v1f64.v1i1(<1 x i1>, metadata, metadata)