diff options
author | Kenneth Graunke <[email protected]> | 2010-10-14 11:40:19 -0700 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2010-10-14 12:40:16 -0700 |
commit | 897f6d3c7d06316b0535971cc2de318157c23692 (patch) | |
tree | edd5d5dc7e7192667e4386ef035e8b8b96b22fdb /src/mesa/drivers/dri/i965/brw_eu.h | |
parent | f541b685aaf404fa7c8142f51d91c2720d82f264 (diff) |
i965: Correctly emit the RNDZ instruction.
Simply using RNDU, RNDZ, or RNDE does not produce the desired result.
Rather, the RND* instructions place a value in the destination register
that may be 1 less than the correct answer. They can also set per-channel
"increment bits" in a flag register, which, if set, mean dest needs to
be incremented by 1. A second instruction - a predicated add -
completes the job.
Notably, RNDD always produces the correct answer in a single
instruction.
Fixes piglit test glsl-fs-trunc.
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_eu.h')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_eu.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_eu.h b/src/mesa/drivers/dri/i965/brw_eu.h index c0deb238c2c..c16613e3df5 100644 --- a/src/mesa/drivers/dri/i965/brw_eu.h +++ b/src/mesa/drivers/dri/i965/brw_eu.h @@ -789,6 +789,10 @@ struct brw_instruction *brw_##OP(struct brw_compile *p, \ struct brw_reg src0, \ struct brw_reg src1); +#define ROUND(OP) \ +void brw_##OP(struct brw_compile *p, struct brw_reg dest, struct brw_reg src0); + + ALU1(MOV) ALU2(SEL) ALU1(NOT) @@ -805,7 +809,6 @@ ALU2(ADD) ALU2(MUL) ALU1(FRC) ALU1(RNDD) -ALU1(RNDZ) ALU2(MAC) ALU2(MACH) ALU1(LZD) @@ -816,9 +819,11 @@ ALU2(DP2) ALU2(LINE) ALU2(PLN) +ROUND(RNDZ) + #undef ALU1 #undef ALU2 - +#undef ROUND /* Helpers for SEND instruction: |