From 668645fcda64201f590f24d76c70030f408a37ea Mon Sep 17 00:00:00 2001 From: Evghenii Date: Fri, 7 Feb 2014 11:05:36 +0100 Subject: [PATCH] first commit --- builtins.cpp | 2 ++ ispc.cpp | 6 ++++++ ispc.h | 5 +++++ 3 files changed, 13 insertions(+) diff --git a/builtins.cpp b/builtins.cpp index fee322e7..581a712a 100644 --- a/builtins.cpp +++ b/builtins.cpp @@ -1150,6 +1150,8 @@ DefineStdlib(SymbolTable *symbolTable, llvm::LLVMContext *ctx, llvm::Module *mod symbolTable); lDefineConstantInt("__have_native_transcendentals", g->target->hasTranscendentals(), module, symbolTable); + lDefineConstantInt("__have_native_trigonometry", g->target->hasTrigonometry(), + module, symbolTable); lDefineConstantInt("__have_native_rsqrtd", g->target->hasRsqrtd(), module, symbolTable); lDefineConstantInt("__have_native_rcpd", g->target->hasRcpd(), diff --git a/ispc.cpp b/ispc.cpp index 1386d65e..0792291e 100644 --- a/ispc.cpp +++ b/ispc.cpp @@ -202,6 +202,7 @@ Target::Target(const char *arch, const char *cpu, const char *isa, bool pic) : m_hasGather(false), m_hasScatter(false), m_hasTranscendentals(false), + m_hasTrigonometry(false), m_hasRsqrtd(false), m_hasRcpd(false) { @@ -420,6 +421,7 @@ Target::Target(const char *arch, const char *cpu, const char *isa, bool pic) : this->m_maskBitCount = 1; this->m_hasHalf = true; this->m_hasTranscendentals = true; + this->m_hasTrigonometry = true; this->m_hasGather = this->m_hasScatter = true; this->m_hasRsqrtd = this->m_hasRcpd = true; } @@ -433,6 +435,7 @@ Target::Target(const char *arch, const char *cpu, const char *isa, bool pic) : this->m_maskBitCount = 1; this->m_hasHalf = true; this->m_hasTranscendentals = true; + this->m_hasTrigonometry = true; this->m_hasGather = this->m_hasScatter = true; this->m_hasRsqrtd = this->m_hasRcpd = true; } @@ -446,6 +449,7 @@ Target::Target(const char *arch, const char *cpu, const char *isa, bool pic) : this->m_maskBitCount = 1; this->m_hasHalf = true; this->m_hasTranscendentals = true; + this->m_hasTrigonometry = true; this->m_hasGather = this->m_hasScatter = true; this->m_hasRsqrtd = this->m_hasRcpd = true; } @@ -459,6 +463,7 @@ Target::Target(const char *arch, const char *cpu, const char *isa, bool pic) : this->m_maskBitCount = 1; this->m_hasHalf = true; this->m_hasTranscendentals = true; + this->m_hasTrigonometry = true; this->m_hasGather = this->m_hasScatter = true; this->m_hasRsqrtd = this->m_hasRcpd = true; } @@ -472,6 +477,7 @@ Target::Target(const char *arch, const char *cpu, const char *isa, bool pic) : this->m_maskBitCount = 1; this->m_hasHalf = true; this->m_hasTranscendentals = true; + this->m_hasTrigonometry = true; this->m_hasGather = this->m_hasScatter = true; this->m_hasRsqrtd = this->m_hasRcpd = true; } diff --git a/ispc.h b/ispc.h index 4b6df8c3..5e554bf7 100644 --- a/ispc.h +++ b/ispc.h @@ -282,6 +282,8 @@ public: bool hasTranscendentals() const {return m_hasTranscendentals;} + bool hasTrigonometry() const {return m_hasTrigonometry;} + bool hasRsqrtd() const {return m_hasRsqrtd;} bool hasRcpd() const {return m_hasRcpd;} @@ -385,6 +387,9 @@ private: sqrt, which we assume that all of them handle). */ bool m_hasTranscendentals; + /** Indicates whether the target has ISA support for trigonometry */ + bool m_hasTrigonometry; + /** Indicates whether there is an ISA double precision rsqrt. */ bool m_hasRsqrtd;