Bug 131532

Summary: [sh4] LLINT is broken
Product: WebKit Reporter: Julien Brianceau <jbriance>
Component: JavaScriptCoreAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: mark.lam, msaboff
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Fix sh4 LLINT
none
Fix sh4 LLINT (with consistent letter casing) mark.lam: review+

Description Julien Brianceau 2014-04-11 03:03:58 PDT
sh4 backend of LLINT is broken since C stack merge.
Specific parts are missing since http://trac.webkit.org/changeset/167094 too.
Comment 1 Julien Brianceau 2014-04-11 03:16:56 PDT
Created attachment 229122 [details]
Fix sh4 LLINT
Comment 2 Mark Lam 2014-04-11 08:00:11 PDT
Comment on attachment 229122 [details]
Fix sh4 LLINT

View in context: https://bugs.webkit.org/attachment.cgi?id=229122&action=review

> Source/JavaScriptCore/offlineasm/instructions.rb:296
> +    "alignFormova",

nit: This looks weird.  I suggest either renaming this to alignformova, or alignForMova or alignForMovA.
Comment 3 Julien Brianceau 2014-04-11 08:46:10 PDT
Created attachment 229134 [details]
Fix sh4 LLINT (with consistent letter casing)
Comment 4 Mark Lam 2014-04-11 08:47:37 PDT
Comment on attachment 229134 [details]
Fix sh4 LLINT (with consistent letter casing)

r=me
Comment 5 Julien Brianceau 2014-04-11 08:57:01 PDT
Committed r167127: <http://trac.webkit.org/changeset/167127>
Comment 6 Michael Saboff 2014-04-11 17:51:21 PDT
Comment on attachment 229134 [details]
Fix sh4 LLINT (with consistent letter casing)

View in context: https://bugs.webkit.org/attachment.cgi?id=229134&action=review

> Source/JavaScriptCore/llint/LowLevelInterpreter.asm:721
> +        mova _relativePCBase, t0
> +        move t0, pcBase

Why can't you just mova _relativePCBase directly into pcBase?

> Source/JavaScriptCore/offlineasm/sh4.rb:1032
> +            $asm.puts ".balign 4"

If the .balign has to fill, is the '0' fill going to be a nop?  You may want to explicitly mention that with a comment.
Comment 7 Julien Brianceau 2014-04-14 00:52:55 PDT
(In reply to comment #6)
> Why can't you just mova _relativePCBase directly into pcBase?
Unfortunately, r0 is the only allowed dest register for the mova opcode.

> If the .balign has to fill, is the '0' fill going to be a nop?  You may want to explicitly mention that with a comment.
Yes, as the .balign directive is put in a section containing code, no-op instructions are used as fill value instead of 0.


I found a way to use SubImmediates with sh4 const pool, so the sh4 arch can share the arm path for setEntryAddress. I'm going to file a new bug with this implementation, and I'll add a comment for .balign in it.
Comment 8 Julien Brianceau 2014-04-14 01:07:37 PDT
Created bugzilla: https://bugs.webkit.org/show_bug.cgi?id=131608