nir/lower_double_ops: lower mod()
authorSamuel Iglesias Gonsálvez <siglesias@igalia.com>
Tue, 12 Apr 2016 08:55:44 +0000 (10:55 +0200)
committerSamuel Iglesias Gonsálvez <siglesias@igalia.com>
Wed, 4 May 2016 06:07:49 +0000 (08:07 +0200)
commitb902377a56b802d4fca95fb3733f47e466dfe501
tree14be5478a492dc448bfe8e4dd7640c4d1e568f92
parent9f81434c5f593bd50a9069c5e845a5730ed501db
nir/lower_double_ops: lower mod()

There are rounding errors with the division in i965 that affect
the mod(x,y) result when x = N * y. Instead of returning '0' it
was returning 'y'.

This lowering pass fixes those cases.

Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
src/compiler/nir/nir.h
src/compiler/nir/nir_lower_double_ops.c