public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH 0/3] bpf: add -mcpu and related feature options
@ 2021-09-09 21:36 David Faust
  2021-09-09 21:36 ` [PATCH 1/3] " David Faust
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: David Faust @ 2021-09-09 21:36 UTC (permalink / raw)
  To: gcc-patches

New instructions have been added over time to the eBPF ISA, but
previously there has been no good method to select which version to
target in GCC.

This patch adds the following options to the BPF backend:

  -mcpu={v1, v2, v3}
    Select which version of the eBPF ISA to target. This enables or
    disables generation of certain instructions. The default is v3.

  -mjmpext
    Enable extra conditional branch instructions.
    Enabled for CPU v2 and above.

  -mjmp32
    Enable 32-bit jump/branch instructions.
    Enabled for CPU v3 and above.

  -malu32
    Enable 32-bit ALU instructions.
    Enabled for CPU v3 and above.

Negative versions of -mjmpext, -mjmp32, and -malu32 options are also
supported.

David Faust (3):
  bpf: add -mcpu and related feature options
  bpf testsuite: add tests for new feature options
  doc: document BPF -mcpu and related options

 gcc/config/bpf/bpf-opts.h            |  7 ++++
 gcc/config/bpf/bpf-protos.h          |  1 +
 gcc/config/bpf/bpf.c                 | 41 ++++++++++++++++++++
 gcc/config/bpf/bpf.md                | 44 +++++++++++----------
 gcc/config/bpf/bpf.opt               | 29 ++++++++++++++
 gcc/doc/invoke.texi                  | 39 ++++++++++++++++++-
 gcc/testsuite/gcc.target/bpf/alu-1.c | 56 +++++++++++++++++++++++++++
 gcc/testsuite/gcc.target/bpf/jmp-1.c | 57 ++++++++++++++++++++++++++++
 8 files changed, 253 insertions(+), 21 deletions(-)
 create mode 100644 gcc/testsuite/gcc.target/bpf/alu-1.c
 create mode 100644 gcc/testsuite/gcc.target/bpf/jmp-1.c

-- 
2.33.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-09-10 14:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-09 21:36 [PATCH 0/3] bpf: add -mcpu and related feature options David Faust
2021-09-09 21:36 ` [PATCH 1/3] " David Faust
2021-09-09 21:36 ` [PATCH 2/3] bpf testsuite: add tests for new " David Faust
2021-09-09 21:36 ` [PATCH 3/3] doc: document BPF -mcpu and related options David Faust
2021-09-10 14:11 ` [PATCH 0/3] bpf: add -mcpu and related feature options Jose E. Marchesi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).