On Wed Jul 26 21:30:25 2023 +0000, Zebediah Figura wrote:
Is there an advantage to keeping separate TERNARY and MOVC ops? Can
we just emit TERNARY directly for sm4?
I was thinking turning it to movc/cmp/slt/sge conditionally, and those
have different meaning for condition argument. I don't think I understand. Currently we have OP3_TERNARY which evaluates whether its argument is nonzero, and OP3_MOVC which requires a bool. We could certainly introduce OP3_CMP which is the result of "raising" a sequence like OP2_GEQUAL + OP3_TERNARY, but I don't see why we need OP3_MOVC?
OP3_TERNARY does not evaluate anything. MOVC does not require a bool, a comparison is added for floats, but everything else like bool/uint/int is passed directly as 'movc' argument. CMP is using >= 0.0 condition.