[Bug 77544] New: i965: Try to use LINE instructions to perform MAD with immediate arguments

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Wed Apr 16 13:47:34 PDT 2014


https://bugs.freedesktop.org/show_bug.cgi?id=77544

          Priority: medium
            Bug ID: 77544
          Assignee: mattst88 at gmail.com
           Summary: i965: Try to use LINE instructions to perform MAD with
                    immediate arguments
        QA Contact: intel-3d-bugs at lists.freedesktop.org
          Severity: enhancement
    Classification: Unclassified
                OS: All
          Reporter: mattst88 at gmail.com
          Hardware: Other
            Status: NEW
           Version: unspecified
         Component: Drivers/DRI/i965
           Product: Mesa

The LINE instruction performs a multiply-add instruction (a * b + c) where b
and c are immediate arguments. It reads b and c from offsets in src0 such that
you can load them (it they're representable) as a Vector-Float immediate.

I have a work-in-progress branch that implements this, and enables it on Gen 4
and 5.

http://cgit.freedesktop.org/~mattst88/mesa/log/?h=line

The shader-db results are promising once we allow MOV dst, VF to be CSE'd:

<Piles of shaders helped>

HURT:   shaders/gst-gl-text-download-yuy2-uyvy.frag fs8:  58 -> 59 (1.72%)
HURT:   shaders/unigine-tropics/465.shader_test fs8:      699 -> 1304 (86.55%)

LOST:   shaders/unigine-tropics/465.shader_test fs16

total instructions in shared programs: 806295 -> 803540 (-0.34%)
instructions in affected programs:     370163 -> 367408 (-0.74%)
GAINED:                                0
LOST:                                  1

Some investigation needs to happen to determine what in the world is going on
in 465.shader_test.

Follow on work:
 - We should also implement this for the vec4 backend.

 - Consider whether using mov(1) to load floats that aren't representable as VF
for LINE consumption is an improvement over not using LINE if the floats aren't
representable as VF. (Probably so?)

 - Consider whether this optimization is beneficial on newer platforms:

SNB doesn't co-issue (so MAD isn't faster than LINE) but perhaps the MOV
immediates can be reused more easily for other instructions?

Seems unlikely that IVB+ (that can co-issue) would benefit from preferring 
LINE (that can't be co-issued) over MAD (that can be co-issued).

Talk to Matt if you want to work on this.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/intel-3d-bugs/attachments/20140416/41b0f576/attachment.html>


More information about the intel-3d-bugs mailing list