Chrome for Android/ARM enables NEON instructions at compile time, as of M50 (except in net/, see below). I think it is a good time to start removing NEON *runtime* detection. Here is a list of places I found with runtime detection in use:webrtc (giving it a try: https://codereview.webrtc.org/1955413003/)libjpeg_turboopenmax_dlpdfiumskiawebpIf you like removing code like I do, please feel free to pick your victim :) Once all these are cleaned up, we can remove the toplevel GN/GYP variable.The below:Cronet supports older devices than Chrome does, and that includes pre-NEON.Also, more interestingly, there was one hiccup during rollout, where we enabled NEON in boringssl even for devices that implement NEON support in a subtly broken way. This issue with "broken NEON" is uncommon and seems *not* to affect the code emitted by the compiler, or any other-than-boringssl hand-written assembly, but it is certainly something to watch out in the future. So, boringssl will have its own NEON detection, including its own auxval/cpuinfo hacks. See details in http://crbug.com/606629
--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev...@chromium.org.
just to be clear, you're proposing removing runtime detection only, not support for non-neon devices ? i.e. you're not proposing making neon a hard requirement ?
for Chromium, i can understand making this a requirement, and that's fine. but forcing the changes into downstream projects seems inappropriate.
For Cast Audio, we don't use runtime NEON detection.In stead, we define "arm_use_neon=false" specifically for audio build. We are OK with the proposal as long as the VFP or C implementation is still available at compile time.
On Tue, May 10, 2016 at 4:21 PM, Mike Frysinger <vap...@chromium.org> wrote:just to be clear, you're proposing removing runtime detection only, not support for non-neon devices ? i.e. you're not proposing making neon a hard requirement ?In this iteration of cleanup the proposal is to only remove the runtime detection. Fallbacks to old VFP can be enabled at compile time.for Chromium, i can understand making this a requirement, and that's fine. but forcing the changes into downstream projects seems inappropriate.I am slightly confused.Did you mean that removing the compile-time switch causes problems for downstream projects like Cast/Opera? Or is it also about runtime detection removal that is inappropriate?Or maybe you mean upstream projects like webrtc/skia?
Chrome for Android/ARM enables NEON instructions at compile time, as of M50 (except in net/, see below). I think it is a good time to start removing NEON *runtime* detection. Here is a list of places I found with runtime detection in use:webrtc (giving it a try: https://codereview.webrtc.org/1955413003/)libjpeg_turboopenmax_dlpdfiumskiawebpIf you like removing code like I do, please feel free to pick your victim :) Once all these are cleaned up, we can remove the toplevel GN/GYP variable.The below:Cronet supports older devices than Chrome does, and that includes pre-NEON.
Also, more interestingly, there was one hiccup during rollout, where we enabled NEON in boringssl even for devices that implement NEON support in a subtly broken way. This issue with "broken NEON" is uncommon and seems *not* to affect the code emitted by the compiler, or any other-than-boringssl hand-written assembly, but it is certainly something to watch out in the future. So, boringssl will have its own NEON detection, including its own auxval/cpuinfo hacks. See details in http://crbug.com/606629Future: remove pre-NEON code enabled at compile time. Things to watch out for: we cannot remove anything that Cast Audio depends on. Cast folks: do you have a list? I guess there is no need in non-neon fallbacks for: ffmpeg, skia, webp, libjpeg, pdfium. Not sure about webrtc and maybe I missed something that can be cleaned up.
On Tue, May 10, 2016 at 12:16 PM, Egor Pasko <pa...@chromium.org> wrote:On Tue, May 10, 2016 at 4:21 PM, Mike Frysinger <vap...@chromium.org> wrote:just to be clear, you're proposing removing runtime detection only, not support for non-neon devices ? i.e. you're not proposing making neon a hard requirement ?In this iteration of cleanup the proposal is to only remove the runtime detection. Fallbacks to old VFP can be enabled at compile time.for Chromium, i can understand making this a requirement, and that's fine. but forcing the changes into downstream projects seems inappropriate.I am slightly confused.Did you mean that removing the compile-time switch causes problems for downstream projects like Cast/Opera? Or is it also about runtime detection removal that is inappropriate?Or maybe you mean upstream projects like webrtc/skia?i'm thinking of projects like pdfium that, while hosted under the Chromium umbrella, are a standalone project by themselves. i don't think Chromium's (the browser) goals should be dictating that pdfium drop support for non-neon systems. or for projects that aren't even under Chromium's umbrella like libjpeg-turbo.in general, if maintaining runtime detection is onerous, i don't have a problem dropping it. it's when you say "this project requires neon" that i'm disturbed. i.e. dropping support for neon at compile time.
On Tue, May 10, 2016 at 6:55 AM, Egor Pasko <pa...@chromium.org> wrote:Chrome for Android/ARM enables NEON instructions at compile time, as of M50 (except in net/, see below). I think it is a good time to start removing NEON *runtime* detection. Here is a list of places I found with runtime detection in use:webrtc (giving it a try: https://codereview.webrtc.org/1955413003/)libjpeg_turboopenmax_dlpdfiumskiawebpIf you like removing code like I do, please feel free to pick your victim :) Once all these are cleaned up, we can remove the toplevel GN/GYP variable.The below:Cronet supports older devices than Chrome does, and that includes pre-NEON.Also, more interestingly, there was one hiccup during rollout, where we enabled NEON in boringssl even for devices that implement NEON support in a subtly broken way. This issue with "broken NEON" is uncommon and seems *not* to affect the code emitted by the compiler, or any other-than-boringssl hand-written assembly, but it is certainly something to watch out in the future. So, boringssl will have its own NEON detection, including its own auxval/cpuinfo hacks. See details in http://crbug.com/606629Future: remove pre-NEON code enabled at compile time. Things to watch out for: we cannot remove anything that Cast Audio depends on. Cast folks: do you have a list? I guess there is no need in non-neon fallbacks for: ffmpeg, skia, webp, libjpeg, pdfium. Not sure about webrtc and maybe I missed something that can be cleaned up.
On Tue, May 10, 2016 at 6:22 PM, Mike Frysinger <vap...@chromium.org> wrote:On Tue, May 10, 2016 at 12:16 PM, Egor Pasko <pa...@chromium.org> wrote:On Tue, May 10, 2016 at 4:21 PM, Mike Frysinger <vap...@chromium.org> wrote:just to be clear, you're proposing removing runtime detection only, not support for non-neon devices ? i.e. you're not proposing making neon a hard requirement ?In this iteration of cleanup the proposal is to only remove the runtime detection. Fallbacks to old VFP can be enabled at compile time.for Chromium, i can understand making this a requirement, and that's fine. but forcing the changes into downstream projects seems inappropriate.I am slightly confused.Did you mean that removing the compile-time switch causes problems for downstream projects like Cast/Opera? Or is it also about runtime detection removal that is inappropriate?Or maybe you mean upstream projects like webrtc/skia?i'm thinking of projects like pdfium that, while hosted under the Chromium umbrella, are a standalone project by themselves. i don't think Chromium's (the browser) goals should be dictating that pdfium drop support for non-neon systems. or for projects that aren't even under Chromium's umbrella like libjpeg-turbo.in general, if maintaining runtime detection is onerous, i don't have a problem dropping it. it's when you say "this project requires neon" that i'm disturbed. i.e. dropping support for neon at compile time.Ah. Understood.Certainly the choice whether to do the cleaning is up to the individual external projects. I know some projects wanted to remove this cruft (Skia!), so now they are very welcome to do so from the Chromium standpoint. Even further, since Cast is not using Skia with non-Neon tartets, it feels safe (for Chrome) to remove the non-neon compile-time support as well. Again, only if all consumers of Skia are OK with the plan.We'd still like to ask to remove the runtime detection support from GYP/GN (so that we can remove it from build/common.gypi), other build systems may still support it if needed.
Does this mean I can now also add NEON instrinsics into the code? Of course, the non-neon code needs to stay around, but it would be nice to be able to have this now in some WebAudio code to optimize some heavy code paths. We do this today already with x86 and SSE2 intrinsics. Doing this for Arm would be really nice.
On Wed, May 11, 2016 at 9:52 PM, Raymond Toy <rt...@google.com> wrote:Does this mean I can now also add NEON instrinsics into the code? Of course, the non-neon code needs to stay around, but it would be nice to be able to have this now in some WebAudio code to optimize some heavy code paths. We do this today already with x86 and SSE2 intrinsics. Doing this for Arm would be really nice.I think it was allowed before? If the code is guarded by arm_use_neon=true, you can apply neon-specific intrinsics/assembly/optimizations at your will. I would personally prefer intrinsics, but that's another story.
"Just" need to make sure that the code you add intrinsics to indeed runs only on neon:1. Cast Audio continues to be supported with the compile-time switch2. you are not breaking your other, non-chromium downstreams
+u...@chromium.orgNote that V8 uses runtime detection if arm_use_neon is false, and otherwise just uses neon if arm_use_neon is true
On Thu, May 12, 2016 at 4:24 AM, Egor Pasko <pa...@chromium.org> wrote:On Wed, May 11, 2016 at 9:52 PM, Raymond Toy <rt...@google.com> wrote:Does this mean I can now also add NEON instrinsics into the code? Of course, the non-neon code needs to stay around, but it would be nice to be able to have this now in some WebAudio code to optimize some heavy code paths. We do this today already with x86 and SSE2 intrinsics. Doing this for Arm would be really nice.I think it was allowed before? If the code is guarded by arm_use_neon=true, you can apply neon-specific intrinsics/assembly/optimizations at your will. I would personally prefer intrinsics, but that's another story.Yes, sort of. IIRC, chromium on android was always compiled with arm_use_neon=false;
I didn't want to add runtime detection and split up the original source files and build two libraries (one for neon and one without). (I did do this for openmax_dl since it's a huge win to be able to use neon for FFTs.)But now since detection isn't required I can just use the appropriate compile time flag to enable/disable neon. Thus, no runtime detection and no need to split up the file into two pieces.So, I take this to mean I can now use neon to my hearts content with arm_use_neon=true, so long as I make sure that the code still works if arm_use_neon=false.
There is a line before:https://code.google.com/p/chromium/codesearch#chromium/src/v8/src/arm/assembler-arm.cc&l=84supported_ |= CpuFeaturesImpliedByCompiler()This line uses the compile time flag. Once the neon bit is set in supported_, the later runtime detection cannot clear it.