This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] Add new target h8300-*-linux
- From: Jeff Law <law at redhat dot com>
- To: Yoshinori Sato <ysato at users dot sourceforge dot jp>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 20 Apr 2015 09:26:21 -0600
- Subject: Re: [PATCH] Add new target h8300-*-linux
- Authentication-results: sourceware.org; auth=none
- References: <87twxz75id dot wl-ysato at users dot sourceforge dot jp> <55313A9F dot 6040304 at redhat dot com> <87618rjtbe dot wl-ysato at users dot sourceforge dot jp>
On 04/19/2015 10:51 PM, Yoshinori Sato wrote:
Hmmm, IIRC the port has many places where it may assume that H8300H is
set for H8300S/H8300SX. I did a very quick audit and saw:
+ if (TARGET_H8300H && (TARGET_H8300S || TARGET_H8300SX))
+ target_flags ^= MASK_H8300H;
I'm a bit concerned by this. Why did you need to make this change?
The flag is exclusion, but it's set both.
I would recommend reviewing the extzv_16_8 pattern which has the
condition "TARGET_H8300H" and changing the condition to
"TARGET_H8300H || TARGET_H8300S" since AFAICT that pattern should work
on both processor variants.
Similarly there's two peephole patterns have have conditions that looks
"(TARGET_H8300H || TARGET_H8300S)
&& peep2_reg_dead_p (1, operands)
&& ((TARGET_H8300H && INTVAL (operands) == 3)
|| INTVAL (operands) == 7
|| INTVAL (operands) == 15
|| INTVAL (operands) == 31
|| INTVAL (operands) == 63
|| INTVAL (operands) == 127
|| INTVAL (operands) == 255)"
I'm pretty sure the second TARGET_H8300H should be (TARGET_H8300H ||
In h8300.c::get_shift_alg, case HIshift, count 14, does this need to change?
else if (TARGET_H8300H)
info->cc_special = CC_SET_ZNV;
else /* TARGET_H8300S */
Similarly SImode shifts by 28-30 bits should be reviewed in a similar
manner. As should the implementation of h8300_shift_needs_scratch_p.
output_a_rotate also needs to be reviewed if you want to make the change
to turn off H8300H when H8/S is true. Similarly for
There may be others, these are what I found with a very quick search.
If there's not a compelling reason to make the change, I'd recommend