From f39d31174e9167c637507c6303253fd1d308b7d1 Mon Sep 17 00:00:00 2001 From: Andreas Wendleder Date: Thu, 23 Jun 2011 18:39:58 +0200 Subject: [PATCH 1/4] Follow LLVM API change. --- expr.cpp | 2 +- llvmutil.cpp | 32 ++++++++++++++++---------------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/expr.cpp b/expr.cpp index 9f0d15e2..bf062913 100644 --- a/expr.cpp +++ b/expr.cpp @@ -380,7 +380,7 @@ lLLVMConstantValue(const Type *type, llvm::LLVMContext *ctx, double value) { std::vector vals; for (unsigned int i = 0; i < lvt->getNumElements(); ++i) vals.push_back(constElement); - return llvm::ConstantVector::get(lvt, vals); + return llvm::ConstantVector::get(vals); } else { const llvm::ArrayType *lat = diff --git a/llvmutil.cpp b/llvmutil.cpp index e0fc4511..1f64e06b 100644 --- a/llvmutil.cpp +++ b/llvmutil.cpp @@ -116,7 +116,7 @@ InitLLVMUtil(llvm::LLVMContext *ctx, Target target) { for (int i = 0; i < target.vectorWidth; ++i) maskOnes.push_back(onMask); - LLVMMaskAllOn = llvm::ConstantVector::get(LLVMTypes::MaskType, maskOnes); + LLVMMaskAllOn = llvm::ConstantVector::get(maskOnes); std::vector maskZeros; llvm::Constant *offMask = NULL; @@ -125,7 +125,7 @@ InitLLVMUtil(llvm::LLVMContext *ctx, Target target) { for (int i = 0; i < target.vectorWidth; ++i) maskZeros.push_back(offMask); - LLVMMaskAllOff = llvm::ConstantVector::get(LLVMTypes::MaskType, maskZeros); + LLVMMaskAllOff = llvm::ConstantVector::get(maskZeros); } @@ -174,7 +174,7 @@ LLVMInt32Vector(int32_t ival) { std::vector vals; for (int i = 0; i < g->target.vectorWidth; ++i) vals.push_back(v); - return llvm::ConstantVector::get(LLVMTypes::Int32VectorType, vals); + return llvm::ConstantVector::get(vals); } @@ -183,7 +183,7 @@ LLVMInt32Vector(const int32_t *ivec) { std::vector vals; for (int i = 0; i < g->target.vectorWidth; ++i) vals.push_back(LLVMInt32(ivec[i])); - return llvm::ConstantVector::get(LLVMTypes::Int32VectorType, vals); + return llvm::ConstantVector::get(vals); } @@ -193,7 +193,7 @@ LLVMUInt32Vector(uint32_t ival) { std::vector vals; for (int i = 0; i < g->target.vectorWidth; ++i) vals.push_back(v); - return llvm::ConstantVector::get(LLVMTypes::Int32VectorType, vals); + return llvm::ConstantVector::get(vals); } @@ -202,7 +202,7 @@ LLVMUInt32Vector(const uint32_t *ivec) { std::vector vals; for (int i = 0; i < g->target.vectorWidth; ++i) vals.push_back(LLVMUInt32(ivec[i])); - return llvm::ConstantVector::get(LLVMTypes::Int32VectorType, vals); + return llvm::ConstantVector::get(vals); } @@ -212,7 +212,7 @@ LLVMFloatVector(float fval) { std::vector vals; for (int i = 0; i < g->target.vectorWidth; ++i) vals.push_back(v); - return llvm::ConstantVector::get(LLVMTypes::FloatVectorType, vals); + return llvm::ConstantVector::get(vals); } @@ -221,7 +221,7 @@ LLVMFloatVector(const float *fvec) { std::vector vals; for (int i = 0; i < g->target.vectorWidth; ++i) vals.push_back(LLVMFloat(fvec[i])); - return llvm::ConstantVector::get(LLVMTypes::FloatVectorType, vals); + return llvm::ConstantVector::get(vals); } @@ -231,7 +231,7 @@ LLVMDoubleVector(double dval) { std::vector vals; for (int i = 0; i < g->target.vectorWidth; ++i) vals.push_back(v); - return llvm::ConstantVector::get(LLVMTypes::DoubleVectorType, vals); + return llvm::ConstantVector::get(vals); } @@ -240,7 +240,7 @@ LLVMDoubleVector(const double *dvec) { std::vector vals; for (int i = 0; i < g->target.vectorWidth; ++i) vals.push_back(LLVMDouble(dvec[i])); - return llvm::ConstantVector::get(LLVMTypes::DoubleVectorType, vals); + return llvm::ConstantVector::get(vals); } @@ -250,7 +250,7 @@ LLVMInt64Vector(int64_t ival) { std::vector vals; for (int i = 0; i < g->target.vectorWidth; ++i) vals.push_back(v); - return llvm::ConstantVector::get(LLVMTypes::Int64VectorType, vals); + return llvm::ConstantVector::get(vals); } @@ -259,7 +259,7 @@ LLVMInt64Vector(const int64_t *ivec) { std::vector vals; for (int i = 0; i < g->target.vectorWidth; ++i) vals.push_back(LLVMInt64(ivec[i])); - return llvm::ConstantVector::get(LLVMTypes::Int64VectorType, vals); + return llvm::ConstantVector::get(vals); } @@ -269,7 +269,7 @@ LLVMUInt64Vector(uint64_t ival) { std::vector vals; for (int i = 0; i < g->target.vectorWidth; ++i) vals.push_back(v); - return llvm::ConstantVector::get(LLVMTypes::Int64VectorType, vals); + return llvm::ConstantVector::get(vals); } @@ -278,7 +278,7 @@ LLVMUInt64Vector(const uint64_t *ivec) { std::vector vals; for (int i = 0; i < g->target.vectorWidth; ++i) vals.push_back(LLVMUInt64(ivec[i])); - return llvm::ConstantVector::get(LLVMTypes::Int64VectorType, vals); + return llvm::ConstantVector::get(vals); } @@ -297,7 +297,7 @@ LLVMBoolVector(bool b) { std::vector vals; for (int i = 0; i < g->target.vectorWidth; ++i) vals.push_back(v); - return llvm::ConstantVector::get(LLVMTypes::BoolVectorType, vals); + return llvm::ConstantVector::get(vals); } @@ -317,7 +317,7 @@ LLVMBoolVector(const bool *bvec) { vals.push_back(v); } - return llvm::ConstantVector::get(LLVMTypes::BoolVectorType, vals); + return llvm::ConstantVector::get(vals); } From 9b6bf5dabc0d93800443323bd2d21452008bff23 Mon Sep 17 00:00:00 2001 From: Matt Pharr Date: Fri, 24 Jun 2011 16:11:46 -0700 Subject: [PATCH 2/4] Add release notes doc --- docs/ReleaseNotes.txt | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 docs/ReleaseNotes.txt diff --git a/docs/ReleaseNotes.txt b/docs/ReleaseNotes.txt new file mode 100644 index 00000000..2b8abd97 --- /dev/null +++ b/docs/ReleaseNotes.txt @@ -0,0 +1,14 @@ + +=== v1.0.1 === (24 June 2011) + +ispc no longer requires that pointers to memory that are passed in to ispc +have alignment equal to the targets vector width; now alignment just has to +be the regular element alignment (e.g. 4 bytes for floats, etc.) This +change also fixed a number of cases where it previously incorrectly +generated aligned load/store instructions in cases where the address wasn't +actually aligned (even if the base address passed into ispc code was). + + +=== v1.0 === (22 June 2011) + +Initial Release From ff76c2334ee9ab21df413ca6777bf6d8342a3045 Mon Sep 17 00:00:00 2001 From: Matt Pharr Date: Fri, 24 Jun 2011 16:19:51 -0700 Subject: [PATCH 3/4] small doc fix, removed incorrect comment from example --- docs/ispc.txt | 2 +- examples/options/options.cpp | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/docs/ispc.txt b/docs/ispc.txt index 8292f478..60d0b207 100644 --- a/docs/ispc.txt +++ b/docs/ispc.txt @@ -136,7 +136,7 @@ Linux\* and Mac OS\* available for download. Alternatively, you can download the source code from that page and build it yourself; see see the `ispc wiki`_ for instructions about building ``ispc`` from source. -.. _ispc downloads web page:downloads.html +.. _ispc downloads web page: downloads.html .. _ispc wiki: http://github.com/ispc/ispc/wiki Once you have an executable for your system, copy it into a directory diff --git a/examples/options/options.cpp b/examples/options/options.cpp index 86c55dae..5fe48f86 100644 --- a/examples/options/options.cpp +++ b/examples/options/options.cpp @@ -54,8 +54,6 @@ extern void binomial_put_serial(float Sa[], float Xa[], float Ta[], float result[], int count); int main() { - // Pointers passed to ispc code must have alignment of the target's - // vector width at minimum. float *S = new float[N_OPTIONS]; float *X = new float[N_OPTIONS]; float *T = new float[N_OPTIONS]; From b7519d1268c53413e92064f8733f1d8e146e3599 Mon Sep 17 00:00:00 2001 From: Matt Pharr Date: Fri, 24 Jun 2011 16:20:36 -0700 Subject: [PATCH 4/4] fix date in ReleaseNotes.txt --- docs/ReleaseNotes.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/ReleaseNotes.txt b/docs/ReleaseNotes.txt index 2b8abd97..f6b50689 100644 --- a/docs/ReleaseNotes.txt +++ b/docs/ReleaseNotes.txt @@ -9,6 +9,6 @@ generated aligned load/store instructions in cases where the address wasn't actually aligned (even if the base address passed into ispc code was). -=== v1.0 === (22 June 2011) +=== v1.0 === (21 June 2011) Initial Release