• Iago Toral Quiroga's avatar
    intel/compiler: add a NIR pass to lower conversions · 3e377c68
    Iago Toral Quiroga authored
    Some conversions are not directly supported in hardware and need to be
    split in two conversion instructions going through an intermediary type.
    Doing this at the NIR level simplifies a bit the complexity in the backend.
     - Consider fp16 rounding conversion opcodes
     - Properly handle swizzles on conversion sources.
     - Run the pass earlier, right after nir_opt_algebraic_late (Jason)
     - NIR alu output types already have the bit-size (Jason)
     - Use 'is_conversion' to identify conversion operations (Jason)
     - Be careful about the intermediate types we use so we don't lose
       range and avoid incorrect rounding semantics (Jason)
    Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com> (v1)
    Reviewed-by: 's avatarJason Ekstrand <jason@jlekstrand.net>