mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-11 22:31:12 +02:00
RTL VM: ash: Use SCM_SRS and fix large right shifts in fast path.
* libguile/vm-engine.c (ash): Use SCM_SRS, and handle large right shifts properly.
This commit is contained in:
parent
78ff784784
commit
0bd659658b
1 changed files with 4 additions and 1 deletions
|
@ -2926,7 +2926,10 @@ RTL_VM_NAME (SCM vm, SCM program, SCM *argv, size_t nargs_)
|
|||
{
|
||||
if (SCM_I_INUM (y) < 0)
|
||||
/* Right shift, will be a fixnum. */
|
||||
RETURN (SCM_I_MAKINUM (SCM_I_INUM (x) >> -SCM_I_INUM (y)));
|
||||
RETURN (SCM_I_MAKINUM
|
||||
(SCM_SRS (SCM_I_INUM (x),
|
||||
(-SCM_I_INUM (y) <= SCM_I_FIXNUM_BIT-1)
|
||||
? -SCM_I_INUM (y) : SCM_I_FIXNUM_BIT-1)));
|
||||
else
|
||||
/* Left shift. See comments in scm_ash. */
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue