diff options
author | Ilia Mirkin <[email protected]> | 2014-05-14 23:30:16 -0400 |
---|---|---|
committer | Ilia Mirkin <[email protected]> | 2014-05-21 09:31:16 -0400 |
commit | d3a5cf052c38087b395871b5b46776e2a7d4a7d7 (patch) | |
tree | a2b8dcbbb0b539ec786c980fffd4db19bfef4ffb /bin | |
parent | 1472584397f7b5ef70dfdffda0aab4a0a38a4db0 (diff) |
nv50/ir: fix s32 x s32 -> high s32 multiply logic
Retrieving the high 32 bits of a signed multiply is rather annoying. It
appears that the simplest way to do this is to compute the absolute
value of the arguments, and perform a u32 x u32 -> u64 operation. If the
arguments' signs differ, then negate the result. Since there is no u64
support in the cvt instruction, we have the perform the 2's complement
negation "by hand".
This logic can come into use by the IMUL_HI instruction (very unlikely
to be seen), as well as from constant folding of division by a constant.
Fixes dolphin's divisions by 255.
Signed-off-by: Ilia Mirkin <[email protected]>
Cc: "10.1 10.2" <[email protected]>
Reviewed-by: Ben Skeggs <[email protected]>
Diffstat (limited to 'bin')
0 files changed, 0 insertions, 0 deletions