[prev in list] [next in list] [prev in thread] [next in thread] 

List:       perl5-porters
Subject:    Re: hooking IV => NV upgrade
From:       Nicholas Clark <nick () ccl4 ! org>
Date:       2007-03-30 15:11:47
Message-ID: 20070330151147.GV5748 () plum ! flirble ! org
[Download RAW message or body]

On Fri, Mar 30, 2007 at 04:53:18PM +0000, Tels wrote:

> How hard would it be to add this hook and where would this have to be done? 
> (Hopefully not all over the place)

I don't know and I don't know, other than "in all the ops that correspond
to the arithmetic functions for which it is desired".

I can see that in pp_subtract, the promising point looks to be here:

	    if (result_good) {
		SP--;
		if (auvok)
		    SETu( result );
		else {
		    /* Negate result */
		    if (result <= (UV)IV_MIN)
			SETi( -(IV)result );
		    else {
			/* result valid, but out of range for IV.  */
			SETn( -(NV)result );
		    }
		}
		RETURN;
	    } /* Overflow, drop through to NVs.  */

I have no idea how tricky everywhere else is, without actually doing the work.

Nicholas Clark
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic