diff --git a/examples/intrinsics/sse4.h b/examples/intrinsics/sse4.h index 30f90b31..44dedf33 100644 --- a/examples/intrinsics/sse4.h +++ b/examples/intrinsics/sse4.h @@ -2532,7 +2532,7 @@ static FORCEINLINE int16_t __reduce_add_int8(__vec4_i8 v) { // TODO: improve int16_t ret = 0; for (int i = 0; i < 4; ++i) - ret += v.v[i]; + ret += __extract_element(v, i); return ret; } @@ -2540,7 +2540,7 @@ static FORCEINLINE int32_t __reduce_add_int16(__vec4_i16 v) { // TODO: improve int32_t ret = 0; for (int i = 0; i < 4; ++i) - ret += v.v[i]; + ret += __extract_element(v, i); return ret; } diff --git a/opt.cpp b/opt.cpp index 522e601b..75eae20c 100644 --- a/opt.cpp +++ b/opt.cpp @@ -4556,7 +4556,7 @@ PeepholePass::PeepholePass() : BasicBlockPass(ID) { } -#ifndef LLVM_3_1 +#if !defined(LLVM_3_1) && !defined(LLVM_3_2) using namespace llvm::PatternMatch; @@ -4877,7 +4877,7 @@ lMatchAvgDownInt16(llvm::Value *inst) { } return NULL; } -#endif // !LLVM_3_1 +#endif // !LLVM_3_1 && !LLVM_3_2 bool PeepholePass::runOnBasicBlock(llvm::BasicBlock &bb) { @@ -4889,7 +4889,7 @@ PeepholePass::runOnBasicBlock(llvm::BasicBlock &bb) { llvm::Instruction *inst = &*iter; llvm::Instruction *builtinCall = NULL; -#ifndef LLVM_3_1 +#if !defined(LLVM_3_1) && !defined(LLVM_3_2) if (!builtinCall) builtinCall = lMatchAvgUpUInt8(inst); if (!builtinCall) @@ -4906,7 +4906,7 @@ PeepholePass::runOnBasicBlock(llvm::BasicBlock &bb) { builtinCall = lMatchAvgDownInt8(inst); if (!builtinCall) builtinCall = lMatchAvgDownInt16(inst); -#endif // LLVM_3_1 +#endif // !LLVM_3_1 && !LLVM_3_2 if (builtinCall != NULL) { llvm::ReplaceInstWithInst(inst, builtinCall); modifiedAny = true;