On Mon, 2014-05-12 at 19:32 +0900, Kaz Kojima wrote:
> [I'd like to add Oleg to CC list.]
> 
> Christian Bruel <christian.br...@st.com> wrote:
> > Just saw the Jeff's approval for the RTL part. Sorry for the crossed answers
> > 
> > remains the target maintainers.  Joern, Kaz ?
> 
> SH specific part looks OK to me.  Oleg, could you comment on
> the patch?

Looks OK to me with the 'previous mode vs. toggle' change mentioned by
Jörn here http://gcc.gnu.org/ml/gcc-patches/2014-05/msg00754.html

Except one naming thing (please rename, also the existing ones):
sh4_mode_exit -> sh_mode_exit
sh4_toggle_init -> sh_mode_toggle_init
sh4_toggle_destroy -> sh_mode_toggle_destroy
sh4_toggle_set -> sh_mode_toggle_set
sh4_toggle_test -> sh_mode_toggle_test

Other SH variants also have modes.  E.g. SH2A FPU mode switching is also
done through the sh4_* functions, which is a bit confusing when reading.


A few cosmetic nits:

sh.c:
+static sbitmap *mode_in_flip;  /* flip in mode status for each basic blocks.  
*/
+static sbitmap *mode_out_flip; /* flip out mode status for each basic blocks.  
*/
                                                                            ^
'basic block'


mode-switching.c:
+                       if (mode != num_modes[e] &&
+                           mode != targetm.mode_switching.exit (e))

The '&&' should go to the beginning of the 2nd line, AFAIK.

+  gcc_assert ((targetm.mode_switching.entry && targetm.mode_switching.exit) ||
+             (!targetm.mode_switching.entry && !targetm.mode_switching.exit));

Likewise.


tm.texi:
+@deftypefn {Target Hook} void TARGET_MODE_TOGGLE_SET (sbitmap *@var{avin}, 
sbitmap *@var{avout})
+Hook called by the mode switching pass to record the modes needed for each 
entities in entry and exit of each basic block.
+@end deftypefn

'for each entity'

Reply via email to