2013-10-09 04:43:30 +08:00
|
|
|
; RUN: llc -mtriple=aarch64-none-linux-gnu -mattr=+neon < %s | FileCheck %s
|
|
|
|
|
|
|
|
define float @test_vcvts_f32_s32(i32 %a) {
|
|
|
|
; CHECK: test_vcvts_f32_s32
|
|
|
|
; CHECK: scvtf {{s[0-9]+}}, {{s[0-9]+}}
|
|
|
|
entry:
|
|
|
|
%vcvtf.i = insertelement <1 x i32> undef, i32 %a, i32 0
|
2013-12-11 05:33:50 +08:00
|
|
|
%0 = call float @llvm.aarch64.neon.vcvtint2fps.f32.v1i32(<1 x i32> %vcvtf.i)
|
2013-10-09 04:43:30 +08:00
|
|
|
ret float %0
|
|
|
|
}
|
|
|
|
|
2013-12-11 05:33:50 +08:00
|
|
|
declare float @llvm.aarch64.neon.vcvtint2fps.f32.v1i32(<1 x i32>)
|
2013-10-09 04:43:30 +08:00
|
|
|
|
|
|
|
define double @test_vcvtd_f64_s64(i64 %a) {
|
|
|
|
; CHECK: test_vcvtd_f64_s64
|
|
|
|
; CHECK: scvtf {{d[0-9]+}}, {{d[0-9]+}}
|
|
|
|
entry:
|
|
|
|
%vcvtf.i = insertelement <1 x i64> undef, i64 %a, i32 0
|
2013-12-11 05:33:50 +08:00
|
|
|
%0 = call double @llvm.aarch64.neon.vcvtint2fps.f64.v1i64(<1 x i64> %vcvtf.i)
|
2013-10-09 04:43:30 +08:00
|
|
|
ret double %0
|
|
|
|
}
|
|
|
|
|
2013-12-11 05:33:50 +08:00
|
|
|
declare double @llvm.aarch64.neon.vcvtint2fps.f64.v1i64(<1 x i64>)
|
2013-10-09 04:43:30 +08:00
|
|
|
|
|
|
|
define float @test_vcvts_f32_u32(i32 %a) {
|
|
|
|
; CHECK: test_vcvts_f32_u32
|
|
|
|
; CHECK: ucvtf {{s[0-9]+}}, {{s[0-9]+}}
|
|
|
|
entry:
|
|
|
|
%vcvtf.i = insertelement <1 x i32> undef, i32 %a, i32 0
|
2013-12-11 05:33:50 +08:00
|
|
|
%0 = call float @llvm.aarch64.neon.vcvtint2fpu.f32.v1i32(<1 x i32> %vcvtf.i)
|
2013-10-09 04:43:30 +08:00
|
|
|
ret float %0
|
|
|
|
}
|
|
|
|
|
2013-12-11 05:33:50 +08:00
|
|
|
declare float @llvm.aarch64.neon.vcvtint2fpu.f32.v1i32(<1 x i32>)
|
2013-10-09 04:43:30 +08:00
|
|
|
|
|
|
|
define double @test_vcvtd_f64_u64(i64 %a) {
|
|
|
|
; CHECK: test_vcvtd_f64_u64
|
|
|
|
; CHECK: ucvtf {{d[0-9]+}}, {{d[0-9]+}}
|
|
|
|
entry:
|
|
|
|
%vcvtf.i = insertelement <1 x i64> undef, i64 %a, i32 0
|
2013-12-11 05:33:50 +08:00
|
|
|
%0 = call double @llvm.aarch64.neon.vcvtint2fpu.f64.v1i64(<1 x i64> %vcvtf.i)
|
2013-10-09 04:43:30 +08:00
|
|
|
ret double %0
|
|
|
|
}
|
|
|
|
|
2013-12-11 05:33:50 +08:00
|
|
|
declare double @llvm.aarch64.neon.vcvtint2fpu.f64.v1i64(<1 x i64>)
|
2013-11-01 06:36:59 +08:00
|
|
|
|
|
|
|
define float @test_vcvts_n_f32_s32(i32 %a) {
|
|
|
|
; CHECK: test_vcvts_n_f32_s32
|
|
|
|
; CHECK: scvtf {{s[0-9]+}}, {{s[0-9]+}}, #1
|
|
|
|
entry:
|
|
|
|
%vcvtf = insertelement <1 x i32> undef, i32 %a, i32 0
|
2013-11-16 05:28:10 +08:00
|
|
|
%0 = call float @llvm.aarch64.neon.vcvtf32.n.s32(<1 x i32> %vcvtf, i32 1)
|
2013-11-01 06:36:59 +08:00
|
|
|
ret float %0
|
|
|
|
}
|
|
|
|
|
2013-11-16 05:28:10 +08:00
|
|
|
declare float @llvm.aarch64.neon.vcvtf32.n.s32(<1 x i32>, i32)
|
2013-11-01 06:36:59 +08:00
|
|
|
|
|
|
|
define double @test_vcvtd_n_f64_s64(i64 %a) {
|
|
|
|
; CHECK: test_vcvtd_n_f64_s64
|
|
|
|
; CHECK: scvtf {{d[0-9]+}}, {{d[0-9]+}}, #1
|
|
|
|
entry:
|
|
|
|
%vcvtf = insertelement <1 x i64> undef, i64 %a, i32 0
|
2013-11-16 05:28:10 +08:00
|
|
|
%0 = call double @llvm.aarch64.neon.vcvtf64.n.s64(<1 x i64> %vcvtf, i32 1)
|
2013-11-01 06:36:59 +08:00
|
|
|
ret double %0
|
|
|
|
}
|
|
|
|
|
2013-11-16 05:28:10 +08:00
|
|
|
declare double @llvm.aarch64.neon.vcvtf64.n.s64(<1 x i64>, i32)
|
2013-11-01 06:36:59 +08:00
|
|
|
|
|
|
|
define float @test_vcvts_n_f32_u32(i32 %a) {
|
|
|
|
; CHECK: test_vcvts_n_f32_u32
|
|
|
|
; CHECK: ucvtf {{s[0-9]+}}, {{s[0-9]+}}, #1
|
|
|
|
entry:
|
|
|
|
%vcvtf = insertelement <1 x i32> undef, i32 %a, i32 0
|
2013-11-16 05:28:10 +08:00
|
|
|
%0 = call float @llvm.aarch64.neon.vcvtf32.n.u32(<1 x i32> %vcvtf, i32 1)
|
2013-11-01 06:36:59 +08:00
|
|
|
ret float %0
|
|
|
|
}
|
|
|
|
|
2013-11-16 05:28:10 +08:00
|
|
|
declare float @llvm.aarch64.neon.vcvtf32.n.u32(<1 x i32>, i32)
|
2013-11-01 06:36:59 +08:00
|
|
|
|
|
|
|
define double @test_vcvtd_n_f64_u64(i64 %a) {
|
|
|
|
; CHECK: test_vcvtd_n_f64_u64
|
|
|
|
; CHECK: ucvtf {{d[0-9]+}}, {{d[0-9]+}}, #1
|
|
|
|
entry:
|
|
|
|
%vcvtf = insertelement <1 x i64> undef, i64 %a, i32 0
|
2013-11-16 05:28:10 +08:00
|
|
|
%0 = call double @llvm.aarch64.neon.vcvtf64.n.u64(<1 x i64> %vcvtf, i32 1)
|
2013-11-01 06:36:59 +08:00
|
|
|
ret double %0
|
|
|
|
}
|
|
|
|
|
2013-11-16 05:28:10 +08:00
|
|
|
declare double @llvm.aarch64.neon.vcvtf64.n.u64(<1 x i64>, i32)
|
2013-11-12 02:04:07 +08:00
|
|
|
|
|
|
|
define i32 @test_vcvts_n_s32_f32(float %a) {
|
|
|
|
; CHECK: test_vcvts_n_s32_f32
|
2013-11-29 10:11:22 +08:00
|
|
|
; CHECK: fcvtzs {{s[0-9]+}}, {{s[0-9]+}}, #1
|
2013-11-12 02:04:07 +08:00
|
|
|
entry:
|
|
|
|
%fcvtzs = insertelement <1 x float> undef, float %a, i32 0
|
2013-11-29 10:11:22 +08:00
|
|
|
%fcvtzs1 = call <1 x i32> @llvm.aarch64.neon.vcvts.n.s32.f32(<1 x float> %fcvtzs, i32 1)
|
2013-11-12 02:04:07 +08:00
|
|
|
%0 = extractelement <1 x i32> %fcvtzs1, i32 0
|
|
|
|
ret i32 %0
|
|
|
|
}
|
|
|
|
|
|
|
|
declare <1 x i32> @llvm.aarch64.neon.vcvts.n.s32.f32(<1 x float>, i32)
|
|
|
|
|
|
|
|
define i64 @test_vcvtd_n_s64_f64(double %a) {
|
|
|
|
; CHECK: test_vcvtd_n_s64_f64
|
2013-11-29 10:11:22 +08:00
|
|
|
; CHECK: fcvtzs {{d[0-9]+}}, {{d[0-9]+}}, #1
|
2013-11-12 02:04:07 +08:00
|
|
|
entry:
|
|
|
|
%fcvtzs = insertelement <1 x double> undef, double %a, i32 0
|
2013-11-29 10:11:22 +08:00
|
|
|
%fcvtzs1 = call <1 x i64> @llvm.aarch64.neon.vcvtd.n.s64.f64(<1 x double> %fcvtzs, i32 1)
|
2013-11-12 02:04:07 +08:00
|
|
|
%0 = extractelement <1 x i64> %fcvtzs1, i32 0
|
|
|
|
ret i64 %0
|
|
|
|
}
|
|
|
|
|
|
|
|
declare <1 x i64> @llvm.aarch64.neon.vcvtd.n.s64.f64(<1 x double>, i32)
|
|
|
|
|
|
|
|
define i32 @test_vcvts_n_u32_f32(float %a) {
|
|
|
|
; CHECK: test_vcvts_n_u32_f32
|
2013-11-29 10:11:22 +08:00
|
|
|
; CHECK: fcvtzu {{s[0-9]+}}, {{s[0-9]+}}, #32
|
2013-11-12 02:04:07 +08:00
|
|
|
entry:
|
|
|
|
%fcvtzu = insertelement <1 x float> undef, float %a, i32 0
|
2013-11-29 10:11:22 +08:00
|
|
|
%fcvtzu1 = call <1 x i32> @llvm.aarch64.neon.vcvts.n.u32.f32(<1 x float> %fcvtzu, i32 32)
|
2013-11-12 02:04:07 +08:00
|
|
|
%0 = extractelement <1 x i32> %fcvtzu1, i32 0
|
|
|
|
ret i32 %0
|
|
|
|
}
|
|
|
|
|
|
|
|
declare <1 x i32> @llvm.aarch64.neon.vcvts.n.u32.f32(<1 x float>, i32)
|
|
|
|
|
|
|
|
define i64 @test_vcvtd_n_u64_f64(double %a) {
|
|
|
|
; CHECK: test_vcvtd_n_u64_f64
|
2013-11-29 10:11:22 +08:00
|
|
|
; CHECK: fcvtzu {{d[0-9]+}}, {{d[0-9]+}}, #64
|
2013-11-12 02:04:07 +08:00
|
|
|
entry:
|
|
|
|
%fcvtzu = insertelement <1 x double> undef, double %a, i32 0
|
2013-11-29 10:11:22 +08:00
|
|
|
%fcvtzu1 = tail call <1 x i64> @llvm.aarch64.neon.vcvtd.n.u64.f64(<1 x double> %fcvtzu, i32 64)
|
2013-11-12 02:04:07 +08:00
|
|
|
%0 = extractelement <1 x i64> %fcvtzu1, i32 0
|
|
|
|
ret i64 %0
|
|
|
|
}
|
|
|
|
|
|
|
|
declare <1 x i64> @llvm.aarch64.neon.vcvtd.n.u64.f64(<1 x double>, i32)
|