Module: Mesa
Branch: master
Commit: f78a7ff6b2ed90896876df7790d4701eb7ba2b8d
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=f78a7ff6b2ed90896876df7790d4701eb7ba2b8d

Author: Matt Turner <matts...@gmail.com>
Date:   Tue Feb 19 12:51:08 2013 -0800

i965/fp: Use the LRP instruction for OPCODE_LRP.

Reviewed-by: Eric Anholt <e...@anholt.net>
Reviewed-by: Kenneth Graunke <kenn...@whitecape.org>

---

 src/mesa/drivers/dri/i965/brw_fs_fp.cpp |   12 ++++--------
 1 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_fs_fp.cpp 
b/src/mesa/drivers/dri/i965/brw_fs_fp.cpp
index 5f5f6a9..50e63da 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_fp.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_fp.cpp
@@ -316,14 +316,10 @@ fs_visitor::emit_fragment_program_code()
       case OPCODE_LRP:
          for (int i = 0; i < 4; i++) {
             if (fpi->DstReg.WriteMask & (1 << i)) {
-               fs_reg neg_src0 = regoffset(src[0], i);
-               neg_src0.negate = !neg_src0.negate;
-               fs_reg temp = fs_reg(this, glsl_type::float_type);
-               fs_reg temp2 = fs_reg(this, glsl_type::float_type);
-               emit(ADD(temp, neg_src0, fs_reg(1.0f)));
-               emit(MUL(temp, temp, regoffset(src[2], i)));
-               emit(MUL(temp2, regoffset(src[0], i), regoffset(src[1], i)));
-               emit(ADD(regoffset(dst, i), temp, temp2));
+               fs_reg a = regoffset(src[0], i);
+               fs_reg y = regoffset(src[1], i);
+               fs_reg x = regoffset(src[2], i);
+               emit_lrp(regoffset(dst, i), x, y, a);
             }
          }
          break;

_______________________________________________
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to