diff options
author | Bob Wilson <bob.wilson@apple.com> | 2010-12-15 23:36:44 +0000 |
---|---|---|
committer | Bob Wilson <bob.wilson@apple.com> | 2010-12-15 23:36:44 +0000 |
commit | 46e392ae6d09979b087d7b1aca3b816ba4199b89 (patch) | |
tree | ef14e54611a216f591a08673b018a228d0f78409 | |
parent | 7504966cc0d07eac26baabec80a7406695efb307 (diff) |
Implement builtins for Neon half-precision float conversions.
Also tweak the VCVT_F32_F16 entry in arm_neon.td to be more consistent with
the other floating-point conversion builtins. Radar 8068427.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121916 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/clang/Basic/arm_neon.td | 2 | ||||
-rw-r--r-- | lib/CodeGen/CGBuiltin.cpp | 11 |
2 files changed, 11 insertions, 2 deletions
diff --git a/include/clang/Basic/arm_neon.td b/include/clang/Basic/arm_neon.td index d366d6938e..880a0da6bc 100644 --- a/include/clang/Basic/arm_neon.td +++ b/include/clang/Basic/arm_neon.td @@ -303,7 +303,7 @@ def VCVT_F16 : SInst<"vcvt_f16", "hk", "f">; def VCVT_N_S32 : SInst<"vcvt_n_s32", "xdi", "fQf">; def VCVT_N_U32 : SInst<"vcvt_n_u32", "udi", "fQf">; def VCVT_F32 : SInst<"vcvt_f32", "fd", "iUiQiQUi">; -def VCVT_F32_F16 : SInst<"vcvt_f32_f16", "kh", "f">; +def VCVT_F32_F16 : SInst<"vcvt_f32_f16", "fd", "h">; def VCVT_N_F32 : SInst<"vcvt_n_f32", "fdi", "iUiQiQUi">; def VMOVN : IInst<"vmovn", "hk", "silUsUiUl">; def VMOVL : SInst<"vmovl", "wd", "csiUcUsUi">; diff --git a/lib/CodeGen/CGBuiltin.cpp b/lib/CodeGen/CGBuiltin.cpp index 19c3fbb1fa..3fc5efd7f3 100644 --- a/lib/CodeGen/CGBuiltin.cpp +++ b/lib/CodeGen/CGBuiltin.cpp @@ -1226,7 +1226,16 @@ Value *CodeGenFunction::EmitARMBuiltinExpr(unsigned BuiltinID, Function *F = CGM.getIntrinsic(Intrinsic::arm_neon_vcnt, &Ty, 1); return EmitNeonCall(F, Ops, "vcnt"); } - // FIXME: intrinsics for f16<->f32 convert missing from ARM target. + case ARM::BI__builtin_neon_vcvt_f16_v: { + assert((type & 0x7) == 7 && !quad && "unexpected vcvt_f16_v builtin"); + Function *F = CGM.getIntrinsic(Intrinsic::arm_neon_vcvtfp2hf); + return EmitNeonCall(F, Ops, "vcvt"); + } + case ARM::BI__builtin_neon_vcvt_f32_f16: { + assert((type & 0x7) == 7 && !quad && "unexpected vcvt_f32_f16 builtin"); + Function *F = CGM.getIntrinsic(Intrinsic::arm_neon_vcvthf2fp); + return EmitNeonCall(F, Ops, "vcvt"); + } case ARM::BI__builtin_neon_vcvt_f32_v: case ARM::BI__builtin_neon_vcvtq_f32_v: { Ops[0] = Builder.CreateBitCast(Ops[0], Ty); |