This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] microMIPS ASE instruction set support [Part 1]


This patch adds support for the microMIPS ASE instructions. microMIPS
reencodes the MIPS32 instruction set. Some new instructions are added as well. Calls between microMIPS and MIPS32 are handled in a similar way to MIPS16/MIPS32 calls. microMIPS and MIPS16 code may not be intermixed.


I have two additional patches to post. One is the testsuite changes to support MICROMIPS. The other patch adds linux target support.

I've tested using mips-sde-elf and a microMIPS-aware QEMU.
Multilibs for microMIPS with endian and floating point variants have been added.


Please let me know if this patch looks okay to commit.

Catherine


2010-06-15 Chao-Ying Fu  <fu@mips.com>
           Maciej W. Rozycki  <macro@codesourcery.com>
	   Nathan Froyd  <froydnj@codesourcery.com>
	   Nathan Sidwell  <nathan@codesourcery.com>
	   Catherine Moore  <clm@codesourcery.com>

	* doc/extend.texi (micromips attribute): Document.
	* doc/invoke.texi (-mmicromips): Document new option.
	(-mjals): Document new option..
	(processor names): Add m14k and m14kc.
	(mno-interlink-mips16): Document microMIPS.
	(-mmcu): Document new option.
	* doc/md.texi (YC): Document new constraint.

	* passes.c (init_optimization_passes): Call peephole2.

	* config/mips/micromips.md (New file).
	* config/mips/constraints.md (R): Update for micromips.
	(YB): Likewise.
	(YD): Likewise.
	(YC): New constraint.
	
	* config/mips/mips.md (multimem): New type attribute.
	(micromips_type): New attribute.
	(micromips_ashl<mode>3), (micromips_ashr<mode>3),
	(micromips_lshr<mode>3), (branch_equality<mode>_micromips),
	(branch_equality<mode>_inverted_micromips): New insns.

	(<optab><mode>3), (branch_equality<mode>), 
	(branch_equality<mode>_inverted), (jump_pic),
	(indirect_jump<mode>), (tablejump<mode>),
	(return), (return_internal), (sibcall_internal),
	(sibcall_value_internal), (sibcall_value_multiple_internal):
	Exclude/include based on TARGET_MICROMIPS setting.

	(mov_<load>l), (mov_<load>r), (mov_<store>l), (mov_<store>r):
	Use YC operand constraints.

	(mfhi<GPR:mode>_<HILO:mode>), (add<mode>3), (sub<mode>3),
	(zero_extend<SHORT:mode><GPR:mode>2),
	(one_cmpl<mode>2), (ior<mode>3): Set micromips_type attribute.

	(micromips.md): Include.

	* config/mips.opt (mjals): New.
	(mmicromips): New.
	(mmcu): New.
	* config/mips/sync.md (sync_compare_and_swap<mode>),
	(compare_and_swap_12), (sync_add<mode>), (sync_<optab>_12),
	(sync_old_<optab><mode>), (sync_new_<optab><mode>),
	(sync_nand_12), (sync_old_nand<mode>), (sync_new_nand<mode>),
	(sync_new_nand_12), (sync_sub<mode>), (sync_old_add<mode>),
	(sync_old_sub<mode>), (sync_new_add<mode>),
	(sync_new_sub<mode>), (sync_<optab><mode>),
	(sync_old_<optab><mode>), (sync_new_<optab><mode>),
	(sync_nand<mode>), (sync_old_nand<mode>),
	(sync_new_nand<mode>), (sync_lock_test_and_set<mode>),
	(test_and_set_12): Update patterns to use constraint YC.

	* config/mips/sdemtk.h (MIPS_ARCH_FLOAT_SPEC): New.
	* config/mips/mips16.S: Check for microMIPS.
	* config/mips/mips-protos.h (mips_address_insns): Add argument.

	* config/mips/mips.c (MIPS_MAX_FIRST_STACK_STEP): Handle microMIPS.
	(mips_base_micromips): New.
	(mips_attribute_table): Add micromips and nomicromips.
	(mips_cpu_info_table): Add m14k and m14kc.
	(mips_micromips_decl_p): New.
	(mips_nomicromips_decl_p): New.
	(mips_use_micromips_mode_p): New.
	(mips_insert_attributes): Handle micromips attributes.
	(mips_merge_decl_attributes): Likewise.
	(mips_address_insn): Add argument might_split_p.
	Handle twelve bit offsets.
	(mips_rtx_costs): Update call to mips_address_insns.
	(mips_address_cost): Likewise.
	(mips_start_function_definition): Handle TARGET_MICROMIPS.
	(mips_function_ok_for_sibcall): Likewise.
	(mips_print_operand_punctuation): Add ':' and '!' to handle
	compact instructions and short delay slots.
	(mips_init_print_operand_punct): Add ':' and '!'.
	(micromips_build_save_restore): New.
	(mips_for_each_saved_gpr_and_fpr): Handle TARGET_MICROMIPS.
	(mips_expand_epilogue): Make use of jraddisup instruction.
	(mips_set_mips16_mode): Rename to...
	(mips_set_mips16_micromips_mode): ...this and handle micromips.
	Update all callers.
	(mips_override_options): Handle microMIPS.
	(micromips_save_restore_pattern_p): New.
	(micromips_output_save_restore): New.
	(micromips_load_store_pair_p): New.
	(micromips_output_load_store_pair): New.
	(micromips_movep_target_p): New.

	* config/mips/mips.h (TARGET_CPU_CPP_BUILTINS): Add
	builtins to support microMIPS.
	(ASM_SPEC): Handle mmicromips and mmcu.
	(ISA_HAS_LWXS): Include TARGET_MICROMIPS.
	(ISA_HAS_DSP): Exclude TARGET_MICROMIPS.
	(ISA_has_DSPR2): Likewise.
	(M16STORE_REG_P): New.
	(MIPS_CALL) Handle TARGET_JALS and TARGET_MICROMIPS.
	(MICROMIPS_J): New.

	* config/mips/t-sde (MULTILIB_OPTIONS): Add mmicromips.
	(MULTILIB_DIRNAMES): Add mmicromips.
	(MULTILIB_EXTRA_OPTS): New.
	(MULTILIB_EXCLUSION): Build a limited number of 
	microMIPS multilibs.

Attachment: gcc.micromips.patch.bz2
Description: application/bzip


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]