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