[Webkit-unassigned] [Bug 170089] [jsc][mips] Add missing MacroAssembler functions after r214187

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Apr 5 19:25:47 PDT 2017


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

--- Comment #5 from Guillaume Emont <guijemont at igalia.com> ---
(In reply to Adrian Perez from comment #4)
> (In reply to Yusuke Suzuki from comment #3)
> > Comment on attachment 305523 [details]
> > Patch
> > 
> > View in context:
> > https://bugs.webkit.org/attachment.cgi?id=305523&action=review
> > 
> > r=me with comment.
> > 
> > > Source/JavaScriptCore/assembler/MacroAssemblerMIPS.h:2462
> > > +    void loadFloat(ImplicitAddress address, FPRegisterID dest)
> > > +    {
> > > +        if (address.offset >= -32768 && address.offset <= 32767
> > > +            && !m_fixedWidth) {
> > > +            m_assembler.lwc1(dest, address.base, address.offset);
> > > +        } else {
> > > +            /*
> > > +               lui     addrTemp, (offset + 0x8000) >> 16
> > > +               addu    addrTemp, addrTemp, base
> > > +               lwc1    dest, (offset & 0xffff)(addrTemp)
> > > +               */
> > > +            m_assembler.lui(addrTempRegister, (address.offset + 0x8000) >> 16);
> > > +            m_assembler.addu(addrTempRegister, addrTempRegister, address.base);
> > > +            m_assembler.lwc1(dest, addrTempRegister, address.offset);
> > > +        }
> > > +    }
> > 
> > Looking the loadDouble code, we can see WTF_MIPS_ISA(1) guard.
> > Isn't it required here?
> 
> I think Yusuke is right. FPRegisterIDs refer to 64-bit registers. In
> MIPS32/MIPS-II “ldc1” can be used to load a 32-bit value directly,
> but in MIPS-I it is needed to use two “lwc1” instructions, one for
> each 32-bit half of the 64-bit value.

No, I don't think we need that guard. loadDouble/storeDouble use that because MIPS-I does not contain the ldc1 (resp. sdc1) instruction, and therefore two lwc1 (resp swc1) instructions are used instead for the MIPS-I version. In loadFloat/storeFloat, we do not use ldc1/sdc1, and all the instructions that we use are MIPS-I compatible AFAIK, so there's no need for an alternative version.
You can see that the pre-existing loadFloat/storeFloat with a BaseIndex argument don't have such a guard either, for the same reasons.

Another way to put it: the need for special cases for MIPS-I only exists when dealing with doubles. The fact of using an ImplicitAddress instead of a BaseIndex does not incur this need. 

Another debate is whether we still want to support MIPS-I, I don't know if there still are many devices using that where it makes sense to use webkit, though I could be wrong, because, hey, we have these guards in the code.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20170406/03d624d8/attachment.html>


More information about the webkit-unassigned mailing list