Author: mcrosier Date: Tue Oct 8 15:43:46 2013 New Revision: 192232 URL: http://llvm.org/viewvc/llvm-project?rev=192232&view=rev Log: [AArch64] Add support for NEON scalar signed/unsigned integer to floating-point convert instructions.
Modified: cfe/trunk/include/clang/Basic/arm_neon.td cfe/trunk/lib/CodeGen/CGBuiltin.cpp cfe/trunk/test/CodeGen/aarch64-neon-intrinsics.c cfe/trunk/utils/TableGen/NeonEmitter.cpp Modified: cfe/trunk/include/clang/Basic/arm_neon.td URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/arm_neon.td?rev=192232&r1=192231&r2=192232&view=diff ============================================================================== --- cfe/trunk/include/clang/Basic/arm_neon.td (original) +++ cfe/trunk/include/clang/Basic/arm_neon.td Tue Oct 8 15:43:46 2013 @@ -167,6 +167,8 @@ class NoTestOpInst<string n, string p, s // s: scalar of element type // r: scalar of double width element type // a: scalar of element type (splat to vector type) +// y: scalar of float +// o: scalar of double // k: default elt width, double num elts // #: array of default vectors // p: pointer type @@ -765,4 +767,14 @@ def SCALAR_FRECPS : IInst<"vrecps", "sss // Scalar Floating-point Reciprocal Square Root Step def SCALAR_FRSQRTS : IInst<"vrsqrts", "sss", "SfSd">; +//////////////////////////////////////////////////////////////////////////////// +// Scalar Signed Integer Convert To Floating-point +def SCALAR_SCVTFS : SInst<"vcvt_f32", "ys", "Si">; +def SCALAR_SCVTFD : SInst<"vcvt_f64", "os", "Sl">; + +//////////////////////////////////////////////////////////////////////////////// +// Scalar Unsigned Integer Convert To Floating-point +def SCALAR_UCVTFS : SInst<"vcvt_f32", "ys", "SUi">; +def SCALAR_UCVTFD : SInst<"vcvt_f64", "os", "SUl">; + } Modified: cfe/trunk/lib/CodeGen/CGBuiltin.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGBuiltin.cpp?rev=192232&r1=192231&r2=192232&view=diff ============================================================================== --- cfe/trunk/lib/CodeGen/CGBuiltin.cpp (original) +++ cfe/trunk/lib/CodeGen/CGBuiltin.cpp Tue Oct 8 15:43:46 2013 @@ -1971,6 +1971,20 @@ static Value *EmitAArch64ScalarBuiltinEx case AArch64::BI__builtin_neon_vrsqrtsd_f64: Int = Intrinsic::arm_neon_vrsqrts; s = "vrsqrts"; OverloadInt = true; break; + // Scalar Signed Integer Convert To Floating-point + case AArch64::BI__builtin_neon_vcvts_f32_s32: + Int = Intrinsic::aarch64_neon_vcvtf32_s32, + s = "vcvtf"; OverloadInt = false; break; + case AArch64::BI__builtin_neon_vcvtd_f64_s64: + Int = Intrinsic::aarch64_neon_vcvtf64_s64, + s = "vcvtf"; OverloadInt = false; break; + // Scalar Unsigned Integer Convert To Floating-point + case AArch64::BI__builtin_neon_vcvts_f32_u32: + Int = Intrinsic::aarch64_neon_vcvtf32_u32, + s = "vcvtf"; OverloadInt = false; break; + case AArch64::BI__builtin_neon_vcvtd_f64_u64: + Int = Intrinsic::aarch64_neon_vcvtf64_u64, + s = "vcvtf"; OverloadInt = false; break; } if (!Int) Modified: cfe/trunk/test/CodeGen/aarch64-neon-intrinsics.c URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/aarch64-neon-intrinsics.c?rev=192232&r1=192231&r2=192232&view=diff ============================================================================== --- cfe/trunk/test/CodeGen/aarch64-neon-intrinsics.c (original) +++ cfe/trunk/test/CodeGen/aarch64-neon-intrinsics.c Tue Oct 8 15:43:46 2013 @@ -5597,3 +5597,27 @@ float64_t test_vrsqrtsd_f64(float64_t a, return vrsqrtsd_f64(a, b); // CHECK: frsqrts {{d[0-9]+}}, {{d[0-9]+}}, {{d[0-9]+}} } + +float32_t test_vcvts_f32_s32(int32_t a) { +// CHECK: test_vcvts_f32_s32 +// CHECK: scvtf {{s[0-9]+}}, {{s[0-9]+}} + return (float32_t)vcvts_f32_s32(a); +} + +float64_t test_vcvtd_f64_s64(int64_t a) { +// CHECK: test_vcvtd_f64_s64 +// CHECK: scvtf {{d[0-9]+}}, {{d[0-9]+}} + return (float64_t)vcvtd_f64_s64(a); +} + +float32_t test_vcvts_f32_u32(uint32_t a) { +// CHECK: test_vcvts_f32_u32 +// CHECK: ucvtf {{s[0-9]+}}, {{s[0-9]+}} + return (float32_t)vcvts_f32_u32(a); +} + +float64_t test_vcvtd_f64_u64(uint64_t a) { +// CHECK: test_vcvtd_f64_u64 +// CHECK: ucvtf {{d[0-9]+}}, {{d[0-9]+}} + return (float64_t)vcvtd_f64_u64(a); +} Modified: cfe/trunk/utils/TableGen/NeonEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/utils/TableGen/NeonEmitter.cpp?rev=192232&r1=192231&r2=192232&view=diff ============================================================================== --- cfe/trunk/utils/TableGen/NeonEmitter.cpp (original) +++ cfe/trunk/utils/TableGen/NeonEmitter.cpp Tue Oct 8 15:43:46 2013 @@ -456,6 +456,13 @@ static char ModType(const char mod, char if (type == 'd') type = 'l'; break; + case 'o': + scal = true; + type = 'd'; + usgn = false; + break; + case 'y': + scal = true; case 'f': if (type == 'h') quad = true; _______________________________________________ cfe-commits mailing list cfe-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits