-
I am debugging an issue that is only present with IPv4 addresses with most significant bit set using Looking at the signatures I am wondering why some 64bit immediate instructions take Examples using func LoadImm(dst Register, value int64, size Size) Instruction
func StoreImm(dst Register, offset int16, value int64, size Size) Instruction Examples using func (op JumpOp) Imm(dst Register, value int32, label string) Instruction
func (op ALUOp) Imm(dst Register, value int32) Instruction Is there a reason why the later take |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
This is probably a bug: #1767
The BPF ISA only allows 32 bit immediates / constants, except for the special case of a 64bit LoadImm into a register, which is turned into two BPF instructions. For ease of use we chose to represent The reason
The reason that the top bit makes a difference is probably because it is interpreted as the sign bit. |
Beta Was this translation helpful? Give feedback.
This is probably a bug: #1767
The BPF ISA only allows 32 bit immediates / constants, except for the special case of a 64bit LoadImm into a register, which is turned into two BPF instructions. For ease of use we chose to represent
Constant
as 64bit so that this detail of the ISA doesn't leak into our abstraction.The reason
Imm
is confusing is that it needs to be understood together withImm32
. From the top of my head, haven't validated this:The reason …