zeroshade commented on code in PR #14255: URL: https://github.com/apache/arrow/pull/14255#discussion_r982535720
########## go/arrow/compute/internal/kernels/base_arithmetic.go: ########## @@ -0,0 +1,141 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package kernels + +import ( + "fmt" + "math/bits" + + "github.com/apache/arrow/go/v10/arrow" + "github.com/apache/arrow/go/v10/arrow/compute/internal/exec" + "github.com/apache/arrow/go/v10/arrow/internal/debug" + "golang.org/x/exp/constraints" +) + +type ArithmeticOp int8 + +const ( + OpAdd ArithmeticOp = iota + OpAddChecked + OpSub + OpSubChecked +) + +func getGoArithmeticBinaryOpsFloating[T constraints.Float](op ArithmeticOp) binaryOps[T, T, T] { Review Comment: not all consumers can, or are willing, to use the generated assembly. Generating the assembly makes the result non-portable so there needs to be a fallback pure-go implementation for anyone that uses the `noasm` tag or is running this on a non-x86_64 processor (since I didn't generate powerpc, arm64, or s390x versions here). This function is the pure-go version for those cases -- 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]
