DUALNUM: Improve/fix edge cases of unary minus.

Thanks to Sergey Kaplun. #1422 #1418
This commit is contained in:
Mike Pall
2026-01-09 18:46:32 +01:00
parent 3015b6187e
commit 707c12bf00
8 changed files with 33 additions and 7 deletions

View File

@@ -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