mirror of
https://github.com/MacosPorters/betterxen.git
synced 2026-11-26 22:50:44 +00:00
#185 left both forms unsupported because the pinned XML says only "carry-out" for them. The AMD RDNA 2 ISA reference guide (GPUOpen, section 12.1 SOP2 Instructions, p. 101-102, and section 5.3 Scalar Condition Code, p. 33) defines SCC for both as signed overflow: add overflows when the operands share a sign that the result lacks; subtract when the operands' signs differ and the result's sign differs from S0's. The guide also confirms the unsigned rules used in #185. Adds both forms to the generated opcodes, the decoder, the reference (exact signed result must fit in i32), the independent interpreter (the guide's sign-bit rule over its ripple adder) and the translator, plus 400 boundary programs, eight hand-worked overflow and no-overflow cases (-1 + 1 and 0 - 1 carry or borrow but do not overflow) and two signed overflows in the scalar ALU fixture. Inverting the overflow rule in any one implementation fails three tests. s_min_i32 and the other SOP2 forms stay unsupported. Refs #185 Signed-off-by: elforeign <324243036+elforeign@users.noreply.github.com>