Skip to content

nir: Extend nir_lower_int64() to support i2f/f2i lowering

Boris Brezillon requested to merge bbrezillon/mesa:lower-int64-i2f-f2i into master

Some hardware don't support the ftoi64/i64tof conversion ops. This patch extends nir_lower_int64() to lower those instructions.

v2:

  • Control i2f/f2i lowering using the nir_lower_mov64 flag (as done for the other conversion/cast ops)
  • Use INT64_MAX instead of open-coding it
  • Lower ufind_msb directly when the nir_lower_ufind_msb64` flag is set to avoid an extra nir_lower_int64() step.
    • This forced me to patch nir_lower_int64() callers that are not initializing nir_options.lower_int64_options properly
    • And I also got rid of the options arg passed to nir_lower_int64() so new users are not tempted to leave nir_options.lower_int64_options unassigned.
  • Re-order nir_lower_doubles()/nir_lower_int64() calls to prioritize the NIR i2f/f2i implementations

Note: this patch has been extracted from kusma/mesa!148 (merged).

/cc @jekstrand @jenatali @karolherbst @daniels @kusma /cc @robclark (for the ir3_compiler changes)

Edited by Boris Brezillon

Merge request reports