Skip to content

nir, spirv: Implement NoSignedWrap and NoUnsignedWrap decorations

Caio Oliveira requested to merge cmarcelo/mesa:r/spirv-wrap into master

Add support to annotate that certain ALU instructions will not overflow/underflow. These decorations are from http://htmlpreview.github.io/?https://github.com/KhronosGroup/SPIRV-Registry/blob/master/extensions/KHR/SPV_KHR_no_integer_wrap_decoration.html, and were now incorporated to SPIR-V 1.4.

First patch adds no_signed_wrap and no_unsigned_wrap flags to nir_alu_instr, second patch reads the SPIR-V decorations to fill the new flags.

Third patch is optional, shows one potential use of the flag.

Edited by Caio Oliveira

Merge request reports