Re: [PATCH] bpf, docs: Fix modulo zero, division by zero, overflow, and underflow

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> +Also note that the division and modulo operations are unsigned.
> +Thus, for `BPF_ALU`, 'imm' is first converted to an unsigned
> +32-bit value, whereas for `BPF_ALU64`, 'imm' is first sign extended
> +to 64 bits and then converted to an unsigned 64-bit value.  There
> +are no instructions for signed division or modulo.

English is not my native language, but I think "converted" may be too
generic for this paragraph: are the same bits reinterpreted as unsigned?
Or an actual conversion like absolute value is performed?

Wouldn't it be better to say "interpreted as" instead of "converted to"
in this case?

Something like this:

  "Also note that the division and modulo operations are unsigned.
   Thus, for `BPF_ALU`, 'imm' is interpreted as an unsigned 32-bit
   value, whereas for `BPF_ALU64`, 'imm' is first sign extended to 64
   bits and the result interpreted as an unsigned 64-bit value.  There
   are no instructions for signed division or modulo."



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux