Intel SPMD Program Compiler  1.12.0
builtins.h File Reference

Declarations of functions related to builtins and the standard library. More...

#include "ispc.h"
Include dependency graph for builtins.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.


void DefineStdlib (SymbolTable *symbolTable, llvm::LLVMContext *ctx, llvm::Module *module, bool includeStdlib)
void AddBitcodeToModule (const unsigned char *bitcode, int length, llvm::Module *module, SymbolTable *symbolTable=NULL, bool warn=true)

Detailed Description

Declarations of functions related to builtins and the standard library.

Definition in file builtins.h.

Function Documentation

◆ AddBitcodeToModule()

void AddBitcodeToModule ( const unsigned char *  bitcode,
int  length,
llvm::Module *  module,
SymbolTable symbolTable,
bool  warn 

This utility function takes serialized binary LLVM bitcode and adds its definitions to the given module. Functions in the bitcode that can be mapped to ispc functions are also added to the symbol table.

bitcodeBinary LLVM bitcode (e.g. the contents of a *.bc file)
lengthLength of the bitcode buffer
moduleModule to link the bitcode into
symbolTableSymbol table to add definitions to

Definition at line 829 of file builtins.cpp.

References Assert, Globals::ctx, Debug(), Error(), g, Target::getISA(), lAddModuleSymbols(), lCheckModuleIntrinsics(), lSetInternalFunctions(), m, Module::module, Globals::target, VerifyDataLayoutCompatibility(), and Warning().

Referenced by lInitDispatchModule().

◆ DefineStdlib()

void DefineStdlib ( SymbolTable symbolTable,
llvm::LLVMContext *  ctx,
llvm::Module *  module,
bool  includeStdlib 

Adds declarations and definitions of ispc standard library functions and types to the given module.

symbolTableSymbolTable in which to add symbol definitions for stdlib stuff
ctxllvm::LLVMContext to use for getting types and the like for standard library definitions
moduleModule in which to add the declarations/definitions
includeStdlibIndicates whether the definitions from the stdlib.ispc file should be added to the module.

Definition at line 1133 of file builtins.cpp.

References Assert, Target::AVX, Target::AVX2, Error(), EXPORT_MODULE, EXPORT_MODULE_COND_WARN, Opt::fastMaskedVload, FATAL, Globals::forceAlignment, g, Globals::generateDebuggingSymbols, Target::GENERIC, Target::getArch(), Target::getDataTypeWidth(), Target::getISA(), Target::getMaskBitCount(), Target::getVectorWidth(), Target::hasHalf(), Target::hasRand(), Target::hasRcpd(), Target::hasRsqrtd(), Target::hasTranscendentals(), Target::hasTrigonometry(), Target::is32Bit(), Target::KNL_AVX512, lDefineConstantInt(), lDefineConstantIntFunc(), lDefineProgramIndex(), LLVMInt32(), Globals::Math_ISPC, Globals::Math_ISPCFast, Globals::Math_SVML, Globals::Math_System, Globals::mathLib, Globals::opt, OS_ANDROID, OS_IOS, OS_LINUX, OS_MAC, OS_PS4, OS_WINDOWS, Target::SKX_AVX512, Target::SSE2, Target::SSE4, Globals::target, Globals::target_os, yy_scan_string(), and yyparse().

Referenced by Module::CompileFile().