1 ; RUN: llc < %s -mtriple=arm64-apple-darwin | FileCheck %s
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.
8 define <1 x double> @test_sitofp(<1 x i1> %in) {
9 ; CHECK-LABEL: test_sitofp:
10 ; CHECK: sbfx [[GPR:w[0-9]+]], w0, #0, #1
11 ; CHECK-NEXT: scvtf d0, [[GPR]]
14 %0 = sitofp <1 x i1> %in to <1 x double>
18 define <1 x double> @test_uitofp(<1 x i1> %in) {
19 ; CHECK-LABEL: test_uitofp:
20 ; CHECK: and [[GPR:w[0-9]+]], w0, #0x1
21 ; CHECK-NEXT: ucvtf d0, [[GPR]]
24 %0 = uitofp <1 x i1> %in to <1 x double>
28 define <1 x i64> @test_fptosi(<1 x fp128> %in) {
29 ; CHECK-LABEL: test_fptosi:
30 ; CHECK: bl ___fixtfdi
31 ; CHECK-NEXT: fmov d0, x0
33 %0 = fptosi <1 x fp128> %in to <1 x i64>
37 define <1 x i64> @test_fptoui(<1 x fp128> %in) {
38 ; CHECK-LABEL: test_fptoui:
39 ; CHECK: bl ___fixunstfdi
40 ; CHECK-NEXT: fmov d0, x0
42 %0 = fptoui <1 x fp128> %in to <1 x i64>