Skip to content

Commit

Permalink
fix(arrow/bitutil): fix bitmap ops on 32-bit platforms (#277)
Browse files Browse the repository at this point in the history
### Rationale for this change
Fixes the broken 32-bit arch tests identified by #32 

### What changes are included in this PR?
Defining the `opAligned` pure go fallback methods for bitmap operations.

### Are these changes tested?
Yes, it makes the tests succeed properly on `GOARCH=386`

### Are there any user-facing changes?
No.
  • Loading branch information
zeroshade authored Feb 12, 2025
1 parent 91a941b commit 1d3100c
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions arrow/bitutil/bitmaps.go
Original file line number Diff line number Diff line change
Expand Up @@ -465,20 +465,24 @@ type bitOp struct {

var (
bitAndOp = bitOp{
opWord: func(l, r uint64) uint64 { return l & r },
opByte: func(l, r byte) byte { return l & r },
opWord: func(l, r uint64) uint64 { return l & r },
opByte: func(l, r byte) byte { return l & r },
opAligned: alignedBitAndGo,
}
bitOrOp = bitOp{
opWord: func(l, r uint64) uint64 { return l | r },
opByte: func(l, r byte) byte { return l | r },
opWord: func(l, r uint64) uint64 { return l | r },
opByte: func(l, r byte) byte { return l | r },
opAligned: alignedBitOrGo,
}
bitAndNotOp = bitOp{
opWord: func(l, r uint64) uint64 { return l &^ r },
opByte: func(l, r byte) byte { return l &^ r },
opWord: func(l, r uint64) uint64 { return l &^ r },
opByte: func(l, r byte) byte { return l &^ r },
opAligned: alignedBitAndNotGo,
}
bitXorOp = bitOp{
opWord: func(l, r uint64) uint64 { return l ^ r },
opByte: func(l, r byte) byte { return l ^ r },
opWord: func(l, r uint64) uint64 { return l ^ r },
opByte: func(l, r byte) byte { return l ^ r },
opAligned: alignedBitXorGo,
}
)

Expand Down

0 comments on commit 1d3100c

Please sign in to comment.