fix for redundant U* primitive (signed and unsigned are the same)

This commit is contained in:
Jesse D. McDonald 2020-10-24 14:03:50 -05:00
parent 8dbc2939fc
commit 36e704b6cb
1 changed files with 17 additions and 10 deletions

View File

@ -459,7 +459,7 @@ defcode ABS
0: push %eax 0: push %eax
NEXT NEXT
/* ( n1 n2 -- n1*n2 ) ( ignores overflow ) */ /* ( n1|u1 n2|u2 -- n3|u3 ) Multiply (signed or unsigned) */
defcode MUL,"*" defcode MUL,"*"
pop %eax pop %eax
pop %ebx pop %ebx
@ -467,7 +467,7 @@ defcode MUL,"*"
push %eax push %eax
NEXT NEXT
/* ( n1 n2 -- d ) Multiply, producting a double-cell result */ /* ( n1 n2 -- d ) Multiply signed, producting a double-cell result */
defcode MMUL,"M*" defcode MMUL,"M*"
pop %eax pop %eax
pop %ebx pop %ebx
@ -476,14 +476,6 @@ defcode MMUL,"M*"
push %edx push %edx
NEXT NEXT
/* ( u1 u2 -- u1*u2 ) ( ignores overflow ) */
defcode UMUL,"U*"
pop %eax
pop %ebx
mull %ebx
push %eax
NEXT
/* ( u1 u2 -- ud ) Multiply unsigned, producting a double-cell result */ /* ( u1 u2 -- ud ) Multiply unsigned, producting a double-cell result */
defcode UMMUL,"UM*" defcode UMMUL,"UM*"
pop %eax pop %eax
@ -516,6 +508,21 @@ defcode DSUB,"D-"
sbbl %ebx,(%esp) sbbl %ebx,(%esp)
NEXT NEXT
/* ( d1|ud1 d2|ud2 -- d3|ud3 ) Double-cell multiplication */
defcode DMUL,"D*"
pop %ecx
pop %eax
pop %ebx
pop %edx
imul %edx,%ecx
imul %eax,%ebx
mul %edx
add %ebx,%ecx
add %ecx,%edx
push %eax
push %edx
NEXT
defcode DNEGATE defcode DNEGATE
notl 4(%esp) notl 4(%esp)
notl (%esp) notl (%esp)