Skip to content
Snippets Groups Projects
Commit edf4db83 authored by liuhongt's avatar liuhongt
Browse files

Canonicalize (vec_merge (fma: op2 op1 op3) (match_dup 1)) mask) to (vec_merge...

Canonicalize (vec_merge (fma: op2 op1 op3) (match_dup 1)) mask) to (vec_merge (fma: op1 op2 op3) (match_dup 1)) mask)

For masked FMA, there're 2 forms of RTL representation
1) (vec_merge (fma: op2 op1 op3) op1) mask)
2) (vec_merge (fma: op1 op2 op3) op1) mask)
It's because op1 op2 are communatative in RTL(the second op1 is
written as (match_dup 1))

we once tried to replace (match_dup 1)
with (match_operand:VFH_AVX512VL 5 "nonimmediate_operand" "0,0")), but
trigger an ICE in reload(reload can handle at most one operand with
"0" constraint).

So the patch do the canonicalizaton for the backend part.

gcc/ChangeLog:

	PR target/117072
	* config/i386/sse.md (<avx512>_fmadd_<mode>_mask<round_name>):
	Relax predicates of fma operands from register_operand to
	nonimmediate_operand.
	(<avx512>_fmadd_<mode>_mask3<round_name>): Ditto.
	(<avx512>_fmsub_<mode>_mask<round_name>): Ditto.
	(<avx512>_fmsub_<mode>_mask3<round_name>): Ditto.
	(<avx512>_fnmadd_<mode>_mask<round_name>): Ditto.
	(<avx512>_fnmadd_<mode>_mask3<round_name>): Ditto.
	(<avx512>_fnmsub_<mode>_mask<round_name>): Ditto.
	(<avx512>_fnmsub_<mode>_mask3<round_name>): Ditto.
	(<avx512>_fmaddsub_<mode>_mask3<round_name>): Ditto.
	(<avx512>_fmsubadd_<mode>_mask<round_name>): Ditto.
	(<avx512>_fmsubadd_<mode>_mask3<round_name>): Ditto.
	(avx512f_vmfmadd_<mode>_mask<round_name>): Ditto.
	(avx512f_vmfmadd_<mode>_mask3<round_name>): Ditto.
	(avx512f_vmfmadd_<mode>_maskz_1<round_name>): Ditto.
	(*avx512f_vmfmsub_<mode>_mask<round_name>): Ditto.
	(avx512f_vmfmsub_<mode>_mask3<round_name>): Ditto.
	(*avx512f_vmfmsub_<mode>_maskz_1<round_name>): Ditto.
	(avx512f_vmfnmadd_<mode>_mask<round_name>): Ditto.
	(avx512f_vmfnmadd_<mode>_mask3<round_name>): Ditto.
	(avx512f_vmfnmadd_<mode>_maskz_1<round_name>): Ditto.
	(*avx512f_vmfnmsub_<mode>_mask<round_name>): Ditto.
	(*avx512f_vmfnmsub_<mode>_mask3<round_name>): Ditto.
	(*avx512f_vmfnmsub_<mode>_maskz_1<round_name>): Ditto.
	(avx10_2_fmaddnepbf16_<mode>_mask3): Ditto.
	(avx10_2_fnmaddnepbf16_<mode>_mask3): Ditto.
	(avx10_2_fmsubnepbf16_<mode>_mask3): Ditto.
	(avx10_2_fnmsubnepbf16_<mode>_mask3): Ditto.
	(fmai_vmfmadd_<mode><round_name>): Swap operands[1] and operands[2].
	(fmai_vmfmsub_<mode><round_name>): Ditto.
	(fmai_vmfnmadd_<mode><round_name>): Ditto.
	(fmai_vmfnmsub_<mode><round_name>): Ditto.
	(*fmai_fmadd_<mode>): Swap operands[1] and operands[2] adjust
	operands[1] predicates from register_operand to
	nonimmediate_operand.
	(*fmai_fmsub_<mode>): Ditto.
	(*fmai_fnmadd_<mode><round_name>): Ditto.
	(*fmai_fnmsub_<mode><round_name>): Ditto.
parent 330782a1
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