-
Notifications
You must be signed in to change notification settings - Fork 18k
internal/cpu: ARM feature detection #26630
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Change https://golang.org/cl/124436 mentions this issue: |
Change https://golang.org/cl/126315 mentions this issue: |
The first arm support for harddiv was already implemented in https://go-review.googlesource.com/c/go/+/114826 and is waiting for the freeze to go1.12 to lift. Please allow a day to answer on issues before starting implementations. |
Sorry, I jumped the gun on that CL. I can withdraw it and comment on the hardDiv one if you'd like. |
Np. I would be happy if you can comment on and test for any improvements for the existing https://go-review.googlesource.com/c/go/+/114826. We can submit your CL (after review) ontop of that for any additional features needed for upcoming implementations needing other cpu features (in e.g. math) once they are ready for review. |
This change exposes feature flags needed to implement an FMA intrinsic on ARM CPUs via auxv's HWCAP bits. Specifically, it exposes HasVFPv4 to detect if an ARM processor has the fourth version of the vector floating point unit. The relevant instruction for this CL is VFMA, emitted in Go as FMULAD. Updates #26630. Change-Id: Ibbc04fb24c2b4d994f93762360f1a37bc6d83ff7 Reviewed-on: https://go-review.googlesource.com/c/126315 Run-TryBot: Martin Möhrmann <moehrmann@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Martin Möhrmann <moehrmann@google.com>
What remains here? Looks like all the CLs above were merged? Bumping to Go 1.13 but feel free to close if this is all done. |
The CL has been merged, so nothing remains for the internal/cpu portion of the ARM feature. |
Similar to #26538, feature detection on ARM is useful for runtime specialization of code.
Knowing if VFPv4 is present on the hardware helps the implementation of intrinsics (like FMA) and other math operations. However, since VFPv4 is detected through the HWCAP bits from auxv, only the runtime has access to the this information. Given that ARM's hardware features don't map easily to GOARM values, more fine-grained detection is needed.
An additional benefit of including ARM feature detection into the package is that because pre-ARMv8 is so variable, having a single source of feature detection makes it easier to debug different codepaths (f045ddc).
Because Go does not support ARMv4 and lower,
The text was updated successfully, but these errors were encountered: