]> git.ipfire.org Git - thirdparty/gcc.git/commit
bpf: ISA V4 sign-extending move and load insns [PR110782,PR110784]
authorDavid Faust <david.faust@oracle.com>
Thu, 27 Jul 2023 20:55:44 +0000 (13:55 -0700)
committerDavid Faust <david.faust@oracle.com>
Thu, 27 Jul 2023 22:35:52 +0000 (15:35 -0700)
commit14dab1a1bcc3f0315e33d166df06520fba409c9b
treea943632c09b2ae482e683e6822c45cd5ba55e473
parent9cbf4286a9d126e2fd8d2989313761d21614d288
bpf: ISA V4 sign-extending move and load insns [PR110782,PR110784]

BPF ISA V4 introduces sign-extending move and load operations.  This
patch makes the BPF backend generate those instructions, when enabled
and useful.

A new option, -m[no-]smov gates generation of these instructions, and is
enabled by default for -mcpu=v4 and above.  Tests for the new
instructions and documentation for the new options are included.

PR target/110782
PR target/110784

gcc/

* config/bpf/bpf.opt (msmov): New option.
* config/bpf/bpf.cc (bpf_option_override): Handle it here.
* config/bpf/bpf.md (*extendsidi2): New.
(extendhidi2): New.
(extendqidi2): New.
(extendsisi2): New.
(extendhisi2): New.
(extendqisi2): New.
* doc/invoke.texi (Option Summary): Add -msmov eBPF option.
(eBPF Options): Add -m[no-]smov.  Document that -mcpu=v4
also enables -msmov.

gcc/testsuite/

* gcc.target/bpf/sload-1.c: New test.
* gcc.target/bpf/sload-pseudoc-1.c: New test.
* gcc.target/bpf/smov-1.c: New test.
* gcc.target/bpf/smov-pseudoc-1.c: New test.
gcc/config/bpf/bpf.cc
gcc/config/bpf/bpf.md
gcc/config/bpf/bpf.opt
gcc/doc/invoke.texi
gcc/testsuite/gcc.target/bpf/sload-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/bpf/sload-pseudoc-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/bpf/smov-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/bpf/smov-pseudoc-1.c [new file with mode: 0644]