@@ -1637,10 +1637,11 @@ SRAI:
16371637
16381638 jump extend_sign_rd always
16391639
1640+ #% set mul_locals = ["$$high_high", "$$high_low", "$$low_high", "$$low_low", "$$rs1_negative", "$$rs2_negative"]
1641+
16401642mul_decomp:
1641- #% set mul_decomp_locals = ["$$high_high", "$$high_low", "$$low_high", "$$low_low"]
16421643#% do reset_locals()
1643- #% do declare_locals(mul_decomp_locals )
1644+ #% do declare_locals(mul_locals )
16441645
16451646 # https://github.com/es-shims/Math.imul/blob/dab2a3bfc9ce5f4af97057c64ae1880fdbac57a5/implementation.js
16461647
@@ -1659,7 +1660,7 @@ mul_decomp:
16591660MUL:
16601661 # R-type: rs1, rs2, rd_id
16611662#% do reset_locals()
1662- #% do declare_locals(mul_decomp_locals )
1663+ #% do declare_locals(mul_locals )
16631664 op add ret @counter 1
16641665 jump mul_decomp always
16651666
@@ -1673,16 +1674,15 @@ MUL:
16731674
16741675MULH:
16751676 # R-type: rs1, rs2, rd_id
1676- #% set mulh_s_u_locals = ["$$rs1_negative", "$$rs2_negative"]
16771677#% do reset_locals()
1678- #% do declare_locals(mul_decomp_locals, mulh_s_u_locals )
1678+ #% do declare_locals(mul_locals )
16791679 op greaterThanEq $$rs1_negative rs1 0x80000000 # check if the sign bit is set
16801680 op greaterThanEq $$rs2_negative rs2 0x80000000
16811681 # continue into mulh_s_u
16821682
16831683mulh_s_u:
16841684#% do reset_locals()
1685- #% do declare_locals(mul_decomp_locals, mulh_s_u_locals )
1685+ #% do declare_locals(mul_locals )
16861686 op add ret @counter 1
16871687 jump mul_decomp always
16881688
@@ -1709,15 +1709,15 @@ mulh_s_u__rs2_positive:
17091709MULHSU:
17101710 # R-type: rs1, rs2, rd_id
17111711#% do reset_locals()
1712- #% do declare_locals(mul_decomp_locals, mulh_s_u_locals )
1712+ #% do declare_locals(mul_locals )
17131713 op greaterThanEq $$rs1_negative rs1 0x80000000
17141714 set $$rs2_negative false
17151715 jump mulh_s_u always
17161716
17171717MULHU:
17181718 # R-type: rs1, rs2, rd_id
17191719#% do reset_locals()
1720- #% do declare_locals(mul_decomp_locals, mulh_s_u_locals )
1720+ #% do declare_locals(mul_locals )
17211721 set $$rs1_negative false
17221722 set $$rs2_negative false
17231723 jump mulh_s_u always
0 commit comments