Skip to content
Snippets Groups Projects
Commit 14dab1a1 authored by David Faust's avatar David Faust
Browse files

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.
parent 9cbf4286
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment