fix for incorrect double-cell shift by 32 or more bits
This commit is contained in:
parent
ffb555c42f
commit
c076939fe2
37
jumpforth.S
37
jumpforth.S
|
|
@ -630,30 +630,67 @@ defcode DUTWODIV,"DU2/"
|
|||
/* ( x1 u -- x2 ) Shift left by u bits */
|
||||
defcode LSHIFT
|
||||
pop %ecx
|
||||
cmp $32,%ecx
|
||||
jae 1f
|
||||
shll %cl,(%esp)
|
||||
NEXT
|
||||
1: movl $0,(%esp)
|
||||
NEXT
|
||||
|
||||
/* ( u1 u -- u2 ) Logical (unsigned) shift right by u bits */
|
||||
defcode RSHIFT
|
||||
pop %ecx
|
||||
cmp $32,%ecx
|
||||
jae 1f
|
||||
shrl %cl,(%esp)
|
||||
NEXT
|
||||
1: movl $0,(%esp)
|
||||
NEXT
|
||||
|
||||
/* ( xd1 u -- xd2 ) Shift left by u bits */
|
||||
defcode DLSHIFT
|
||||
pop %ecx
|
||||
cmp $32,%ecx
|
||||
jae 1f
|
||||
movl 4(%esp),%eax
|
||||
shldl %cl,%eax,(%esp)
|
||||
shll %cl,4(%esp)
|
||||
NEXT
|
||||
1: pop %ebx
|
||||
pop %eax
|
||||
xor %ebx,%ebx
|
||||
cmp $64,%ecx
|
||||
jae 2f
|
||||
shl %cl,%eax
|
||||
push %ebx
|
||||
push %eax
|
||||
NEXT
|
||||
2: push %ebx
|
||||
push %ebx
|
||||
NEXT
|
||||
|
||||
/* ( ud1 u -- ud2 ) Logical (unsigned) shift right by u bits */
|
||||
defcode DRSHIFT
|
||||
pop %ecx
|
||||
cmp $32,%ecx
|
||||
jae 1f
|
||||
movl (%esp),%eax
|
||||
shrdl %cl,%eax,4(%esp)
|
||||
shrl %cl,(%esp)
|
||||
NEXT
|
||||
1: pop %ebx
|
||||
pop %eax
|
||||
xor %eax,%eax
|
||||
cmp $64,%ecx
|
||||
jae 2f
|
||||
shr %cl,%ebx
|
||||
push %ebx
|
||||
push %eax
|
||||
NEXT
|
||||
2: push %eax
|
||||
push %eax
|
||||
NEXT
|
||||
|
||||
|
||||
.macro defzcmp label,ncc,name="\label",flags=0
|
||||
defcode \label,"\name",0,\flags
|
||||
|
|
|
|||
Loading…
Reference in New Issue