freedreno/ir3: cp small negative integers too
authorRob Clark <robclark@freedesktop.org>
Sun, 1 May 2016 14:06:57 +0000 (10:06 -0400)
committerRob Clark <robclark@freedesktop.org>
Wed, 4 May 2016 15:25:55 +0000 (11:25 -0400)
Signed-off-by: Rob Clark <robclark@freedesktop.org>
src/gallium/drivers/freedreno/ir3/ir3_cp.c

index 60c2830df93d9ee6633e5da2677e820d13003f47..6e71beed458607973a8e8f0caceef6312e9b8fc2 100644 (file)
@@ -438,7 +438,8 @@ reg_cp(struct ir3_cp_ctx *ctx, struct ir3_instruction *instr,
                                iim_val = ~iim_val;
 
                        /* other than category 1 (mov) we can only encode up to 10 bits: */
-                       if ((instr->opc == OPC_MOV) || !(iim_val & ~0x3ff)) {
+                       if ((instr->opc == OPC_MOV) ||
+                                       !((iim_val & ~0x3ff) && (-iim_val & ~0x3ff))) {
                                new_flags &= ~(IR3_REG_SABS | IR3_REG_SNEG | IR3_REG_BNOT);
                                src_reg = ir3_reg_clone(instr->block->shader, src_reg);
                                src_reg->flags = new_flags;