From 3c18c7a713595222ce12cbb43c8997240a33ec96 Mon Sep 17 00:00:00 2001 From: "james.brodman" Date: Fri, 26 Oct 2012 16:52:54 -0400 Subject: [PATCH 1/3] Fixed compile error: == instead of = --- examples/intrinsics/sse4.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/intrinsics/sse4.h b/examples/intrinsics/sse4.h index e3a4e277..b0365c86 100644 --- a/examples/intrinsics/sse4.h +++ b/examples/intrinsics/sse4.h @@ -274,7 +274,7 @@ static FORCEINLINE bool __any(__vec4_i1 mask) { } static FORCEINLINE bool __all(__vec4_i1 mask) { - return (_mm_movemask_ps(mask.v)=0xF); + return (_mm_movemask_ps(mask.v)==0xF); } static FORCEINLINE bool __none(__vec4_i1 mask) { From e323b1d0ade437388bcbfbce03e012c06a37c6a0 Mon Sep 17 00:00:00 2001 From: jbrodman Date: Fri, 26 Oct 2012 16:52:54 -0400 Subject: [PATCH 2/3] Fixed compile error: == instead of = --- examples/intrinsics/sse4.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/intrinsics/sse4.h b/examples/intrinsics/sse4.h index e3a4e277..b0365c86 100644 --- a/examples/intrinsics/sse4.h +++ b/examples/intrinsics/sse4.h @@ -274,7 +274,7 @@ static FORCEINLINE bool __any(__vec4_i1 mask) { } static FORCEINLINE bool __all(__vec4_i1 mask) { - return (_mm_movemask_ps(mask.v)=0xF); + return (_mm_movemask_ps(mask.v)==0xF); } static FORCEINLINE bool __none(__vec4_i1 mask) { From b80867d473924d130a53201a7bb4d97347517d5c Mon Sep 17 00:00:00 2001 From: Peng Tu Date: Mon, 29 Oct 2012 17:27:11 -0700 Subject: [PATCH 3/3] Move the call to RestoreContinuedLanes from bbBody to the correct place of bbCheckForMore for foreach_unique and foreach_active. --- stmt.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stmt.cpp b/stmt.cpp index b719440a..830754d5 100644 --- a/stmt.cpp +++ b/stmt.cpp @@ -2018,7 +2018,6 @@ ForeachActiveStmt::EmitCode(FunctionEmitContext *ctx) const { } ctx->SetCurrentBasicBlock(bbBody); { - ctx->RestoreContinuedLanes(); ctx->SetBlockEntryMask(ctx->GetFullMask()); // Run the code in the body of the loop. This is easy now. @@ -2030,6 +2029,7 @@ ForeachActiveStmt::EmitCode(FunctionEmitContext *ctx) const { } ctx->SetCurrentBasicBlock(bbCheckForMore); { + ctx->RestoreContinuedLanes(); // At the end of the loop body (either due to running the // statements normally, or a continue statement in the middle of // the loop that jumps to the end, see if there are any lanes left @@ -2233,7 +2233,6 @@ ForeachUniqueStmt::EmitCode(FunctionEmitContext *ctx) const { } ctx->SetCurrentBasicBlock(bbBody); { - ctx->RestoreContinuedLanes(); ctx->SetBlockEntryMask(ctx->GetFullMask()); // Run the code in the body of the loop. This is easy now. if (stmts) @@ -2248,6 +2247,7 @@ ForeachUniqueStmt::EmitCode(FunctionEmitContext *ctx) const { // statements normally, or a continue statement in the middle of // the loop that jumps to the end, see if there are any lanes left // to be processed. + ctx->RestoreContinuedLanes(); llvm::Value *remainingBits = ctx->LoadInst(maskBitsPtr, "remaining_bits"); llvm::Value *nonZero = ctx->CmpInst(llvm::Instruction::ICmp, llvm::CmpInst::ICMP_NE,