i965/vec4: split VEC4_OPCODE_FROM_DOUBLE into one opcode per destination's type

This way we can set the destination type as double to all these new opcodes,
avoiding any optimizer's confusion that was happening before.

Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
[ Francisco Jerez: Drop no_spill workaround originally needed due to
  the bogus destination type of VEC4_OPCODE_FROM_DOUBLE. ]
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
This commit is contained in:
Samuel Iglesias Gonsálvez
2017-03-24 08:46:13 +01:00
committed by Francisco Jerez
parent 50a5217637
commit 6e3265eae5
7 changed files with 60 additions and 27 deletions

View File

@@ -1940,9 +1940,28 @@ generate_code(struct brw_codegen *p,
break;
}
case VEC4_OPCODE_FROM_DOUBLE: {
case VEC4_OPCODE_DOUBLE_TO_F32:
case VEC4_OPCODE_DOUBLE_TO_D32:
case VEC4_OPCODE_DOUBLE_TO_U32: {
assert(type_sz(src[0].type) == 8);
assert(type_sz(dst.type) == 4);
assert(type_sz(dst.type) == 8);
brw_reg_type dst_type;
switch (inst->opcode) {
case VEC4_OPCODE_DOUBLE_TO_F32:
dst_type = BRW_REGISTER_TYPE_F;
break;
case VEC4_OPCODE_DOUBLE_TO_D32:
dst_type = BRW_REGISTER_TYPE_D;
break;
case VEC4_OPCODE_DOUBLE_TO_U32:
dst_type = BRW_REGISTER_TYPE_UD;
break;
default:
unreachable("Not supported conversion");
}
dst = retype(dst, dst_type);
brw_set_default_access_mode(p, BRW_ALIGN_1);