tgsi: infer that dst[1] of DFRACEXP is an integer

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
This commit is contained in:
Nicolai Hähnle 2017-09-15 18:47:52 +02:00
parent 5cf279bf7e
commit 2b0bfc51de
5 changed files with 9 additions and 6 deletions

View File

@ -201,7 +201,7 @@ void lp_build_fetch_args(
static int get_src_chan_idx(unsigned opcode,
int dst_chan_index)
{
enum tgsi_opcode_type dtype = tgsi_opcode_infer_dst_type(opcode);
enum tgsi_opcode_type dtype = tgsi_opcode_infer_dst_type(opcode, 0);
enum tgsi_opcode_type stype = tgsi_opcode_infer_src_type(opcode, 0);
if (!tgsi_type_is_64bit(dtype) && !tgsi_type_is_64bit(stype))

View File

@ -1751,7 +1751,7 @@ emit_store_chan(
struct lp_build_context *float_bld = &bld_base->base;
struct lp_build_context *int_bld = &bld_base->int_bld;
LLVMValueRef indirect_index = NULL;
enum tgsi_opcode_type dtype = tgsi_opcode_infer_dst_type(inst->Instruction.Opcode);
enum tgsi_opcode_type dtype = tgsi_opcode_infer_dst_type(inst->Instruction.Opcode, index);
/*
* Apply saturation.
@ -1917,7 +1917,7 @@ emit_store(
LLVMValueRef dst[4])
{
enum tgsi_opcode_type dtype = tgsi_opcode_infer_dst_type(inst->Instruction.Opcode);
enum tgsi_opcode_type dtype = tgsi_opcode_infer_dst_type(inst->Instruction.Opcode, index);
unsigned writemask = inst->Dst[index].Register.WriteMask;
while (writemask) {

View File

@ -312,7 +312,10 @@ tgsi_opcode_infer_src_type(uint opcode, uint src_idx)
* infer the destination type of a TGSI opcode.
*/
enum tgsi_opcode_type
tgsi_opcode_infer_dst_type( uint opcode )
tgsi_opcode_infer_dst_type( uint opcode, uint dst_idx )
{
if (dst_idx == 1 && opcode == TGSI_OPCODE_DFRACEXP)
return TGSI_TYPE_SIGNED;
return tgsi_opcode_infer_type(opcode);
}

View File

@ -114,7 +114,7 @@ enum tgsi_opcode_type
tgsi_opcode_infer_src_type( uint opcode, uint src_idx );
enum tgsi_opcode_type
tgsi_opcode_infer_dst_type( uint opcode );
tgsi_opcode_infer_dst_type( uint opcode, uint dst_idx );
#if defined __cplusplus
}

View File

@ -890,7 +890,7 @@ void si_llvm_emit_store(struct lp_build_tgsi_context *bld_base,
LLVMBuilderRef builder = ctx->gallivm.builder;
LLVMValueRef temp_ptr, temp_ptr2 = NULL;
bool is_vec_store = false;
enum tgsi_opcode_type dtype = tgsi_opcode_infer_dst_type(inst->Instruction.Opcode);
enum tgsi_opcode_type dtype = tgsi_opcode_infer_dst_type(inst->Instruction.Opcode, index);
if (dst[0]) {
LLVMTypeKind k = LLVMGetTypeKind(LLVMTypeOf(dst[0]));