diff --git a/buildall.bat b/buildall.bat index 8a5b22b8..0fa084ff 100644 --- a/buildall.bat +++ b/buildall.bat @@ -8,7 +8,6 @@ REM Both the LLVM binaries and python need to be in the path set path=%LLVM_INSTALL_DIR%\bin;%PATH%;c:\cygwin\bin msbuild ispc.vcxproj /V:m /p:Platform=Win32 /p:Configuration=Release -msbuild ispc_test.vcxproj /V:m /p:Platform=Win32 /p:Configuration=Release msbuild examples\examples.sln /V:m /p:Platform=x64 /p:Configuration=Release /t:rebuild msbuild examples\examples.sln /V:m /p:Platform=x64 /p:Configuration=Debug /t:rebuild diff --git a/ispc.cpp b/ispc.cpp index b573cdff..a90a1baf 100644 --- a/ispc.cpp +++ b/ispc.cpp @@ -215,7 +215,7 @@ Target::SupportedTargetArchs() { const char * Target::SupportedTargetISAs() { return "sse2, sse2-x2, sse4, sse4-x2" -#ifndef LLVM_2.9 +#ifndef LLVM_2_9 ", avx, avx-x2" #endif !LLVM_2_9 #ifdef LLVM_3_1svn @@ -313,7 +313,7 @@ Target::SizeOf(LLVM_TYPE_CONST llvm::Type *type) { Assert(td != NULL); uint64_t byteSize = td->getTypeSizeInBits(type) / 8; if (is32Bit || g->opt.force32BitAddressing) - return LLVMInt32(byteSize); + return LLVMInt32((int32_t)byteSize); else return LLVMInt64(byteSize); } @@ -331,7 +331,7 @@ Target::StructOffset(LLVM_TYPE_CONST llvm::Type *type, int element) { uint64_t offset = sl->getElementOffset(element); if (is32Bit || g->opt.force32BitAddressing) - return LLVMInt32(offset); + return LLVMInt32((int32_t)offset); else return LLVMInt64(offset); } diff --git a/lex.ll b/lex.ll index ca5dfc64..f4161c94 100644 --- a/lex.ll +++ b/lex.ll @@ -184,12 +184,12 @@ L?\"(\\.|[^\\"])*\" { lStringConst(yylval, yylloc); return TOKEN_STRING_LITERAL; {FLOAT_NUMBER} { - yylval->floatVal = atof(yytext); + yylval->floatVal = (float)atof(yytext); return TOKEN_FLOAT_CONSTANT; } {HEX_FLOAT_NUMBER} { - yylval->floatVal = lParseHexFloat(yytext); + yylval->floatVal = (float)lParseHexFloat(yytext); return TOKEN_FLOAT_CONSTANT; } diff --git a/main.cpp b/main.cpp index 1ab765c1..0c483c35 100644 --- a/main.cpp +++ b/main.cpp @@ -206,7 +206,7 @@ int main(int Argc, char *Argv[]) { if (atoi(argv[i] + 13) == 64) g->opt.force32BitAddressing = false; else if (atoi(argv[i] + 13) == 32) - g->opt.force32BitAddressing = 32; + g->opt.force32BitAddressing = true; else { fprintf(stderr, "Addressing width \"%s\" invalid--only 32 and " "64 are allowed.\n", argv[i]+13); diff --git a/opt.cpp b/opt.cpp index f83e3766..25c950cb 100644 --- a/opt.cpp +++ b/opt.cpp @@ -1673,7 +1673,8 @@ lCheckMulForLinear(llvm::Value *op0, llvm::Value *op1, int vectorLength, // Check to see if the other operand is a linear vector with stride // given by stride/splatVal. - return lVectorIsLinear(op1, vectorLength, stride / splatVal, seenPhis); + return lVectorIsLinear(op1, vectorLength, (int)(stride / splatVal), + seenPhis); } diff --git a/parse.yy b/parse.yy index 3117365e..2a919d40 100644 --- a/parse.yy +++ b/parse.yy @@ -544,7 +544,7 @@ declaration_specifiers | soa_width_specifier { DeclSpecs *ds = new DeclSpecs; - ds->soaWidth = $1; + ds->soaWidth = (int32_t)$1; $$ = ds; } | soa_width_specifier declaration_specifiers @@ -554,7 +554,7 @@ declaration_specifiers if (ds->soaWidth != 0) Error(@1, "soa<> qualifier supplied multiple times in declaration."); else - ds->soaWidth = $1; + ds->soaWidth = (int32_t)$1; } $$ = ds; } @@ -565,7 +565,7 @@ declaration_specifiers | type_specifier '<' int_constant '>' { DeclSpecs *ds = new DeclSpecs($1); - ds->vectorSize = $3; + ds->vectorSize = (int32_t)$3; $$ = ds; } | type_specifier declaration_specifiers @@ -651,7 +651,7 @@ short_vec_specifier : atomic_var_type_specifier '<' int_constant '>' { Type* vt = - new VectorType($1, $3); + new VectorType($1, (int32_t)$3); $$ = vt; } ; diff --git a/test_static.cpp b/test_static.cpp index ad35ae0e..48a0021f 100644 --- a/test_static.cpp +++ b/test_static.cpp @@ -43,6 +43,7 @@ #include #endif // ISPC_IS_WINDOWS +#include #include #include #include @@ -102,7 +103,7 @@ void *ISPCAlloc(void **handle, int64_t size, int32_t alignment) { int main(int argc, char *argv[]) { int w = width(); - Assert(w <= 16); + assert(w <= 16); float returned_result[16]; for (int i = 0; i < 16; ++i)