[Webkit-unassigned] [Bug 112239] LLint uses SSE2 instructions

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Apr 1 14:07:23 PDT 2013


https://bugs.webkit.org/show_bug.cgi?id=112239





--- Comment #9 from Filip Pizlo <fpizlo at apple.com>  2013-04-01 14:05:34 PST ---
(In reply to comment #8)
> (In reply to comment #7)
> > (In reply to comment #6)
> > > Confirmed. X86.rb that picks X86 instructions uses SSE2 instructions in various places. You appear to hit mulsd in this case, but there are a few other examples of SSE2 instructions.
> > > 
> > > I will see if this can be fixed, but I am afraid there will be resistance to implementing it the right way since there is a fallback called cloop. Unfortunately cloop is not that fast and also has a lot of bugs since it is only used for otherwise unsupported architectures.
> > 
> > It would be great to fix cloop.
> > 
> > For us, cloop appears to be pretty quick, in the tests we've done - so if it isn't on your platform, it might be easier to fix that problem than modifying x86.rb.
> > 
> > On the other hand, I don't want to get in the way of getting things working for you guys: if you'd rather add x87 support to x86.rb then I'd be happy to help.  I believe it should be straight-forward if you follow Intel's guidance on how to make x87 "look" like a flat register file.
> 
> I looked further and it seems JIT detects it needs SSE2 for floating point operations and bails for block where it needs it and leaves the job to LLint.

I don't think that's true.  The JIT will leave the job to its C code slow paths if SSE2 is not around.  That's actually quite nasty - calling to C code for every double arithmetic op is really bad.

> 
> Would it be possible for LLint to detect the situation similar to JIT and fallback to CLoop for blocks that can not be interpreted with native assembler?

It would be hard to detect it at run-time, and would require a lot of changes to have _both_ the LLInt asm code and the LLInt cloop code in the same executable.  I'm not sure any of us want to deal with the maintenance hassles of approach! ;-)

So here are our options:

- Have an ability to build LLInt to use x87.  I like this approach the best.

- Have the LLInt do a run-time check on each arithmetic op, and bail to its C slow path, like the JIT does.  This is probably less elegant, and slower, than the previous option.  But it could work.

Anyways, if you're looking for a quick fix I highly recommend you get the cloop working.  The whole point of the clop is to be portable; if it isn't then we should fix it.

If you want performance, then let's do it right.  There's nothing fundamentally blocking x87 support in the LLInt.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list