gm107/ir/lib: fix sched in div u32 builtin
authorKarol Herbst <kherbst@redhat.com>
Sun, 22 Apr 2018 20:23:13 +0000 (22:23 +0200)
committerKarol Herbst <kherbst@redhat.com>
Tue, 24 Apr 2018 20:31:59 +0000 (22:31 +0200)
Imad needs to set a read barrier.

With significant big work groups I was getting wrong results for div u32. Turns
out the issue was with the sched opcodes.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
src/gallium/drivers/nouveau/codegen/lib/gm107.asm
src/gallium/drivers/nouveau/codegen/lib/gm107.asm.h

index 90741b6c59fa8b58a956575162da12ddac3ef23f..7ee5f8fc65bfcf595148a40e83915e629d224b31 100644 (file)
@@ -27,11 +27,11 @@ gm107_div_u32:
    imul u32 u32 $r3 $r1 $r2
    imad u32 u32 hi $r2 $r2 $r3 $r2
    imul u32 u32 $r3 $r1 $r2
-   sched (st 0x6 wr 0x0 wt 0x1) (st 0x6 wr 0x0 wt 0x1) (st 0x6 wr 0x0 wt 0x1)
+   sched (st 0x6 wr 0x0 wt 0x1) (st 0x6 wr 0x0 wt 0x1) (st 0x6 wr 0x0 rd 0x1 wt 0x1)
    imad u32 u32 hi $r2 $r2 $r3 $r2
    imul u32 u32 $r3 $r1 $r2
    imad u32 u32 hi $r2 $r2 $r3 $r2
-   sched (st 0x6) (st 0x6 wr 0x0 rd 0x1 wt 0x1) (st 0xf wr 0x0 rd 0x1 wt 0x2)
+   sched (st 0x6 wt 0x2) (st 0x6 wr 0x0 rd 0x1 wt 0x1) (st 0xf wr 0x0 rd 0x1 wt 0x2)
    mov $r3 $r0 0xf
    imul u32 u32 hi $r0 $r0 $r2
    i2i u32 u32 $r2 neg $r1
index 8708a94b0a63268fa05eb89727d1ce407ad97e68..65c93f7ae89f255510c32af2f9844503143715de 100644 (file)
@@ -16,11 +16,11 @@ uint64_t gm107_builtin_code[] = {
        0x5c38000000270103,
        0x5a40010000370202,
        0x5c38000000270103,
-       0x003c1801e0c00f06,
+       0x00241801e0c00f06,
        0x5a40010000370202,
        0x5c38000000270103,
        0x5a40010000370202,
-       0x00443c0120c007e6,
+       0x00443c0120c017e6,
        0x5c98078000070003,
        0x5c38008000270000,
        0x5ce0200000170a02,