Skip to content
  • 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.
    
    v2:
     - Consider fp16 rounding conversion opcodes
     - Properly handle swizzles on conversion sources.
    
    v3
     - 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)
    
    v4:
     - 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: default avatarJason Ekstrand <jason@jlekstrand.net>
    3e377c68