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,SH] Add SH2A new instructions


Hi,

Renesas has added about 36 new instructions in SH2A target. Almost 29
of these instructions were not implemented in GCC. We had taken the 
task of identifying these unimplemented instructions and implementing
these in GCC in phases. 
Following instructions are implemented in this patch,
Bit Manipulation Instructions: 
	BSET, BCLR, BOR, BXOR, BAND, BLD, BST
BANK Instructions: 
	RESBANK
Data Transfer Instructions: 
	MOVI20S, MOVRT
Jump Instructions: 
	RTS/N, JSR/N, JSR/N @@
Pipeline Instructions:
	PREF

Please find attached "sh2a.tar.bz2" containing patch implementing 
above mentioned instructions.

Some values had to be masked in BSET (memory mode) to avoid regression
failures. There are 5 extra regressions due to BST patch in G++ for   
SH2A-NO-FPU target. Any help in rectifying the above problems in the 
patch would be highly appreciated.

ChangeLog
2007-09-21	Anil Paranjape <anil.paranjape@kpitcummins.com>
          	Naveen.H.S <naveen.hs@kpitcummins.com>
          	Jayant Sonar <Jayant.sonar@kpitcummins.com>
          	Mukesh Srivastava <mukesh.srivastava@kpitcummins.com>
            
	* config/sh/constraints.md (I28): New.
	* config/sh/predicates.md (andor_logical_operator): New.
	(single_one_operand): New.
	(single_zero_operand): New.
	(single_zero1_operand): New.
	* config/sh/sh.c (SH_ATTRIBUTES): Define.
	(SYMBOL_FLAG_FUNCVEC_FUNCTION): Define.
	(print_operand): "@" prints resbank if the instruction RESBANK 
	has to be generated.
	"c" prints AND/OR/XOR depending on the operation performed.
	"t" prints the address.
	"V" prints the LOG value of the input value.
	"W" prints the LOG value of the input value by complementing it.
	"Y" prints the LOG value of the input value by XORing it.
	(sh_encode_section_info): New.
	(broken_move): Add the condition for I28 values.
	(push_regs): Add conditions for resbank.
	(sh_expand_epilogue): Add conditions for resbank.
	(sh_gimplify_va_arg_expr): Add condition for SH2A.
	(sh_insert_attributes): Add resbank attribute.
	(sh_attribute_table): Add resbank and function_vector
attributes.
	(sh_handle_resbank_handler_attribute): New.
	(sh2a_handle_function_vector_handler_attribute): New.
	(sh2a_is_function_vector_call): New.
	(sh2a_get_function_vector_number): New.
	(sh2a_function_vector_p): New.
	(sh_cfun_resbank_handler_p): New.
	(sh_expand_t_scc): Generate MOVRT for a specific condition 
	for SH2A target.
	* config/sh/sh.h (CONST_OK_FOR_I20): New.
	(CONST_OK_FOR_I28): New.
	* config/sh/sh.md: sh2a.md: Include.
	(movsi_ie): Add new instruction MOVI20S.
	(calli): Add JSR/N instruction if the instruction does not
	have delay slot.
	(calli_tbr_rel): New.
	(calli_pcrel): Add JSR/N instruction if the instruction does 
	not have delay slot.
	(return_i): Add RTS/N instruction if the instruction does not
	have delay slot.
	(call_valuei_tbr_rel): New.
	(call_valuei_pcrel): Add condition for SH2A target.
	(call_value): Add condition for SH2A target.
	(insv): Add conditions to generate BSET, BCLR and BST 
	instructions in memory mode.
	(extzv): Add conditions to generate BLD instruction in memory
mode.
	(prefetch): Add condition for SH2A target.
	(prefetch_sh2a): New.
	* config/sh/sh-protos.h (sh_cfun_resbank_handler_p): Prototype.
	(sh2a_get_function_vector_number): Prototype.
	(sh2a_is_function_vector_call): Prototype.
	* doc/extend.texi (TBR relative addressing): Added description 
	for SH2A target.
	(resbank): Added description for SH2A target.
	* config/sh/sh2a.md: New File.
	* testsuite/gcc.dg/sh2a-resbank.c : New.
	* testsuite/gcc.dg/sh2a-tbr-jump.c: New.
            
Regards,
Naveen.H.S.
KPIT Cummins Infosystems Ltd,
Pune (INDIA) 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~	
Free download of GNU based tool-chains for Renesas' SH, H8, R8C, M16C	
and M32C Series. The following site also offers free technical support	
to its users. Visit http://www.kpitgnutools.com for details. 	
Latest versions of KPIT GNU tools were released on June 1, 2007.	
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~	

Attachment: sh2a.tar.bz2
Description: sh2a.tar.bz2


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