// Information from the compiler about the layout of stack frames.typebitvectorstruct {
nint32// # of bitsbytedata*uint8
}
// ptrbit returns the i'th bit in bv.func (bv*bitvector) ptrbit(iuintptr) uint8 {
b:=*(addb(bv.bytedata, i/8))
return (b>> (i%8)) &1
}
ptrbit should generate a BTL instruction on amd64, but instead it generates RSH and AND. (Related work: CL 105037.) IIRC, we intentionally don't generate BTL instructions for constant-offset bit tests for bytes, since the equivalent TEST instruction is shorter or faster.
Conversation moved from CL 109716.
Consider this code from the runtime:
ptrbit should generate a BTL instruction on amd64, but instead it generates RSH and AND. (Related work: CL 105037.) IIRC, we intentionally don't generate BTL instructions for constant-offset bit tests for bytes, since the equivalent TEST instruction is shorter or faster.
cc @rasky
The text was updated successfully, but these errors were encountered: