Closed Bug 817058 Opened 12 years ago Closed 5 years ago

AltiVec acceleration for nsTextFragment

Categories

(Core :: General, defect)

PowerPC
All
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla70
Tracking Status
firefox70 --- fixed

People

(Reporter: tobias.netzel, Assigned: spectre)

References

(Blocks 1 open bug)

Details

Attachments

(1 file, 8 obsolete files)

This implements VMX acceleration for FirstNon8Bit(), inspired by the SSE2 implementation. It depends on runtime VMX detection.
Attachment #687189 - Attachment is patch: true
Attachment #687189 - Flags: review?
Blocks: 817042
No longer blocks: 817042
Depends on: 817042
Blocks: 817033
replaced C cast with C++ cast
Attachment #687189 - Attachment is obsolete: true
Attachment #687189 - Flags: review?
Attachment #687206 - Flags: review?
One more style guide issue.
Attachment #687206 - Attachment is obsolete: true
Attachment #687206 - Flags: review?
Attachment #687211 - Flags: review?
More style guide issues and a missing cast - sorry for the spam.
Attachment #687211 - Attachment is obsolete: true
Attachment #687211 - Flags: review?
Attachment #687232 - Flags: review?
bz would probably be an appropriate reviewer for this.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: VMX acceleration for nsTextFragment → AltiVec acceleration for nsTextFragment
Attachment #687232 - Attachment is obsolete: true
Attachment #687232 - Flags: review?
Attachment #698261 - Flags: review?(jst)
Attachment #698261 - Flags: review?(bzbarsky)
Comment on attachment 698261 [details] [diff] [review] AltiVec acceleration for nsTextFragment v5 Still reading the implementation details, but should there be an AltiVec.h in this diff?
Comment on attachment 698261 [details] [diff] [review] AltiVec acceleration for nsTextFragment v5 numUnicharsPerVector should probably be uint32_t. >+ register vector unsigned short vect; Why not put this inside the if branch where it's used? >+ if ((len - alignLen) > (numUnicharsPerVector - 1)) { Wouldn't >= numUnicharsPerVector be clearer? >+ CheckForASCII >+ CheckForASCII Is that just a manual loop unroll as opposed to something needed for correctness? If so, worth documenting it as such. r=me with those nits.
Attachment #698261 - Flags: review?(bzbarsky) → review+
(In reply to Boris Zbarsky (:bz) from comment #6) > Comment on attachment 698261 [details] [diff] [review] > AltiVec acceleration for nsTextFragment v5 > > Still reading the implementation details, but should there be an AltiVec.h > in this diff? AltiVec.h is part of bug 817042.
The datatypes were signed because in the original SSE version they are signed.
Attachment #698261 - Attachment is obsolete: true
Attachment #698261 - Flags: review?(jst)
Attachment #698831 - Flags: review?(jst)
Attachment #698831 - Flags: review?(bzbarsky)
Comment on attachment 698831 [details] [diff] [review] AltiVec acceleration for nsTextFragment v6 > AltiVec.h is part of bug 817042. Ah, great, thanks. > The datatypes were signed because in the original SSE version they are signed. numUnicharsPerVector is unsigned in the SSE version, as far as I can tell. r=me
Attachment #698831 - Flags: review?(bzbarsky) → review+
Comment on attachment 698831 [details] [diff] [review] AltiVec acceleration for nsTextFragment v6 r=jst too fwiw.
Attachment #698831 - Flags: review?(jst) → review+
Since Tobias is out travelling, requesting checkin on his behalf.
Assignee: nobody → tobias.netzel
Status: NEW → ASSIGNED
Keywords: checkin-needed
Backed out for build bustage. https://hg.mozilla.org/integration/mozilla-inbound/rev/66483dfa678f https://tbpl.mozilla.org/php/getParsedLog.php?id=20565230&tree=Mozilla-Inbound /builds/slave/m-in-osx64-d-00000000000000000/build/content/base/src/nsTextFragment.cpp:20:10: fatal error: 'mozilla/AltiVec.h' file not found
Yeah, see the "depends on" field....
(In reply to Boris Zbarsky (:bz) from comment #14) > Yeah, see the "depends on" field.... With due respect, the expectation is that checkin-needed is being set when the patch (and any dependencies) are ready for checkin. I didn't decide to just land this on a whim.
Yes, I know. I wasn't blaming you; the checkin-needed was clearly set incorrectly. Sorry I wasn't clear about that. I just wonder whether there's any way to automatically catch that sort of thing in queries to reduce the load on people pushing checkin-needed stuff. e.g. having a separate query for things that are checkin-needed but have open "depends on" bugs, where you'd want to double-check before pushing. Or something. Not sure what a sane setup for that is.
That was my fault. Apologies.

Now that bug 1571613 has landed, I'm dusting this one off and updating it (for the new build system and to support big and little endian).

Attachment #698831 - Attachment is obsolete: true
Attachment #9088346 - Attachment is obsolete: true
Attachment #9088346 - Attachment is obsolete: false
Attachment #9088610 - Attachment is obsolete: true
Attachment #9088622 - Attachment is obsolete: true

I apologize, but I can't get moz-phab to stop making new differential revisions for my revised patches, which is why I opened a new one and abandoned the previous one.

Attachment #9088610 - Attachment is obsolete: false
Attachment #9088610 - Attachment is obsolete: true

Thanks for the review and sorry for the churn.

Assignee: tobias.netzel → spectre
Keywords: checkin-needed

Pushed by btara@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/d3fe24ea6309
VMX acceleration for nsTextFragment. r=bzbarsky

Keywords: checkin-needed
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla70

It depends on runtime VMX detection.

I'm planning to migrate TextFragment to use encoding_rs::mem. It currently supports SIMD acceleration for our tier-1 architectures: x86+SSE2, x86_64, armv7+NEON, and aarch64. In all these cases, the SIMD support is present unconditionally. It could support VMX but I'd like that to be unconditional, too, because it's rather important for the SIMD code to get inlined without function call overhead.

Is the run-time detection that's in the patch still relevant? That is, don't POWER8 and POWER9 have VMX unconditionally?

Flags: needinfo?(spectre)

POWER6 and up have VMX unconditionally, as does the POWER4-derived G5, but not all 64-bit Power CPUs do (the most notorious example is probably the QorIQ P5020 as used in the AmigaOne X5000, which runs Linux and AmigaOS). I agree I'd prefer that too but I can't guarantee that for ppc64 even though I'm not a fan of the choices the Amiga community is making with their designs.

That said, if the demand is that all tiers of Firefox should be SIMD-capable, that's not a policy question I can answer (though it won't affect the POWER9 I'm typing this on).

Flags: needinfo?(spectre)

POWER6 and up have VMX unconditionally, as does the POWER4-derived G5, but not all 64-bit Power CPUs do (the most notorious example is probably the QorIQ P5020 as used in the AmigaOne X5000, which runs Linux and AmigaOS).

Does Firefox run on AmigaOne? It's big-endian, right? Does Firefox still run on big-endian systems generally? I thought Skia dropped support for big-endian architectures, and asm.js/Wasm require little-endian ArrayBuffer semantics. Also, it seems that on 32-bit PPC Ubuntu, the Firefox package stopped updating while other 16.04 packages were still getting security updates. (I haven't booted up my PPC Ubuntu install in a while, so I don't know what the current situation is.)

POWER6 and up have VMX unconditionally

OK, so ppc64le has VMX unconditionally, right? (ppc64le is POWER 8 and up, right?)

I don't know about AmigaOne, but there are still big-endian ppc64 builds of mainline Firefox and to the best of my knowledge, these do operate. Adelie Linux is probably the best known. The big-endian builds generally don't support asm.js (TenFourFox got around this by simulating little-endianness for typed arrays).

To the best of my knowledge, all ppc64le-capable CPUs support VMX (correct, POWER8 and up).

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: