From 707c12bf00dafdfd3899b1a6c36435dbbf6c7022 Mon Sep 17 00:00:00 2001 From: Mike Pall Date: Fri, 9 Jan 2026 18:46:32 +0100 Subject: DUALNUM: Improve/fix edge cases of unary minus. Thanks to Sergey Kaplun. #1422 #1418 --- src/vm_mips64.dasc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/vm_mips64.dasc') diff --git a/src/vm_mips64.dasc b/src/vm_mips64.dasc index 8365da8e..310269ce 100644 --- a/src/vm_mips64.dasc +++ b/src/vm_mips64.dasc @@ -3804,7 +3804,8 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop) | sextw CARG1, CARG1 | beq CARG1, TMP1, ->vmeta_unm // Meta handler deals with -2^31. |. negu CARG1, CARG1 - | zextw CARG1, CARG1 + | beqz CARG1, >3 + |. zextw CARG1, CARG1 | settp CARG1, TISNUM |1: | ins_next1 @@ -3816,6 +3817,9 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop) |. dsll TMP1, TMP1, 32 | b <1 |. xor CARG1, CARG1, TMP1 + |3: + | b <1 + |. dsll CARG1, TMP1, 32 break; case BC_LEN: | // RA = dst*8, RD = src*8 -- cgit v1.2.3-55-g6feb