freedreno/a5xx: fix negative branches
authorRob Clark <robdclark@gmail.com>
Wed, 30 Nov 2016 21:43:42 +0000 (16:43 -0500)
committerRob Clark <robdclark@gmail.com>
Wed, 30 Nov 2016 22:32:54 +0000 (17:32 -0500)
Looks like immed branch offset size increased again.. making what we
think is a small negative number look to hw like a huge positive number.
And things go badly when shader tries to jump to hyperspace.

Signed-off-by: Rob Clark <robdclark@gmail.com>
src/gallium/drivers/freedreno/ir3/instr-a3xx.h
src/gallium/drivers/freedreno/ir3/ir3.c

index 87083fd1e81582721cb730a4f75d55ecb6c695ff..0d369b605f718822605807516373ac0ec569f005 100644 (file)
@@ -296,6 +296,9 @@ typedef struct PACKED {
                        int32_t  immed    : 20;
                        uint32_t dummy1   : 12;
                } a4xx;
+               struct PACKED {
+                       uint32_t immed    : 32;
+               } a5xx;
        };
 
        /* dword1: */
index c0a39d70def7e24a68a5fdbd81f4e3da9cb79ba4..7c925ee7cb07017cec470b9c97a60494fdd824a0 100644 (file)
@@ -129,7 +129,9 @@ static int emit_cat0(struct ir3_instruction *instr, void *ptr,
 {
        instr_cat0_t *cat0 = ptr;
 
-       if (info->gpu_id >= 400) {
+       if (info->gpu_id >= 500) {
+               cat0->a5xx.immed = instr->cat0.immed;
+       } else if (info->gpu_id >= 400) {
                cat0->a4xx.immed = instr->cat0.immed;
        } else {
                cat0->a3xx.immed = instr->cat0.immed;