This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RFC,PATCH] 2 new mode attributes to replace mode(word) uses in libgcc
- From: Ian Lance Taylor <iant at google dot com>
- To: Andreas Krebbel <Andreas dot Krebbel at de dot ibm dot com>
- Cc: gcc-patches at gcc dot gnu dot org, Ulrich dot Weigand at de dot ibm dot com
- Date: 24 May 2007 09:58:15 -0700
- Subject: Re: [RFC,PATCH] 2 new mode attributes to replace mode(word) uses in libgcc
- References: <20070510150323.GA5255@blc4eb430604175.ibm.com>
Andreas Krebbel <Andreas.Krebbel@de.ibm.com> writes:
> *************** __udivmoddi4 (UDWtype n, UDWtype d, UDWt
> *** 1082,1088 ****
> DWtype
> __divdi3 (DWtype u, DWtype v)
> {
> ! word_type c = 0;
> DWunion uu = {.ll = u};
> DWunion vv = {.ll = v};
> DWtype w;
> --- 1082,1088 ----
> DWtype
> __divdi3 (DWtype u, DWtype v)
> {
> ! Wtype c = 0;
> DWunion uu = {.ll = u};
> DWunion vv = {.ll = v};
> DWtype w;
> *************** __divdi3 (DWtype u, DWtype v)
> *** 1106,1112 ****
> DWtype
> __moddi3 (DWtype u, DWtype v)
> {
> ! word_type c = 0;
> DWunion uu = {.ll = u};
> DWunion vv = {.ll = v};
> DWtype w;
> --- 1106,1112 ----
> DWtype
> __moddi3 (DWtype u, DWtype v)
> {
> ! Wtype c = 0;
> DWunion uu = {.ll = u};
> DWunion vv = {.ll = v};
> DWtype w;
Let's just make the variable 'c' in __divdi3 and __moddi3 have type
int, rather than fuss with word_type or Wtype. I can't see any
disadvantage to that.
When I look at your patch, there seems to be something missing: you
haven't changed optabs.c. It seems to me that you need to change
optabs.c to use cmp_return_mode and shift_count_mode. You should use
cmp_return_mode rather than word_mode in prepare_cmp_insn. And you
should use shift_count_mode in expand_binop if shift_op.
Am I missing something?
Ian