Skip to content
Snippets Groups Projects
Commit 4be3919f authored by Jose E. Marchesi's avatar Jose E. Marchesi
Browse files

bpf: sdiv/smod are now part of BPF V4

We used to support signed division and signed modulus instructions in
the XBPF GCC-specific extensions to BPF.  However, BPF catched up by
adding these instructions in the V4 of the ISA.

This patch changes GCC in order to use sdiv/smod instructions when
-mcpu=v4 or higher.  The testsuite and the manual have been updated
accordingly.

Tested in bpf-unknown-none.

gcc/ChangeLog

	PR target/110783
	* config/bpf/bpf.opt: New command-line option -msdiv.
	* config/bpf/bpf.md: Conditionalize sdiv/smod on bpf_has_sdiv.
	* config/bpf/bpf.cc (bpf_option_override): Initialize
	bpf_has_sdiv.
	* doc/invoke.texi (eBPF Options): Document -msdiv.

gcc/testsuite/ChangeLog

	PR target/110783
	* gcc.target/bpf/xbpf-sdiv-1.c: Renamed to sdiv-1.c
	* gcc.target/bpf/xbpf-smod-1.c: Renamed to smod-1.c
	* gcc.target/bpf/sdiv-1.c: Renamed from xbpf-sdiv-1.c, use -mcpu=v4.
	* gcc.target/bpf/smod-1.c: Renamed from xbpf-smod-1.c, use -mcpu=v4.
	* gcc.target/bpf/diag-sdiv.c: Use -mcpu=v3.
	* gcc.target/bpf/diag-smod.c: Likewise.
parent aa1e2d54
No related branches found
No related tags found
Loading
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