Closed Bug 586224 Opened 14 years ago Closed 14 years ago

Use clz on android even for armv5 target

Categories

(Core Graveyard :: Nanojit, defect)

ARM
Android
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: glandium, Assigned: glandium)

References

Details

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

Attachments

(2 files)

Attached patch PatchSplinter Review
The android gcc compiler refuses to compile 'clz' for armv5, even though it is a legal instruction there, but it can still be tricked into compiling it.

This was already discussed in bug 552624
Attachment #464742 - Attachment is patch: true
Attachment #464742 - Attachment mime type: application/octet-stream → text/plain
Attachment #464742 - Flags: review?(Jacob.Bramley)
Comment on attachment 464742 [details] [diff] [review]
Patch

>-#elif defined(__GNUC__) && !(defined(ANDROID) && __ARM_ARCH__ <= 5)
>+#elif defined(__GNUC__) && (NJ_COMPILER_ARM_ARCH >= 5)

Ooh, actually the original code was broken here. Thanks for the fix!

----

A couple of tweaks:

>     // GCC can use inline assembler to insert a CLZ instruction.
>     __asm (
>+#if defined(ANDROID) && (NJ_COMPILER_ARM_ARCH <= 5)

I think this should be "NJ_COMPILER_ARM_ARCH < 7" (or "<= 6"). An Android+ARMv6 build will be broken with your current patch.

>+    // On Android gcc compiler, the clz instruction is not supported with a
>+    // target smaller than armv7, despite it being legal for armv5+.
>+        "   .arch armv7\n"

ARMv7-M only supports Thumb, so things might get confused as ".arch armv7" is supposed to represent a common set of all profiles. I think ".arch armv7-a" would be better.
Attachment #464742 - Flags: review?(Jacob.Bramley) → review+
Attached patch Updated patchSplinter Review
Updated patch with your comments. Where should that land? nanojit-central?
Assignee: nobody → mh+mozilla
Blocks: 552624
http://hg.mozilla.org/projects/nanojit-central/rev/5a56d9f0b2d6
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Whiteboard: fixed-in-nanojit
Reopening, as I've been told nanojit bugs get closed when landing on m-c.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
merged into tamarin-redux
http://hg.mozilla.org/tamarin-redux/rev/c97ccde53276
Whiteboard: fixed-in-nanojit → fixed-in-nanojit, fixed-in-tamarin
http://hg.mozilla.org/mozilla-central/rev/4924f4e8d88f
Status: REOPENED → RESOLVED
Closed: 14 years ago14 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: