added compile-time constant __is_nvptx_traget that can be used with stdlib.ispc

This commit is contained in:
Evghenii
2014-01-24 09:02:12 +01:00
parent 1a07aed6aa
commit be6ac0408a
2 changed files with 7 additions and 1 deletions

View File

@@ -1181,6 +1181,9 @@ DefineStdlib(SymbolTable *symbolTable, llvm::LLVMContext *ctx, llvm::Module *mod
lDefineConstantInt("__have_native_transcendentals", g->target->hasTranscendentals(),
module, symbolTable);
lDefineConstantInt("__is_nvptx_target", (int)(g->target->getISA() == Target::NVPTX),
module, symbolTable);
if (g->forceAlignment != -1) {
llvm::GlobalVariable *alignment = module->getGlobalVariable("memory_alignment", true);
alignment->setInitializer(LLVMInt32(g->forceAlignment));