From: Jiangning Liu Date: Tue, 21 Oct 2014 01:34:34 +0000 (+0000) Subject: Lower compound assignment for the missing type llvm::Type::FP128TyID. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=119f205918eb42c39f1d0dbccf021c1f6d469e71;p=clang Lower compound assignment for the missing type llvm::Type::FP128TyID. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220257 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/CGExprComplex.cpp b/lib/CodeGen/CGExprComplex.cpp index e957256ab5..ca19c94be0 100644 --- a/lib/CodeGen/CGExprComplex.cpp +++ b/lib/CodeGen/CGExprComplex.cpp @@ -607,6 +607,8 @@ static StringRef getComplexMultiplyLibCallName(llvm::Type *Ty) { return "__multc3"; case llvm::Type::X86_FP80TyID: return "__mulxc3"; + case llvm::Type::FP128TyID: + return "__multc3"; } } @@ -746,6 +748,8 @@ ComplexPairTy ComplexExprEmitter::EmitBinDiv(const BinOpInfo &Op) { return EmitComplexBinOpLibCall("__divtc3", LibCallOp); case llvm::Type::X86_FP80TyID: return EmitComplexBinOpLibCall("__divxc3", LibCallOp); + case llvm::Type::FP128TyID: + return EmitComplexBinOpLibCall("__divtc3", LibCallOp); } } assert(LHSi && "Can have at most one non-complex operand!"); diff --git a/test/CodeGen/fp128_complex.c b/test/CodeGen/fp128_complex.c new file mode 100644 index 0000000000..7653bf0dd4 --- /dev/null +++ b/test/CodeGen/fp128_complex.c @@ -0,0 +1,10 @@ +// RUN: %clang -target aarch64-linux-gnuabi %s -O3 -S -emit-llvm -o - | FileCheck %s +#include + +complex long double a, b, c, d; +void test_fp128_compound_assign(void) { + // CHECK: tail call { fp128, fp128 } @__multc3 + a *= b; + // CHECK: tail call { fp128, fp128 } @__divtc3 + c /= d; +}