Skip to content
Snippets Groups Projects
Commit f8f8909a authored by Aaron Sawdey's avatar Aaron Sawdey
Browse files

Make MMA builtins use opaque modes

This patch changes powerpc MMA builtins to use the new opaque
mode class and use modes OO (32 bytes) and XO (64 bytes)
instead of POI/PXI. Using the opaque modes prevents
optimization from trying to do anything with vector
pair/quad, which was the problem we were seeing with the
partial integer modes.

gcc/
	* config/rs6000/mma.md (unspec): Add assemble/extract UNSPECs.
	(movoi): Change to movoo.
	(*movpoi): Change to *movoo.
	(movxi): Change to movxo.
	(*movpxi): Change to *movxo.
	(mma_assemble_pair): Change to OO mode.
	(*mma_assemble_pair): New define_insn_and_split.
	(mma_disassemble_pair): New define_expand.
	(*mma_disassemble_pair): New define_insn_and_split.
	(mma_assemble_acc): Change to XO mode.
	(*mma_assemble_acc): Change to XO mode.
	(mma_disassemble_acc): New define_expand.
	(*mma_disassemble_acc): New define_insn_and_split.
	(mma_<acc>): Change to XO mode.
	(mma_<vv>): Change to XO mode.
	(mma_<avv>): Change to XO mode.
	(mma_<pv>): Change to OO mode.
	(mma_<apv>): Change to XO/OO mode.
	(mma_<vvi4i4i8>): Change to XO mode.
	(mma_<avvi4i4i8>): Change to XO mode.
	(mma_<vvi4i4i2>): Change to XO mode.
	(mma_<avvi4i4i2>): Change to XO mode.
	(mma_<vvi4i4>): Change to XO mode.
	(mma_<avvi4i4>): Change to XO mode.
	(mma_<pvi4i2>): Change to XO/OO mode.
	(mma_<apvi4i2>): Change to XO/OO mode.
	(mma_<vvi4i4i4>): Change to XO mode.
	(mma_<avvi4i4i4>): Change to XO mode.
	* config/rs6000/predicates.md (input_operand): Allow opaque.
	(mma_disassemble_output_operand): New predicate.
	* config/rs6000/rs6000-builtin.def:
	Changes to disassemble builtins.
	* config/rs6000/rs6000-call.c (rs6000_return_in_memory):
	Disallow __vector_pair/__vector_quad as return types.
	(rs6000_promote_function_mode): Remove function return type
	check because we can't test it here any more.
	(rs6000_function_arg): Do not allow __vector_pair/__vector_quad
	as as function arguments.
	(rs6000_gimple_fold_mma_builtin):
	Handle mma_disassemble_* builtins.
	(rs6000_init_builtins): Create types for XO/OO modes.
	* config/rs6000/rs6000-modes.def: DElete OI, XI,
	POI, and PXI modes, and create XO and OO modes.
	* config/rs6000/rs6000-string.c (expand_block_move):
	Update to OO mode.
	* config/rs6000/rs6000.c (rs6000_hard_regno_mode_ok_uncached):
	Update for XO/OO modes.
	(rs6000_rtx_costs): Make UNSPEC_MMA_XXSETACCZ cost 0.
	(rs6000_modes_tieable_p): Update for XO/OO modes.
	(rs6000_debug_reg_global): Update for XO/OO modes.
	(rs6000_setup_reg_addr_masks): Update for XO/OO modes.
	(rs6000_init_hard_regno_mode_ok): Update for XO/OO modes.
	(reg_offset_addressing_ok_p): Update for XO/OO modes.
	(rs6000_emit_move): Update for XO/OO modes.
	(rs6000_preferred_reload_class): Update for XO/OO modes.
	(rs6000_split_multireg_move): Update for XO/OO modes.
	(rs6000_mangle_type): Update for opaque types.
	(rs6000_invalid_conversion): Update for XO/OO modes.
	* config/rs6000/rs6000.h (VECTOR_ALIGNMENT_P):
	Update for XO/OO modes.
	* config/rs6000/rs6000.md (RELOAD): Update for XO/OO modes.
gcc/testsuite/
	* gcc.target/powerpc/mma-double-test.c (main): Call abort for failure.
	* gcc.target/powerpc/mma-single-test.c (main): Call abort for failure.
	* gcc.target/powerpc/pr96506.c: Rename to pr96506-1.c.
	* gcc.target/powerpc/pr96506-2.c: New test.
parent 1e2d8575
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