diff --git a/basis/cpu/x86/bootstrap.factor b/basis/cpu/x86/bootstrap.factor index 7fc32da9a4..c1471da915 100644 --- a/basis/cpu/x86/bootstrap.factor +++ b/basis/cpu/x86/bootstrap.factor @@ -302,6 +302,21 @@ big-endian off ds-reg [] arg0 MOV ! save ] f f f \ fixnum-bitnot define-sub-primitive +[ + ECX ds-reg [] MOV ! load shift count + ECX tag-bits get SHR ! untag shift count + ds-reg bootstrap-cell SUB ! adjust stack pointer + arg0 ds-reg [] MOV ! load value + arg1 arg0 MOV ! make a copy + arg1 CL SHL ! compute positive shift value in arg1 + ECX NEG ! compute negative shift value in arg0 + arg0 CL SHR + arg0 tag-mask get bitnot AND + ECX 0 CMP ! if shift count was negative, move arg0 to arg1 + arg1 arg0 CMOVLE + ds-reg [] arg1 MOV ! push to stack +] f f f \ fixnum-shift-fast define-sub-primitive + [ arg0 ds-reg [] MOV ! load local number fixnum>slot@ ! turn local number into offset