case llvm::Triple::ppc:
case llvm::Triple::ppc64:
return EmitPPCBuiltinExpr(BuiltinID, E);
- case llvm::Triple::mips:
- case llvm::Triple::mipsel:
- case llvm::Triple::mips64:
- case llvm::Triple::mips64el:
- return EmitMipsBuiltinExpr(BuiltinID, E);
default:
return 0;
}
}
}
}
-
-Value *CodeGenFunction::EmitMipsBuiltinExpr(unsigned BuiltinID,
- const CallExpr *E) {
- SmallVector<Value*, 4> Ops;
-
- for (unsigned i = 0, e = E->getNumArgs(); i != e; i++)
- Ops.push_back(EmitScalarExpr(E->getArg(i)));
-
- Intrinsic::ID ID = Intrinsic::not_intrinsic;
-
- switch (BuiltinID) {
- default: return 0;
- case Mips::BI__builtin_mips_shll_qb:
- llvm::APSInt Value;
- if (E->getArg(1)->isIntegerConstantExpr(Value, getContext()))
- ID = Intrinsic::mips_shll_qb;
- else
- ID = Intrinsic::mips_shll_qb_v;
- break;
- }
-
- llvm::Function *F = CGM.getIntrinsic(ID);
- return Builder.CreateCall(F, Ops, "");
-}
llvm::Value *BuildVector(ArrayRef<llvm::Value*> Ops);
llvm::Value *EmitX86BuiltinExpr(unsigned BuiltinID, const CallExpr *E);
llvm::Value *EmitPPCBuiltinExpr(unsigned BuiltinID, const CallExpr *E);
- llvm::Value *EmitMipsBuiltinExpr(unsigned BuiltinID, const CallExpr *E);
llvm::Value *EmitObjCProtocolExpr(const ObjCProtocolExpr *E);
llvm::Value *EmitObjCStringLiteral(const ObjCStringLiteral *E);
+++ /dev/null
-// REQUIRES: mips-registered-target
-// RUN: %clang_cc1 -triple mips-unknown-linux-gnu -emit-llvm -o - %s | FileCheck %s
-
-typedef signed char v4i8 __attribute__ ((vector_size(4)));
-
-void foo() {
- v4i8 a = {1, 2, 3, 4};
- int shift = 1;
-// CHECK: {{%.*}} = call <4 x i8> @llvm.mips.shll.qb(<4 x i8> {{%.*}}, i32 1)
- v4i8 r1 = __builtin_mips_shll_qb(a, 1);
-// CHECK: {{%.*}} = call <4 x i8> @llvm.mips.shll.qb.v(<4 x i8> {{%.*}}, i32 {{%.*}})
- v4i8 r2 = __builtin_mips_shll_qb(a, shift);
-}