pitrou commented on code in PR #37785:
URL: https://github.com/apache/arrow/pull/37785#discussion_r1331776747
##########
go/parquet/internal/bmi/bmi_arm64.go:
##########
@@ -14,40 +14,38 @@
// See the License for the specific language governing permissions and
// limitations under the License.
+//go:build !noasm
// +build !noasm
package bmi
import (
"os"
"strings"
-)
-import (
- "golang.org/x/sys/cpu"
+
+ "github.com/klauspost/cpuid/v2"
)
func init() {
- // Added ability to enable extension via environment:
+ // Added ability to enable extension via environment:
// ARM_ENABLE_EXT=NEON go test
if ext, ok := os.LookupEnv("ARM_ENABLE_EXT"); ok {
exts := strings.Split(ext, ",")
for _, x := range exts {
switch x {
case "NEON":
- cpu.ARM64.HasASIMD = true
+ cpuid.CPU.Enable(cpuid.ASIMD)
case "AES":
- cpu.ARM64.HasAES = true
+ cpuid.CPU.Enable(cpuid.AESARM)
case "PMULL":
- cpu.ARM64.HasPMULL = true
+ cpuid.CPU.Enable(cpuid.PMULL)
default:
- cpu.ARM64.HasASIMD = false
- cpu.ARM64.HasAES = false
- cpu.ARM64.HasPMULL = false
+ cpuid.CPU.Disable(cpuid.ASIMD, cpuid.AESARM,
cpuid.PMULL)
Review Comment:
> technically we aren't actually _disabling_ the extensions on the CPU
Yes, I figured that out :-)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]