diff options
author | Kenneth Graunke <[email protected]> | 2016-05-16 17:28:19 -0700 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2016-05-20 14:28:06 -0700 |
commit | 1539009bf01773c2cf18e436b0373fab300e5b67 (patch) | |
tree | b4f9738fbd5459da952b24267e9b3b6cb4f6f270 /src/mesa | |
parent | b19a0d506d33bff513d07a41b0ba51930464ab8f (diff) |
i965: Fix brw_regs_equal() for NaN and positive/negative zero.
We'd like the comparisons to mean "the exact same bits". Comparing
doubles won't do that for NaN values or positive vs. negative zero.
Signed-off-by: Kenneth Graunke <[email protected]>
Reviewed-by: Matt Turner <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_reg.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_reg.h b/src/mesa/drivers/dri/i965/brw_reg.h index 71e1024428a..b0ef94e96d0 100644 --- a/src/mesa/drivers/dri/i965/brw_reg.h +++ b/src/mesa/drivers/dri/i965/brw_reg.h @@ -260,6 +260,7 @@ struct brw_reg { }; double df; + uint64_t u64; float f; int d; unsigned ud; @@ -270,7 +271,7 @@ static inline bool brw_regs_equal(const struct brw_reg *a, const struct brw_reg *b) { const bool df = a->type == BRW_REGISTER_TYPE_DF && a->file == IMM; - return a->bits == b->bits && (df ? a->df == b->df : a->ud == b->ud); + return a->bits == b->bits && (df ? a->u64 == b->u64 : a->ud == b->ud); } struct brw_indirect { |