Closed Bug 468883 Opened 16 years ago Closed 15 years ago

Enable the ARMv6 pixman optimizations on Windows Mobile

Categories

(Core :: Graphics, defect)

ARM
Windows Mobile 6 Professional
defect
Not set
normal

Tracking

()

RESOLVED FIXED
Tracking Status
fennec 1.0a1-wm+ ---

People

(Reporter: jrmuizel, Assigned: jrmuizel)

Details

Attachments

(3 files, 5 obsolete files)

MSVC doesn't support inline assembler for ARM so we'll need separate files that can be assembled with armasm. armasm does support the ARMv6 opcodes when using "-arch 6" flag.
One of the things that we'll probably need for this is cpu type detection.

It looks like the emulators don't support the ARMv6 instructions. i.e. the give an illegal instruction exception when trying to execute them. So we'll hopefully be able to do runtime cpu detection using GetSystemInfo().
Attached file Example program to print the cpu level (obsolete) —
If someone could run this program and report the displayed message on a device with an ARMv6 or newer that would help in identifying whether GetSystemInfo is useful.
on an HTC Touch Pro (Qualcomm MSM7201A 528 MHz, ARM1136EJ-S) I got "Result = 15 LEVEL:4" from your test program
fwiw, here is the full output from GetSystemInfo:
dwOemId: 5
wProcessorArchitecture: 5 (PROCESSOR_ARCHITECTURE_ARM)
wReserved: 0
dwPageSize: 4096
lpMinimumApplicationAddress: 65536
lpMaximumApplicationAddress: 2147483647
dwActiveProcessorMask: 1
dwNumberOfProcessors: 1
dwProcessorType: 2577  (PROCESSOR_STRONGARM)
dwAllocationGranularity: 65536
wProcessorLevel: 4
wProcessorRevision: 2
I thought IsProcessorFeaturePresent() might be useful, unfortunately it returns false for PR_ARM_V6.  Here is the full output:

PF_ARM_V4 supported
PF_ARM_V5 supported
PF_ARM_V6 not supported
PF_ARM_V7 not supported
PF_ARM_THUMB supported
PF_ARM_JAZELLE not supported
PF_ARM_DSP not supported
PF_ARM_MOVE_CP not supported
PF_ARM_VFP10 not supported
PF_ARM_MPU supported
PF_ARM_WRITE_BUFFER supported
PF_ARM_MBX not supported
PF_ARM_L2CACHE not supported
PF_ARM_PHYSICALLY_TAGGED_CACHE not supported
PF_ARM_VFP_SINGLE_PRECISION not supported
PF_ARM_VFP_DOUBLE_PRECISION not supported
PF_ARM_ITCM not supported
PF_ARM_DTCM not supported
PF_ARM_UNIFIED_CACHE not supported
PF_ARM_WRITE_BACK_CACHE supported
PF_ARM_CACHE_CAN_BE_LOCKED_DOWN supported
PF_ARM_L2CACHE_MEMORY_MAPPED not supported
PF_ARM_L2CACHE_COPROC not supported
Here's a new attempt that uses structured exception handling to catch EXCEPTION_ILLEGAL_INSTRUCTION and do the right thing.
Attachment #352435 - Attachment is obsolete: true
the pop up for that attachment read "CPU is ARMv6"
Good, the easy part is done now. Next I'll try and put together a simple patch that gets something working.
Product: Core → Core Graveyard
Component: GFX → GFX: Thebes
Product: Core Graveyard → Core
QA Contact: general → thebes
Assignee: nobody → jmuizelaar
tracking-fennec: --- → 1.0a1-wm+
So based on VFP experiences, it looks like the kernel is probably built for ARMv5, even though the device itself is ARMv6.  I'd guess this is what IsProcessorFeaturePresent is returning.  It doesn't matter for the SIMD instructions, because those don't require any kernel support; but it does for VFP.

Getting this working probably means writing a native arm .asm file and avoiding inline assembly entirely; it might even be possible to use this cross-platform.
Unbuilt and untested but the basic idea has been tested and it should work.
(In reply to comment #9)
> Getting this working probably means writing a native arm .asm file and avoiding
> inline assembly entirely; it might even be possible to use this cross-platform.

Are the calling conventions the same on wince as on linux? If so, another option would be to just generate armasm files from the gcc produced binaries.
That's not a bad idea -- they are the same, yeah.
Status: NEW → ASSIGNED
Attached file First cut at generated asm (obsolete) —
Here's the result from a first pass of generating the assembler to be fed into armasm. It assembles, I've no idea if it works.
Jeff, this seems to work -- do we want to do any cleanup of this, or just stick a big ";;; WARNING - AUTO GENERATED" at the top?
Attached patch Cleanup of vlad's patch (obsolete) — Splinter Review
This untested version uses an actual automatically generated file instead of one that's been hand munged. It also adds the runtime detection code.
Attachment #361843 - Attachment is obsolete: true
Attachment #362083 - Attachment is obsolete: true
Comment on attachment 362907 [details] [diff] [review]
Cleanup of vlad's patch

This has been working fine; let's go with it.
Attachment #362907 - Flags: review+
Wait, one more patch.. some changes in the makefiles.
Attachment #362907 - Attachment is obsolete: true
Attachment #363985 - Flags: superreview+
Attachment #363985 - Flags: review?(jmuizelaar)
Comment on attachment 363985 [details] [diff] [review]
some smaller changes in Makefiles

This breaks the linux build. I'll update the patch to fix it.
Attachment #363985 - Flags: review?(jmuizelaar) → review-
This should be better
Attachment #363985 - Attachment is obsolete: true
Attachment #363990 - Flags: review+
Comment on attachment 363990 [details] [diff] [review]
fix build on linux and a hint of cleanup

Sounds good
http://hg.mozilla.org/mozilla-central/rev/357758846e59
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: