Skip to content
Snippets Groups Projects
Commit 5fb386c4 authored by Ian Romanick's avatar Ian Romanick Committed by Dylan Baker
Browse files

Revert "nir/algebraic: Convert some f2u to f2i"

Per mesa/mesa#5178 (comment 1019666)

,
the assumption fundamental to this optimization is false.  Section
2.4.1 (Float to Integer) of Ivy Bridge PRMs describes the situation.
The wording of the section is somewhat confusing (because it doesn't
clearly delineate between signed and unsigned integers), but the last
two rows of the table make it clear that F->UD conversion clamps
negative float values to 0.

All other hardware mentioned in that thread seems to behave the same
way.

The real problem is that, with hardware that behaves in this ways,
converting f2u(2147483648.0) to f2i(2147483648.0) changes the bit pattern
that would be produced from 0x80000000 to 0x7fffffff.

This reverts commit ad059202.

Reviewed-by: default avatarJason Ekstrand <jason@jlekstrand.net>
Part-of: <mesa/mesa!12297>
(cherry picked from commit 84d2e537)
parent 6d2727b2
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment