Skip to content

Commit

Permalink
Fix up arm
Browse files Browse the repository at this point in the history
  • Loading branch information
klauspost committed Aug 31, 2024
1 parent 3b1650e commit ae64915
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
13 changes: 10 additions & 3 deletions galois_arm64.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,12 @@ func galMulSlice(c byte, in, out []byte, o *options) {
return
}
var done int
galMulNEON(mulTableLow[c][:], mulTableHigh[c][:], in, out)
done = (len(in) >> 5) << 5
if raceEnabled {
raceReadSlice(in[:done])
raceWriteSlice(out[:done])
}
galMulNEON(mulTableLow[c][:], mulTableHigh[c][:], in, out)

remain := len(in) - done
if remain > 0 {
Expand All @@ -50,9 +54,12 @@ func galMulSliceXor(c byte, in, out []byte, o *options) {
sliceXor(in, out, o)
return
}
var done int
done := (len(in) >> 5) << 5
if raceEnabled {
raceReadSlice(in[:done])
raceWriteSlice(out[:done])
}
galMulXorNEON(mulTableLow[c][:], mulTableHigh[c][:], in, out)
done = (len(in) >> 5) << 5

remain := len(in) - done
if remain > 0 {
Expand Down
2 changes: 1 addition & 1 deletion xor_arm64.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ func sliceXor(in, out []byte, o *options) {
done := (len(in) >> 5) << 5
if raceEnabled {
raceWriteSlice(out[:done])
raceReadSlices(in[:done])
raceReadSlice(in[:done])
}
xorSliceNEON(in, out)

Expand Down

0 comments on commit ae64915

Please sign in to comment.