Add SSE4 target optimized for computation with 8-bit datatypes.

This change adds a new 'sse4-8' target, where programCount is 16 and
the mask element size is 8-bits.  (i.e. the most appropriate sizing of
the mask for SIMD computation with 8-bit datatypes.)
This commit is contained in:
Matt Pharr
2013-07-23 17:30:32 -07:00
parent 15a3ef370a
commit 53414f12e6
7 changed files with 578 additions and 7 deletions

View File

@@ -3123,6 +3123,10 @@ static llvm::Value *
lEmitVaryingSelect(FunctionEmitContext *ctx, llvm::Value *test,
llvm::Value *expr1, llvm::Value *expr2,
const Type *type) {
#if !defined(LLVM_3_1)
test = ctx->TruncInst(test, LLVMTypes::Int1VectorType);
return ctx->SelectInst(test, expr1, expr2, "select");
#else
llvm::Value *resultPtr = ctx->AllocaInst(expr1->getType(), "selectexpr_tmp");
// Don't need to worry about masking here
ctx->StoreInst(expr2, resultPtr);
@@ -3131,6 +3135,7 @@ lEmitVaryingSelect(FunctionEmitContext *ctx, llvm::Value *test,
PointerType::GetUniform(type)->LLVMType(g->ctx));
ctx->StoreInst(expr1, resultPtr, test, type, PointerType::GetUniform(type));
return ctx->LoadInst(resultPtr, "selectexpr_final");
#endif // !LLVM_3_1
}