From: Kaveh R. Ghazi Date: Thu, 10 Jul 2003 18:04:25 +0000 (+0000) Subject: arm.c (arm_init_iwmmxt_builtins, [...]): Use ARRAY_SIZE. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e97a46ce6c277cd2cbbc8709e9a926dd236f73cf;p=platform%2Fupstream%2Fgcc.git arm.c (arm_init_iwmmxt_builtins, [...]): Use ARRAY_SIZE. * config/arm/arm.c (arm_init_iwmmxt_builtins, arm_expand_builtin): Use ARRAY_SIZE. * config/frv/frv.c (frv_expand_builtin): Likewise. * config/sh/sh.c (sh_media_init_builtins): Likewise. From-SVN: r69194 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index be28a68..3eefd64 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2003-07-10 Kaveh R. Ghazi + + * config/arm/arm.c (arm_init_iwmmxt_builtins, arm_expand_builtin): + Use ARRAY_SIZE. + * config/frv/frv.c (frv_expand_builtin): Likewise. + * config/sh/sh.c (sh_media_init_builtins): Likewise. + 2003-07-09 Mark Mitchell PR c++/10032 diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index 6b6a718..737a027 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -10715,7 +10715,7 @@ arm_init_iwmmxt_builtins (void) /* Add all builtins that are more or less simple operations on two operands. */ - for (i = 0, d = bdesc_2arg; i < sizeof (bdesc_2arg) / sizeof *d; i++, d++) + for (i = 0, d = bdesc_2arg; i < ARRAY_SIZE (bdesc_2arg); i++, d++) { /* Use one of the operands; the target can have a different mode for mask-generating compares. */ @@ -11155,11 +11155,11 @@ arm_expand_builtin (tree exp, break; } - for (i = 0, d = bdesc_2arg; i < sizeof (bdesc_2arg) / sizeof *d; i++, d++) + for (i = 0, d = bdesc_2arg; i < ARRAY_SIZE (bdesc_2arg); i++, d++) if (d->code == (const enum arm_builtins) fcode) return arm_expand_binop_builtin (d->icode, arglist, target); - for (i = 0, d = bdesc_1arg; i < sizeof (bdesc_1arg) / sizeof *d; i++, d++) + for (i = 0, d = bdesc_1arg; i < ARRAY_SIZE (bdesc_1arg); i++, d++) if (d->code == (const enum arm_builtins) fcode) return arm_expand_unop_builtin (d->icode, arglist, target, 0); diff --git a/gcc/config/frv/frv.c b/gcc/config/frv/frv.c index 5caf13d..84d6d35 100644 --- a/gcc/config/frv/frv.c +++ b/gcc/config/frv/frv.c @@ -9649,53 +9649,38 @@ frv_expand_builtin (exp, target, subtarget, mode, ignore) /* Expand groups of builtins. */ - for (i = 0, d = bdesc_set; i < sizeof (bdesc_set) / sizeof *d; i++, d++) + for (i = 0, d = bdesc_set; i < ARRAY_SIZE (bdesc_set); i++, d++) if (d->code == fcode) return frv_expand_set_builtin (d->icode, arglist, target); - for (i = 0, d = bdesc_1arg; i < sizeof (bdesc_1arg) / sizeof *d; i++, d++) + for (i = 0, d = bdesc_1arg; i < ARRAY_SIZE (bdesc_1arg); i++, d++) if (d->code == fcode) return frv_expand_unop_builtin (d->icode, arglist, target); - for (i = 0, d = bdesc_2arg; i < sizeof (bdesc_2arg) / sizeof *d; i++, d++) + for (i = 0, d = bdesc_2arg; i < ARRAY_SIZE (bdesc_2arg); i++, d++) if (d->code == fcode) return frv_expand_binop_builtin (d->icode, arglist, target); - for (i = 0, d = bdesc_cut; i < sizeof (bdesc_cut) / sizeof *d; i++, d++) + for (i = 0, d = bdesc_cut; i < ARRAY_SIZE (bdesc_cut); i++, d++) if (d->code == fcode) return frv_expand_cut_builtin (d->icode, arglist, target); - for (i = 0, d = bdesc_2argimm; - i < sizeof (bdesc_2argimm) / sizeof *d; - i++, d++) - { - if (d->code == fcode) - return frv_expand_binopimm_builtin (d->icode, arglist, target); - } + for (i = 0, d = bdesc_2argimm; i < ARRAY_SIZE (bdesc_2argimm); i++, d++) + if (d->code == fcode) + return frv_expand_binopimm_builtin (d->icode, arglist, target); - for (i = 0, d = bdesc_void2arg; - i < sizeof (bdesc_void2arg) / sizeof *d; - i++, d++) - { - if (d->code == fcode) - return frv_expand_voidbinop_builtin (d->icode, arglist); - } + for (i = 0, d = bdesc_void2arg; i < ARRAY_SIZE (bdesc_void2arg); i++, d++) + if (d->code == fcode) + return frv_expand_voidbinop_builtin (d->icode, arglist); - for (i = 0, d = bdesc_void3arg; - i < sizeof (bdesc_void3arg) / sizeof *d; - i++, d++) - { - if (d->code == fcode) - return frv_expand_voidtriop_builtin (d->icode, arglist); - } + for (i = 0, d = bdesc_void3arg; i < ARRAY_SIZE (bdesc_void3arg); i++, d++) + if (d->code == fcode) + return frv_expand_voidtriop_builtin (d->icode, arglist); + + for (i = 0, d = bdesc_voidacc; i < ARRAY_SIZE (bdesc_voidacc); i++, d++) + if (d->code == fcode) + return frv_expand_voidaccop_builtin (d->icode, arglist); - for (i = 0, d = bdesc_voidacc; - i < sizeof (bdesc_voidacc) / sizeof *d; - i++, d++) - { - if (d->code == fcode) - return frv_expand_voidaccop_builtin (d->icode, arglist); - } return 0; } diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c index e1c81c9..ee8193c 100644 --- a/gcc/config/sh/sh.c +++ b/gcc/config/sh/sh.c @@ -8226,7 +8226,7 @@ sh_media_init_builtins () const struct builtin_description *d; memset (shared, 0, sizeof shared); - for (d = bdesc; d - bdesc < (int) (sizeof bdesc / sizeof bdesc[0]); d++) + for (d = bdesc; d - bdesc < (int) ARRAY_SIZE (bdesc); d++) { tree type, arg_type; int signature = d->signature;