On Mon Apr 1 22:26:31 2024 +0000, Zebediah Figura wrote:
Personally I think all these sm1-specific lowering passes are not ideal. I would assert that we should just be translating one instruction into multiple instructions when generating the IR. This is simpler than writing HLSL lowering passes, it avoids the need for some basically backend-specific ops like OP3_CMP, and it reduces the amount of backend-specific logic in the core HLSL compiler, or at least moves it closer to the end.
And for things like enum hlsl_base_type, i.e. float vs int/bool, that means we explicitly handle those, probably on a per-instr/per-expr basis, in write_sm1_instructions().