Skip to content

Commit

Permalink
ARROW-17372: [Go][Parquet] Fix failures for ppc64le (#13840)
Browse files Browse the repository at this point in the history
This PR fixes failures regarding the apache arrow go&/parquet module as described here:

https://issues.apache.org/jira/browse/ARROW-17372

Signed-off-by: Marvin Giessing <[email protected]>

Authored-by: Marvin Giessing <[email protected]>
Signed-off-by: Matt Topol <[email protected]>
  • Loading branch information
mgiessing authored Aug 11, 2022
1 parent 440f786 commit 89b39bc
Show file tree
Hide file tree
Showing 12 changed files with 357 additions and 3 deletions.
25 changes: 25 additions & 0 deletions go/arrow/bitutil/bitmap_ops_ppc64le.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// 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.

//go:build !noasm
// +build !noasm

package bitutil

func init() {
bitAndOp.opAligned = alignedBitAndGo
bitOrOp.opAligned = alignedBitOrGo
}
6 changes: 3 additions & 3 deletions go/arrow/math/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,15 @@ INTEL_SOURCES := \
assembly: $(INTEL_SOURCES)

generate: ../bin/tmpl
../bin/tmpl -i -data=float64.tmpldata type.go.tmpl=float64.go type_amd64.go.tmpl=float64_amd64.go type_arm64.go.tmpl=float64_arm64.go type_s390x.go.tmpl=float64_s390x.go type_noasm.go.tmpl=float64_noasm.go type_test.go.tmpl=float64_test.go
../bin/tmpl -i -data=float64.tmpldata type.go.tmpl=float64.go type_amd64.go.tmpl=float64_amd64.go type_arm64.go.tmpl=float64_arm64.go type_ppc64le.go.tmpl=float64_ppc64le.go type_s390x.go.tmpl=float64_s390x.go type_noasm.go.tmpl=float64_noasm.go type_test.go.tmpl=float64_test.go
../bin/tmpl -i -data=float64.tmpldata -d arch=avx2 type_simd_amd64.go.tmpl=float64_avx2_amd64.go
../bin/tmpl -i -data=float64.tmpldata -d arch=sse4 type_simd_amd64.go.tmpl=float64_sse4_amd64.go
../bin/tmpl -i -data=float64.tmpldata -d arch=neon type_simd_arm64.go.tmpl=float64_neon_arm64.go
../bin/tmpl -i -data=int64.tmpldata type.go.tmpl=int64.go type_amd64.go.tmpl=int64_amd64.go type_arm64.go.tmpl=int64_arm64.go type_s390x.go.tmpl=int64_s390x.go type_noasm.go.tmpl=int64_noasm.go type_test.go.tmpl=int64_test.go
../bin/tmpl -i -data=int64.tmpldata type.go.tmpl=int64.go type_amd64.go.tmpl=int64_amd64.go type_arm64.go.tmpl=int64_arm64.go type_ppc64le.go.tmpl=int64_ppc64le.go type_s390x.go.tmpl=int64_s390x.go type_noasm.go.tmpl=int64_noasm.go type_test.go.tmpl=int64_test.go
../bin/tmpl -i -data=int64.tmpldata -d arch=avx2 type_simd_amd64.go.tmpl=int64_avx2_amd64.go
../bin/tmpl -i -data=int64.tmpldata -d arch=sse4 type_simd_amd64.go.tmpl=int64_sse4_amd64.go
../bin/tmpl -i -data=int64.tmpldata -d arch=neon type_simd_arm64.go.tmpl=int64_neon_arm64.go
../bin/tmpl -i -data=uint64.tmpldata type.go.tmpl=uint64.go type_amd64.go.tmpl=uint64_amd64.go type_arm64.go.tmpl=uint64_arm64.go type_s390x.go.tmpl=uint64_s390x.go type_noasm.go.tmpl=uint64_noasm.go type_test.go.tmpl=uint64_test.go
../bin/tmpl -i -data=uint64.tmpldata type.go.tmpl=uint64.go type_amd64.go.tmpl=uint64_amd64.go type_arm64.go.tmpl=uint64_arm64.go type_ppc64le.go.tmpl=uint64_ppc64le.go type_s390x.go.tmpl=uint64_s390x.go type_noasm.go.tmpl=uint64_noasm.go type_test.go.tmpl=uint64_test.go
../bin/tmpl -i -data=uint64.tmpldata -d arch=avx2 type_simd_amd64.go.tmpl=uint64_avx2_amd64.go
../bin/tmpl -i -data=uint64.tmpldata -d arch=sse4 type_simd_amd64.go.tmpl=uint64_sse4_amd64.go
../bin/tmpl -i -data=uint64.tmpldata -d arch=neon type_simd_arm64.go.tmpl=uint64_neon_arm64.go
Expand Down
25 changes: 25 additions & 0 deletions go/arrow/math/float64_ppc64le.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 25 additions & 0 deletions go/arrow/math/int64_ppc64le.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 29 additions & 0 deletions go/arrow/math/math_ppc64le.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// 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.

// +build !noasm

package math

func init() {
initGo()
}

func initGo() {
initFloat64Go()
initInt64Go()
initUint64Go()
}
25 changes: 25 additions & 0 deletions go/arrow/math/type_ppc64le.go.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// 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.

// +build !noasm

package math

{{with .In}}
func init{{.Name}}Go() {
{{.Name}}.sum = sum_{{.Type}}_go
}
{{end}}
25 changes: 25 additions & 0 deletions go/arrow/math/uint64_ppc64le.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 31 additions & 0 deletions go/internal/utils/min_max_ppc64le.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// 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.

//go:build !noasm
// +build !noasm

package utils

func init() {
minmaxFuncs.i8 = int8MinMax
minmaxFuncs.ui8 = uint8MinMax
minmaxFuncs.i16 = int16MinMax
minmaxFuncs.ui16 = uint16MinMax
minmaxFuncs.i32 = int32MinMax
minmaxFuncs.ui32 = uint32MinMax
minmaxFuncs.i64 = int64MinMax
minmaxFuncs.ui64 = uint64MinMax
}
97 changes: 97 additions & 0 deletions go/internal/utils/transpose_ints_ppc64le.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 24 additions & 0 deletions go/parquet/internal/bmi/bitmap_bmi2_ppc64le.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// 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.

// +build !noasm

package bmi

func init() {
funclist.extractBits = extractBitsGo
funclist.gtbitmap = greaterThanBitmapGo
}
23 changes: 23 additions & 0 deletions go/parquet/internal/utils/bit_packing_ppc64le.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// 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.

// +build !noasm

package utils

import "io"

var unpack32 func(io.Reader, []uint32, int) int = unpack32Default
25 changes: 25 additions & 0 deletions go/parquet/internal/utils/unpack_bool_ppc64le.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// 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.

// +build !noasm

package utils

// BytesToBools when built with the noasm tag will direct to the pure go implementation
// for converting a bitmap to a slice of bools
func BytesToBools(in []byte, out []bool) {
bytesToBoolsGo(in, out)
}

0 comments on commit 89b39bc

Please sign in to comment.