[Mesa-dev] [PATCH] i965: Use SIMD16 math on Ivybridge.

Kenneth Graunke kenneth at whitecape.org
Mon Sep 26 16:51:34 PDT 2011


Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
---
 src/mesa/drivers/dri/i965/brw_fs_emit.cpp |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_fs_emit.cpp b/src/mesa/drivers/dri/i965/brw_fs_emit.cpp
index 8176a76..b35d558 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_emit.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_emit.cpp
@@ -151,7 +151,10 @@ fs_visitor::generate_math1_gen6(fs_inst *inst,
 
    assert(inst->mlen == 0);
 
-   brw_set_compression_control(p, BRW_COMPRESSION_NONE);
+   bool force_simd8 = intel->gen < 7 || dst.type != BRW_REGISTER_TYPE_F;
+
+   if (force_simd8)
+      brw_set_compression_control(p, BRW_COMPRESSION_NONE);
    brw_math(p, dst,
 	    op,
 	    inst->saturate ? BRW_MATH_SATURATE_SATURATE :
@@ -160,7 +163,7 @@ fs_visitor::generate_math1_gen6(fs_inst *inst,
 	    BRW_MATH_DATA_VECTOR,
 	    BRW_MATH_PRECISION_FULL);
 
-   if (c->dispatch_width == 16) {
+   if (c->dispatch_width == 16 && force_simd8) {
       brw_set_compression_control(p, BRW_COMPRESSION_2NDHALF);
       brw_math(p, sechalf(dst),
 	       op,
@@ -183,10 +186,13 @@ fs_visitor::generate_math2_gen6(fs_inst *inst,
 
    assert(inst->mlen == 0);
 
-   brw_set_compression_control(p, BRW_COMPRESSION_NONE);
+   bool force_simd8 = intel->gen < 7 || dst.type != BRW_REGISTER_TYPE_F;
+
+   if (force_simd8)
+      brw_set_compression_control(p, BRW_COMPRESSION_NONE);
    brw_math2(p, dst, op, src0, src1);
 
-   if (c->dispatch_width == 16) {
+   if (c->dispatch_width == 16 && force_simd8) {
       brw_set_compression_control(p, BRW_COMPRESSION_2NDHALF);
       brw_math2(p, sechalf(dst), op, sechalf(src0), sechalf(src1));
       brw_set_compression_control(p, BRW_COMPRESSION_COMPRESSED);
-- 
1.7.6.1



More information about the mesa-dev mailing list