r300: vs predicate logic fails in vs-loop-complex-unroll-with-else-break.shader_test
When the loop unrolling is disabled and copy propagation is disabled to evade #6467 (closed) we fail the test, most likely we get the predicate logic wrong somewhere (that is pretty much the only thing we can mess up in the backend, as nothing really happens otherwise in the backed passes):
./bin/shader_runner tests/spec/glsl-1.10/execution/vs-loop-complex-unroll-with-else-break.shader_test -auto -fbo
Probe color at (0,0)
Expected: 255 0 0 255
Observed: 255 255 255 255
Test failure on line 55
Probe color at (0,0)
Expected: 255 0 0 255
Observed: 255 255 255 255
Test failure on line 59
Probe color at (0,0)
Expected: 0 255 0 255
Observed: 255 255 255 255
Test failure on line 63
Probe color at (0,0)
Expected: 0 255 0 255
Observed: 255 255 255 255
Test failure on line 67
PIGLIT: {"result": "fail" }
CONST[1] = { 0.0000 1.0000 2.0000 0.0000 }
Vertex Program: after 'dead constants'
# Radeon Compiler Program
0: MOV temp[0].x, none.0___;
1: MOV temp[1], none.0001;
2: MOV temp[2], none.1111;
3: BGNLOOP;
4: SGE temp[3].x, temp[0].x___, const[0].x___;
5: IF temp[3].x___;
6: BRK;
7: ENDIF;
8: SLT temp[3].xy, const[1].1z__, temp[0].xx__;
9: MOV temp[4].x, temp[3].y___;
10: MOV temp[3].x, temp[3].x___;
11: IF temp[3].x___;
12: MOV temp[2], none.1001;
13: BRK;
14: ENDIF;
15: IF temp[4].x___;
16: MOV temp[2], none.0101;
17: BRK;
18: ENDIF;
19: SGE temp[3].x, temp[0].x___, const[1].z___;
20: MAD temp[5], -temp[3].xxxx, temp[1], temp[1];
21: MAD temp[1], temp[3].xxxx, none.0101, temp[5];
22: ADD temp[0].x, temp[0].x___, none.1___;
23: MOV temp[2], none.0101;
24: ENDLOOP;
25: ADD_SAT temp[0], temp[2], temp[1];
26: MOV output[0], input[0];
27: MOV output[1], temp[0];
Vertex Program: after 'lower control flow opcodes'
# Radeon Compiler Program
0: MOV temp[0].x, none.0___;
1: MOV temp[1], none.0001;
2: MOV temp[2], none.1111;
3: ME_PRED_SEQ temp[6].w, none.0000;
4: BGNLOOP;
5: SGE temp[3].x, temp[0].x___, const[0].x___; PRED_SET
6: ME_PRED_SEQ temp[6].w, temp[3].x___; PRED_SET
7: RCP temp[6].w, none.0000; PRED_INV
8: SLT temp[3].xy, const[1].1z__, temp[0].xx__; PRED_SET
9: MOV temp[4].x, temp[3].y___; PRED_SET
10: MOV temp[3].x, temp[3].x___; PRED_SET
11: VE_PRED_SNEQ_PUSH temp[6].w, temp[6].___w, temp[3].___x;
12: MOV temp[2], none.1001; PRED_SET
13: RCP temp[6].w, none.0000; PRED_INV
14: ME_PRED_SET_POP temp[6].w, temp[6].___w;
15: VE_PRED_SNEQ_PUSH temp[6].w, temp[6].___w, temp[4].___x;
16: MOV temp[2], none.0101; PRED_SET
17: RCP temp[6].w, none.0000; PRED_INV
18: ME_PRED_SET_POP temp[6].w, temp[6].___w;
19: SGE temp[3].x, temp[0].x___, const[1].z___; PRED_SET
20: MAD temp[5], -temp[3].xxxx, temp[1], temp[1]; PRED_SET
21: MAD temp[1], temp[3].xxxx, none.0101, temp[5]; PRED_SET
22: ADD temp[0].x, temp[0].x___, none.1___; PRED_SET
23: MOV temp[2], none.0101; PRED_SET
24: ENDLOOP;
25: ADD_SAT temp[0], temp[2], temp[1];
26: MOV output[0], input[0];
27: MOV output[1], temp[0];
I was staring at it for some time already and still can't figure out what is going wrong. @gawin can you spot something?
Edited by Pavel Ondračka