[PATCH] bpf: use xBPF signed div, mod insns when available

Jeff Law law@redhat.com
Thu Sep 17 22:51:58 GMT 2020


On 9/17/20 11:15 AM, David Faust via Gcc-patches wrote:
> The 'mod' and 'div' operators in eBPF are unsigned, with no signed
> counterpart. xBPF adds two new ALU operations, sdiv and smod, for
> signed division and modulus, respectively. Update bpf.md with
> 'define_insn' blocks for signed div and mod to use them when targetting
> xBPF, and add new tests to ensure they are used appropriately.
>
> 2020-09-17  David Faust  <david.faust@oracle.com>
>
> gcc/
> 	* config/bpf/bpf.md: Add defines for signed div and mod operators.
>
> gcc/testsuite/
> 	* gcc.target/bpf/diag-sdiv.c: New test.
> 	* gcc.target/bpf/diag-smod.c: New test.
> 	* gcc.target/bpf/xbpf-sdiv-1.c: New test.
> 	* gcc.target/bpf/xbpf-smod-1.c: New test.

OK.  But give Jose 48hrs before committing just in case there's
something he wants to comment on.  Y'all are far more familiar with bpf
than I ;-)


jeff


-------------- next part --------------
A non-text attachment was scrubbed...
Name: pEpkey.asc
Type: application/pgp-keys
Size: 1733 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20200917/642aa303/attachment.bin>


More information about the Gcc-patches mailing list