Skip to content
Snippets Groups Projects
Unverified Commit aab1c5dc authored by Xi Ruoyao's avatar Xi Ruoyao
Browse files

LoongArch: Remove unneeded sign extension after crc/crcc instructions

The specification of crc/crcc instructions is clear that the output is
sign-extended to GRLEN.  Add a define_insn to tell the compiler this
fact and allow it to remove the unneeded sign extension on crc/crcc
output.  As crc/crcc instructions are usually used in a tight loop,
this should produce a significant performance gain.

gcc/ChangeLog:

	* config/loongarch/loongarch.md
	(loongarch_<crc>_w_<size>_w_extended): New define_insn.

gcc/testsuite/ChangeLog:

	* gcc.target/loongarch/crc-sext.c: New test;
parent c556ea07
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