Better ideas for uint vs int compare MIR code

Edwin Smith edwsmith at adobe.com
Fri Jan 18 09:03:46 PST 2008


Captured as

https://bugzilla.mozilla.org/show_bug.cgi?id=412972

Ed

-----Original Message-----
From: tamarin-devel-bounces at mozilla.org
[mailto:tamarin-devel-bounces at mozilla.org] On Behalf Of Werner Sharp
Sent: Thursday, January 17, 2008 5:31 PM
To: tamarin-devel at mozilla.org
Subject: Better ideas for uint vs int compare MIR code

Hi all,

Currently, when doing an unsigned integer vs. integer comparison in the
JITed code, Tamarin emits two coercions to the Number type and does the
comparison using SSE registers.  This is the ugly MIR_u2d sequence:

MOV (disp+4, ESP, 0);			// high 32 bits = 0
MOV (disp, ESP, (Register)(vReg&0x7)); // low 32 bits = unsigned value
FILDQ(disp, ESP); // load 64bit int (won't lose precision)
FSTPQ(disp, ESP); // store + pop as 64bit double
MOVSD(r, disp, ESP); // load double into XMM

Does anyone have a better/faster/cleverer idea to compare an unsigned
integer vs. an integer in registers?  Perhaps checking the upper bit of
the unsigned value first and then doing the standard signed integer
compare?

_______________________________________________
Tamarin-devel mailing list
Tamarin-devel at mozilla.org
https://mail.mozilla.org/listinfo/tamarin-devel


More information about the Tamarin-devel mailing list