i965/fs: Rewrite fsign64 to skip the float -> double conversion
authorMatt Turner <mattst88@gmail.com>
Fri, 29 Sep 2017 03:59:49 +0000 (20:59 -0700)
committerMatt Turner <mattst88@gmail.com>
Wed, 4 Oct 2017 21:08:54 +0000 (14:08 -0700)
commit7e88f934697fd4ce05093c077b5f11454e377ed0
tree42ebb0420d905cf3df1501645708e62da44eaa10
parentb541945c2027990ac571184bbf8e01285be0e33a
i965/fs: Rewrite fsign64 to skip the float -> double conversion

... without the float -> double conversion. Low power parts have
additional restrictions when it comes to operating on 64-bit types, and
the instruction used to do the conversion violates one of them:
specifically, the restriction that "Source and Destination horizontal
stride must be aligned to the same qword".

Previously we generated a float and then converted, but we can avoid the
conversion by using the same extract-the-sign-bit + or-in-1.0 algorithm
by directly operating on the high four bytes of each double-precision
component in the result.

In SIMD8 and SIMD16 this cuts one instruction from the implementation,
and more importantly that instruction is the one which violated the
regioning restriction.

Along the way I removed some comments that I did not think helped, and
some code about double comparisons which does not seem to be necessary
today.

This prevents validation failures caught by the new EU validation code
added in later patches.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
src/intel/compiler/brw_fs_nir.cpp