Provide ISPC_POINTER_SIZE predefined maacro (32 or 64)
This commit is contained in:
@@ -471,6 +471,9 @@ preprocessor runs:
|
|||||||
* - ISPC_TARGET_{SSE2,SSE4,AVX}
|
* - ISPC_TARGET_{SSE2,SSE4,AVX}
|
||||||
- 1
|
- 1
|
||||||
- One of these will be set, depending on the compilation target.
|
- One of these will be set, depending on the compilation target.
|
||||||
|
* - ISPC_POINTER_SIZE
|
||||||
|
- 32 or 64
|
||||||
|
- Number of bits used to represent a pointer for the target architecture.
|
||||||
* - ISPC_MAJOR_VERSION
|
* - ISPC_MAJOR_VERSION
|
||||||
- 1
|
- 1
|
||||||
- Major version of the ``ispc`` compiler/language
|
- Major version of the ``ispc`` compiler/language
|
||||||
|
|||||||
@@ -1176,6 +1176,11 @@ Module::execPreprocessor(const char* infilename, llvm::raw_string_ostream* ostre
|
|||||||
FATAL("Unhandled target ISA in preprocessor symbol definition");
|
FATAL("Unhandled target ISA in preprocessor symbol definition");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (g->target.is32Bit)
|
||||||
|
opts.addMacroDef("ISPC_POINTER_SIZE=32");
|
||||||
|
else
|
||||||
|
opts.addMacroDef("ISPC_POINTER_SIZE=64");
|
||||||
|
|
||||||
opts.addMacroDef("ISPC_MAJOR_VERSION=1");
|
opts.addMacroDef("ISPC_MAJOR_VERSION=1");
|
||||||
opts.addMacroDef("ISPC_MINOR_VERSION=1");
|
opts.addMacroDef("ISPC_MINOR_VERSION=1");
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user