diff options
author | Hyunjun Ko <[email protected]> | 2019-04-15 03:42:23 +0000 |
---|---|---|
committer | Rob Clark <[email protected]> | 2019-06-03 12:44:03 -0700 |
commit | a9b556d3a041a817fc02c94e705fb865ffde86aa (patch) | |
tree | 7bcad53603e6c65fcd2a103450a6bd7d53f55c69 /src/freedreno | |
parent | 6fb8ef3da6cfaad2040f694f8cfde4f7c9ad6a38 (diff) |
freedreno/ir3: check the type of regs of absneg opcode in is_same_type_mov.
If the type of dest reg and src reg of absneg opcode are different,
it shouldn't be considered as same type mov.
This patch becomes meaningful when we start to use mediump information for
doing precision lowering to 16bit.
Signed-off-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/freedreno')
-rw-r--r-- | src/freedreno/ir3/ir3.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/freedreno/ir3/ir3.h b/src/freedreno/ir3/ir3.h index 161e78e0feb..05245cd54bb 100644 --- a/src/freedreno/ir3/ir3.h +++ b/src/freedreno/ir3/ir3.h @@ -614,6 +614,18 @@ static inline bool is_nop(struct ir3_instruction *instr) return instr->opc == OPC_NOP; } +static inline bool is_same_type_reg(struct ir3_register *reg1, + struct ir3_register *reg2) +{ + unsigned type_reg1 = (reg1->flags & (IR3_REG_HIGH | IR3_REG_HALF)); + unsigned type_reg2 = (reg1->flags & (IR3_REG_HIGH | IR3_REG_HALF)); + + if (type_reg1 ^ type_reg2) + return false; + else + return true; +} + /* Is it a non-transformative (ie. not type changing) mov? This can * also include absneg.s/absneg.f, which for the most part can be * treated as a mov (single src argument). @@ -631,6 +643,10 @@ static inline bool is_same_type_mov(struct ir3_instruction *instr) case OPC_ABSNEG_S: if (instr->flags & IR3_INSTR_SAT) return false; + /* If the type of dest reg and src reg are different, + * it shouldn't be considered as same type mov */ + if (!is_same_type_reg(instr->regs[0], instr->regs[1])) + return false; break; default: return false; |