Changeset View
Changeset View
Standalone View
Standalone View
cfe/trunk/lib/CodeGen/CGBuiltin.cpp
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
Show First 20 Lines • Show All 1,882 Lines • ▼ Show 20 Lines | Value *CodeGenFunction::EmitTargetBuiltinExpr(unsigned BuiltinID, | ||||
case llvm::Triple::r600: | case llvm::Triple::r600: | ||||
case llvm::Triple::amdgcn: | case llvm::Triple::amdgcn: | ||||
return EmitAMDGPUBuiltinExpr(BuiltinID, E); | return EmitAMDGPUBuiltinExpr(BuiltinID, E); | ||||
case llvm::Triple::systemz: | case llvm::Triple::systemz: | ||||
return EmitSystemZBuiltinExpr(BuiltinID, E); | return EmitSystemZBuiltinExpr(BuiltinID, E); | ||||
case llvm::Triple::nvptx: | case llvm::Triple::nvptx: | ||||
case llvm::Triple::nvptx64: | case llvm::Triple::nvptx64: | ||||
return EmitNVPTXBuiltinExpr(BuiltinID, E); | return EmitNVPTXBuiltinExpr(BuiltinID, E); | ||||
case llvm::Triple::wasm32: | |||||
case llvm::Triple::wasm64: | |||||
return EmitWebAssemblyBuiltinExpr(BuiltinID, E); | |||||
default: | default: | ||||
return nullptr; | return nullptr; | ||||
} | } | ||||
} | } | ||||
static llvm::VectorType *GetNeonType(CodeGenFunction *CGF, | static llvm::VectorType *GetNeonType(CodeGenFunction *CGF, | ||||
NeonTypeFlags TypeFlags, | NeonTypeFlags TypeFlags, | ||||
bool V1Ty=false) { | bool V1Ty=false) { | ||||
▲ Show 20 Lines • Show All 5,128 Lines • ▼ Show 20 Lines | Value *FnALAF32 = | ||||
CGM.getIntrinsic(Intrinsic::nvvm_atomic_load_add_f32, Ptr->getType()); | CGM.getIntrinsic(Intrinsic::nvvm_atomic_load_add_f32, Ptr->getType()); | ||||
return Builder.CreateCall(FnALAF32, {Ptr, Val}); | return Builder.CreateCall(FnALAF32, {Ptr, Val}); | ||||
} | } | ||||
default: | default: | ||||
return nullptr; | return nullptr; | ||||
} | } | ||||
} | } | ||||
Value *CodeGenFunction::EmitWebAssemblyBuiltinExpr(unsigned BuiltinID, | |||||
const CallExpr *E) { | |||||
switch (BuiltinID) { | |||||
case WebAssembly::BI__builtin_wasm_page_size: { | |||||
llvm::Type *ResultType = ConvertType(E->getType()); | |||||
Value *Callee = CGM.getIntrinsic(Intrinsic::wasm_page_size, ResultType); | |||||
return Builder.CreateCall(Callee); | |||||
} | |||||
default: | |||||
return nullptr; | |||||
} | |||||
} |