1 ; RUN: llc -O0 -fast-isel -verify-machineinstrs -mtriple=aarch64-apple-ios < %s | FileCheck %s 2 3 ; Fast-isel can't do vector conversions yet, but it was emitting some highly 4 ; suspect UCVTFUWDri MachineInstrs. 5 define <4 x float> @test_uitofp(<4 x i32> %in) { 6 ; CHECK-LABEL: test_uitofp: 7 ; CHECK: ucvtf.4s v0, v0 8 9 %res = uitofp <4 x i32> %in to <4 x float> 10 ret <4 x float> %res 11 } 12 13 define <2 x double> @test_sitofp(<2 x i32> %in) { 14 ; CHECK-LABEL: test_sitofp: 15 ; CHECK: sshll.2d [[EXT:v[0-9]+]], v0, #0 16 ; CHECK: scvtf.2d v0, [[EXT]] 17 18 %res = sitofp <2 x i32> %in to <2 x double> 19 ret <2 x double> %res 20 } 21 22 define <2 x i32> @test_fptoui(<2 x float> %in) { 23 ; CHECK-LABEL: test_fptoui: 24 ; CHECK: fcvtzu.2s v0, v0 25 26 %res = fptoui <2 x float> %in to <2 x i32> 27 ret <2 x i32> %res 28 } 29 30 define <2 x i64> @test_fptosi(<2 x double> %in) { 31 ; CHECK-LABEL: test_fptosi: 32 ; CHECK: fcvtzs.2d v0, v0 33 34 %res = fptosi <2 x double> %in to <2 x i64> 35 ret <2 x i64> %res 36 } 37 38 define fp128 @uitofp_i32_fp128(i32 %a) { 39 entry: 40 ; CHECK-LABEL: uitofp_i32_fp128 41 ; CHECK: bl ___floatunsitf 42 %conv = uitofp i32 %a to fp128 43 ret fp128 %conv 44 } 45 46 define fp128 @uitofp_i64_fp128(i64 %a) { 47 entry: 48 ; CHECK-LABEL: uitofp_i64_fp128 49 ; CHECK: bl ___floatunditf 50 %conv = uitofp i64 %a to fp128 51 ret fp128 %conv 52 } 53 54 define i32 @uitofp_fp128_i32(fp128 %a) { 55 entry: 56 ; CHECK-LABEL: uitofp_fp128_i32 57 ; CHECK: ___fixunstfsi 58 %conv = fptoui fp128 %a to i32 59 ret i32 %conv 60 } 61 62 define i64 @uitofp_fp128_i64(fp128 %a) { 63 entry: 64 ; CHECK-LABEL: uitofp_fp128_i64 65 ; CHECK: ___fixunstfdi 66 %conv = fptoui fp128 %a to i64 67 ret i64 %conv 68 } 69