summaryrefslogtreecommitdiffstats
path: root/src/compiler/nir/nir_lower_double_ops.c
Commit message (Collapse)AuthorAgeFilesLines
* nir/lower_double_ops: fixup for new nir_foreach_block()Jason Ekstrand2016-05-051-23/+9
| | | | | | Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Connor Abbott <cwabbott0@gmail.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
* nir/lower_double_ops: lower mod()Samuel Iglesias Gonsálvez2016-05-041-0/+29
| | | | | | | | | | | 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>
* nir/lower_double_ops: fix indentationThomas Hindoe Paaboel Andersen2016-04-301-30/+30
| | | | Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
* nir: Switch the arguments to nir_foreach_functionJason Ekstrand2016-04-281-1/+1
| | | | | | | | | This matches the "foreach x in container" pattern found in many other programming languages. Generated by the following regular expression: s/nir_foreach_function(\([^,]*\),\s*\([^,]*\))/nir_foreach_function(\2, \1)/ Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
* nir: Switch the arguments to nir_foreach_instrJason Ekstrand2016-04-281-1/+1
| | | | | | | | | | | This matches the "foreach x in container" pattern found in many other programming languages. Generated by the following regular expression: s/nir_foreach_instr(\([^,]*\),\s*\([^,]*\))/nir_foreach_instr(\2, \1)/ and similar expressions for nir_foreach_instr_safe etc. Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
* nir/lower_double_ops: lower round_even()Iago Toral Quiroga2016-04-281-0/+58
| | | | | | At least i965 hardware does not have native support for round_even() on doubles. Reviewed-by: Matt Turner <mattst88@gmail.com>
* nir/lower_double_ops: lower fract()Iago Toral Quiroga2016-04-281-0/+14
| | | | | | At least i965 hardware does not have native support for fract() on doubles. Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
* nir/lower_double_ops: lower ceil()Iago Toral Quiroga2016-04-281-0/+23
| | | | | | | | | | At least i965 hardware does not have native support for ceil on doubles. v2 (Sam): - Improve the lowering pass to remove one bcsel (Jason). Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
* nir/lower_double_ops: lower floor()Iago Toral Quiroga2016-04-281-0/+25
| | | | | | | | | | At least i965 hardware does not have native support for floor on doubles. v2 (Sam): - Improve the lowering pass to remove one bcsel (Jason) Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
* nir/lower_double_ops: lower trunc()Iago Toral Quiroga2016-04-281-0/+60
| | | | | | | | | | At least i965 hardware does not have native support for truncating doubles. v2: - Simplified the implementation significantly. - Fixed the else branch, that was not doing what we wanted. Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
* nir: add a pass to lower some double operationsConnor Abbott2016-04-281-0/+384
v2: Move to compiler/nir (Iago) v3: Use nir_imm_int() to load the constants (Sam) v4 (Sam): - Undo line-wrap (Jason). - Fix comment (Jason). - Improve generated code for get_signed_inf() function (Connor). Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>