Bug 94714

Summary: dEQP ldexp precision tests fail
Product: Mesa Reporter: Kenneth Graunke <kenneth>
Component: Drivers/DRI/i965Assignee: Jason Ekstrand <jason>
Status: RESOLVED FIXED QA Contact: Intel 3D Bugs Mailing List <intel-3d-bugs>
Severity: normal    
Priority: medium CC: jason
Version: git   
Hardware: Other   
OS: All   
i915 platform: i915 features:
Bug Depends on:    
Bug Blocks: 94448    

Description Kenneth Graunke 2016-03-26 09:29:16 UTC
24 of the dEQP-GLES31.functional.shaders.builtin_functions.precision.ldexp.* tests fail, at least on Broadwell.  (These tests also exist in the Vulkan conformance suite.)

It seems that our current lowering breaks for certain values.
Comment 1 Jason Ekstrand 2016-03-26 14:42:45 UTC
Among the patches I posted to the list yesterday is a new lowering for ldexp that I think is better than both the spec stupidity and what we have today.  The spec'd f*2.0^exp is sufficient for deqp but has range problems. What we have today misses some edge cases when denormals get involved.
Comment 2 Kenneth Graunke 2016-04-14 05:57:23 UTC
Fixed in master by Jason:

commit 505a8fbdf8f2b6d2aaab5a04244cd3329f9dbe97
Author: Kenneth Graunke <kenneth@whitecape.org>
Date:   Tue Apr 12 02:30:25 2016 -0700

    i965: Switch to NIR for ldexp lowering.
    The old GLSL IR based lowering doesn't quite work right in all cases,
    and fails several dEQP-GLES31 and Vulkan CTS tests.  Jason's new
    approach in NIR passes all the tests.  There's not likely to be a ton
    of advantage to lowering early in GLSL IR anyway, so...switch.
    Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
    Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
    Reviewed-by: Matt Turner <mattst88@gmail.com>

commit 4455bfa9a0cc53a3c7e3c171b022cbe6d6dcdff8
Author: Jason Ekstrand <jason.ekstrand@intel.com>
Date:   Fri Mar 25 12:12:38 2016 -0700

    nir/algebraic: Add lowering for ldexp
    The algorithm used is different from both the naive suggestion from the
    GLSL spec and the one used in GLSL IR today.  Unfortunately, the GLSL IR
    implementation that we have today doesn't handle denormals (for those that
    care) or the case where the float source is +-inf.
    Reviewed-by: Matt Turner <mattst88@gmail.com>

Thanks Jason and Matt!

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.