Closed Bug 543401 Opened 14 years ago Closed 14 years ago

nanojit: merge SoftFloatFilter implementations

Categories

(Core Graveyard :: Nanojit, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: n.nethercote, Assigned: n.nethercote)

References

Details

(Whiteboard: fixed-in-nanojit, fixed-in-tamarin, fixed-in-tracemonkey)

Attachments

(3 files)

TM and TR have their own versions of SoftFloatFilter, but the differences between them are superficial.  A single version should live in NJ.  This version could then easily be used by lirasm, which would allow SoftFloat to be tested from lirasm.
Blocks: 530754
Attached patch NJ patchSplinter Review
This patch adds SoftFloatFilter into NJ.  The added version is a mixture of what I thought were the best features of the two SoftFloatFilters in TM and TR (but there weren't many differences).  I also changed lirasm to run the SoftFloatFilter if arm_vfp is false, which is necessary for it to be tested properly.
Attachment #424683 - Flags: review?(stejohns)
Attachment #424683 - Flags: review?(gal)
Attached patch TM patchSplinter Review
Attachment #424684 - Flags: review?(gal)
Attached patch TR patchSplinter Review
Attachment #424685 - Flags: review?(stejohns)
Attachment #424684 - Flags: review?(gal) → review+
Attachment #424683 - Flags: review?(gal) → review+
Steven, I think I rewrote the code to match what TR does a while back, but watch out for subtle differences when you review this.
Comment on attachment 424683 [details] [diff] [review]
NJ patch

Disclaimer: I've reviewed the code but not yet actually integrated & tested it on TR running on ARM hardware. That would be nice to do before landing, IMHO. That said, approved with a few quibbles:

Weren't we going to add something like NJ_SOFTFLOAT_SUPPORTED so that platforms that can't use softfloat don't compile in the relevant support code? No point in including can't-possibly-be-used code on (say) x86...

>    static double FASTCALL fneg(double a)           { return -a; }

AFAIK, FASTCALL only applies to integer arguments, so this is pointless, but harmless, I guess.

>             if ((op >= LIR_feq && op <= LIR_fge))

Time to add is_fcmp(), methinks, but that's scope creep...


> LIR.h:     extern const SoftFloatOps softFloatOps;
> LIR.cpp:   const SoftFloatOps softFloatOps;

any reason this shouldn't be static to LIR.cpp?
Attachment #424683 - Flags: review?(stejohns) → review+
Attachment #424685 - Flags: review?(stejohns) → review+
(In reply to comment #5)
> Weren't we going to add something like NJ_SOFTFLOAT_SUPPORTED so that platforms
> that can't use softfloat don't compile in the relevant support code? No point
> in including can't-possibly-be-used code on (say) x86...

That's bug 542326.  It will conflict a bit with this one, but I can resolve the conflicts when the first one lands.

> >    static double FASTCALL fneg(double a)           { return -a; }
> 
> AFAIK, FASTCALL only applies to integer arguments, so this is pointless, but
> harmless, I guess.

It's useful for i2f/u2f, and it's easier (due to the SF_CALLINFO macro) if they all use the same calling convention.

> >             if ((op >= LIR_feq && op <= LIR_fge))
> 
> Time to add is_fcmp(), methinks, but that's scope creep...

That's in bug 542932.

> > LIR.h:     extern const SoftFloatOps softFloatOps;
> > LIR.cpp:   const SoftFloatOps softFloatOps;
> 
> any reason this shouldn't be static to LIR.cpp?

It's used in TM's jstracer.cpp.
http://hg.mozilla.org/tamarin-redux/rev/3b058845fae6
http://hg.mozilla.org/tamarin-redux/rev/d248dab11ddc
Whiteboard: fixed-in-nanojit → fixed-in-nanojit, fixed-in-tamarin
http://hg.mozilla.org/tracemonkey/rev/fb8b00527584
http://hg.mozilla.org/tracemonkey/rev/d30ae27488ca
Whiteboard: fixed-in-nanojit, fixed-in-tamarin → fixed-in-nanojit, fixed-in-tamarin, fixed-in-tracemonkey
http://hg.mozilla.org/mozilla-central/rev/d30ae27488ca
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: