[Webkit-unassigned] [Bug 115722] [sh4] Take advantage of pre-decrement and post-increment opcodes for sh4 base JIT

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue May 7 09:07:39 PDT 2013


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





--- Comment #6 from Julien Brianceau <jbrianceau at nds.com>  2013-05-07 09:06:02 PST ---
(From update of attachment 200892)
View in context: https://bugs.webkit.org/attachment.cgi?id=200892&action=review

>> Source/JavaScriptCore/assembler/MacroAssemblerSH4.h:1043
>> +        m_assembler.loadConstant(address.offset + 8, scr);
> 
> wat?

Before patch we had something like:
1. load effective address in scr
2. store first part of the double at address scr
3. add 4 to scr
4. store second part of the double at address scr

With patch, I do this as it is in LLINT:
1. load effective address + 8 in scr
2. store the second part of the double at address scr with predecrement of scr (-4)
3. store the first part of the double at address scr with predecrement of scr (-4)

Result is the same but we save one opcode.

>> Source/JavaScriptCore/assembler/MacroAssemblerSH4.h:1057
>> +        add32(TrustedImm32(address.offset + 8), scr);
> 
> again wat?

Same idea (and I removed the if, because this case is already checked in add32() function).

>> Source/JavaScriptCore/assembler/MacroAssemblerSH4.h:1170
>> +        m_assembler.ensureSpace(m_assembler.maxInstructionSize + 58, sizeof(uint32_t));
> 
> This magic constant scares me, what is it?

It scares me too :/
>From what I understand, it ensures that we'll have enough contiguous space in the instruction buffer (to be able to do relative short jumps for instance).
I reduced the constant size from 10 because I removed 10 bytes of instructions, but I'm not very proud of this...

>>>> Source/JavaScriptCore/assembler/SH4Assembler.h:120
>>>> +    MOVW_READ_RMINC_OPCODE = 0x6005,
>>> 
>>> enum members should use InterCaps with an initial capital letter.  [readability/enum_casing] [4]
>> 
>> All other 100+ entries in this enum are in capital letters, so I think I'll leave it as it is.
> 
> I think we just need to modify the style bot to ignore these

Ok

-- 
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