[PATCH] Add new model m32r2 of Renesas M32R.

Kazuhiro Inaoka inaoka.kazuhiro@renesas.com
Wed Dec 17 11:20:00 GMT 2003


Hi Nick,

Thanks!
Kazuhiro

> Hi Kazuhiro,
>
> >>   % m32r-elf-gas -m32rx -Ep parallel.s
> >>   parallel.s:4: Warning: mv r1,r0||mv r2,r1: output of 1st instruction
\
> >>    is the same as an input to 2nd instruction - is this intentional ?
> >>
> >> In this case an output file is produced.  This shows how the -Ep
> >> no longer has any affect on the warning message about input and output
> >> operands overlapping.  I believe that this is what you wanted ?
> > In this case I don't want to show the warning message.
>
> Ah - OK now I understand.
>
> In which case I will apply the patch below, which is very similar to
> the patch I posted yesterday, except that I have renamed the variable
> "error_explicit_parallel_conflicts" to "ignore_parallel_conflicts" to
> indicate that this variable now suppress all checks for parallel
> constraint violations, not just those associated with both
> instructions writing to the same destination register.
>
> Cheers
>         Nick
>
> gas/ChangeLog
> 2003-12-17  Nick Clifton  <nickc@redhat.com>
>
> * config/tc-m32r.c (error_explicit_parallel_conflicts): Rename
>         to 'ignore_parallel_conflicts'.
>         (md_longopts): Change option names as well.
>         (md_parse_option): Separate the warn_explicit and ignore
>         parallel conflicts options.
>         (md_show_usage): Update descriptions of these options.
>         (first_writes_to_seconds_operands): Do not run this check if
>         ignoring parallel conflicts.
>         (assemble_two_insns): Remove code that checked
>         error_explicit_parallel_conflicts.
>         * doc/c-m32r.texi: Update descriptions of the options.
>
> gas/testsuite/ChangeLog
> 2003-12-17  Nick Clifton  <nickc@redhat.com>
>
> * gas/m32r/error.exp: Add parallel.s
>         * gas/m32r/parallel.s: New file: Test warning and error
>         messages produced for parallel conflicts.
>
> Index: gas/config/tc-m32r.c
> ===================================================================
> RCS file: /cvs/src/src/gas/config/tc-m32r.c,v
> retrieving revision 1.32
> diff -c -3 -p -r1.32 tc-m32r.c
> *** gas/config/tc-m32r.c 3 Dec 2003 17:38:45 -0000 1.32
> --- gas/config/tc-m32r.c 17 Dec 2003 09:33:12 -0000
> *************** static int enable_special_float = 0;
> *** 116,124 ****
>      instruction might have constraint violations.  */
>   static int warn_explicit_parallel_conflicts = 1;
>
> ! /* Non-zero if the programmer should receive an error message when an
> !    explicit parallel instruction might have constraint violations.  */
> ! static int error_explicit_parallel_conflicts = 1;
>
>   /* Non-zero if insns can be made parallel.  */
>   static int use_parallel = 1;
> --- 116,127 ----
>      instruction might have constraint violations.  */
>   static int warn_explicit_parallel_conflicts = 1;
>
> ! /* Non-zero if the programmer should not receive any messages about
> !    parallel instruction with potential or real constraint violations.
> !    The ability to suppress these messages is intended only for hardware
> !    vendors testing the chip.  It superceedes
> !    warn_explicit_parallel_conflicts.  */
> ! static int ignore_parallel_conflicts = 0;
>
>   /* Non-zero if insns can be made parallel.  */
>   static int use_parallel = 1;
> *************** const char *md_shortopts = M32R_SHORTOPT
> *** 197,218 ****
>
>   struct option md_longopts[] =
>   {
> ! #define OPTION_M32R (OPTION_MD_BASE)
> ! #define OPTION_M32RX (OPTION_M32R + 1)
> ! #define OPTION_M32R2 (OPTION_M32RX + 1)
> ! #define OPTION_BIG               (OPTION_M32R2 + 1)
> ! #define OPTION_LITTLE            (OPTION_BIG + 1)
> ! #define OPTION_PARALLEL          (OPTION_LITTLE + 1)
> ! #define OPTION_NO_PARALLEL       (OPTION_PARALLEL + 1)
> ! #define OPTION_WARN_PARALLEL (OPTION_NO_PARALLEL + 1)
> ! #define OPTION_NO_WARN_PARALLEL (OPTION_WARN_PARALLEL + 1)
> ! #define OPTION_ERROR_PARALLEL    (OPTION_NO_WARN_PARALLEL + 1)
> ! #define OPTION_NO_ERROR_PARALLEL (OPTION_ERROR_PARALLEL + 1)
> ! #define OPTION_SPECIAL (OPTION_NO_ERROR_PARALLEL + 1)
> ! #define OPTION_SPECIAL_M32R      (OPTION_SPECIAL + 1)
> ! #define OPTION_SPECIAL_FLOAT     (OPTION_SPECIAL_M32R + 1)
> ! #define OPTION_WARN_UNMATCHED (OPTION_SPECIAL_FLOAT + 1)
> ! #define OPTION_NO_WARN_UNMATCHED (OPTION_WARN_UNMATCHED + 1)
>     {"m32r",  no_argument, NULL, OPTION_M32R},
>     {"m32rx", no_argument, NULL, OPTION_M32RX},
>     {"m32r2", no_argument, NULL, OPTION_M32R2},
> --- 200,221 ----
>
>   struct option md_longopts[] =
>   {
> ! #define OPTION_M32R   (OPTION_MD_BASE)
> ! #define OPTION_M32RX   (OPTION_M32R + 1)
> ! #define OPTION_M32R2   (OPTION_M32RX + 1)
> ! #define OPTION_BIG                (OPTION_M32R2 + 1)
> ! #define OPTION_LITTLE             (OPTION_BIG + 1)
> ! #define OPTION_PARALLEL           (OPTION_LITTLE + 1)
> ! #define OPTION_NO_PARALLEL        (OPTION_PARALLEL + 1)
> ! #define OPTION_WARN_PARALLEL   (OPTION_NO_PARALLEL + 1)
> ! #define OPTION_NO_WARN_PARALLEL   (OPTION_WARN_PARALLEL + 1)
> ! #define OPTION_IGNORE_PARALLEL    (OPTION_NO_WARN_PARALLEL + 1)
> ! #define OPTION_NO_IGNORE_PARALLEL (OPTION_IGNORE_PARALLEL + 1)
> ! #define OPTION_SPECIAL   (OPTION_NO_IGNORE_PARALLEL + 1)
> ! #define OPTION_SPECIAL_M32R       (OPTION_SPECIAL + 1)
> ! #define OPTION_SPECIAL_FLOAT      (OPTION_SPECIAL_M32R + 1)
> ! #define OPTION_WARN_UNMATCHED   (OPTION_SPECIAL_FLOAT + 1)
> ! #define OPTION_NO_WARN_UNMATCHED  (OPTION_WARN_UNMATCHED + 1)
>     {"m32r",  no_argument, NULL, OPTION_M32R},
>     {"m32rx", no_argument, NULL, OPTION_M32RX},
>     {"m32r2", no_argument, NULL, OPTION_M32R2},
> *************** struct option md_longopts[] =
> *** 226,235 ****
>     {"Wp", no_argument, NULL, OPTION_WARN_PARALLEL},
>     {"no-warn-explicit-parallel-conflicts", no_argument, NULL,
OPTION_NO_WARN_PARALLEL},
>     {"Wnp", no_argument, NULL, OPTION_NO_WARN_PARALLEL},
> !   {"error-explicit-parallel-conflicts", no_argument, NULL,
OPTION_ERROR_PARALLEL},
> !   {"Ep", no_argument, NULL, OPTION_ERROR_PARALLEL},
> !   {"no-error-explicit-parallel-conflicts", no_argument, NULL,
OPTION_NO_ERROR_PARALLEL},
> !   {"Enp", no_argument, NULL, OPTION_NO_ERROR_PARALLEL},
>     {"hidden", no_argument, NULL, OPTION_SPECIAL},
>     {"bitinst", no_argument, NULL, OPTION_SPECIAL_M32R},
>     {"float", no_argument, NULL, OPTION_SPECIAL_FLOAT},
> --- 229,238 ----
>     {"Wp", no_argument, NULL, OPTION_WARN_PARALLEL},
>     {"no-warn-explicit-parallel-conflicts", no_argument, NULL,
OPTION_NO_WARN_PARALLEL},
>     {"Wnp", no_argument, NULL, OPTION_NO_WARN_PARALLEL},
> !   {"ignore-parallel-conflicts", no_argument, NULL,
OPTION_IGNORE_PARALLEL},
> !   {"Ip", no_argument, NULL, OPTION_IGNORE_PARALLEL},
> !   {"no-ignore-parallel-conflicts", no_argument, NULL,
OPTION_NO_IGNORE_PARALLEL},
> !   {"nIp", no_argument, NULL, OPTION_NO_IGNORE_PARALLEL},
>     {"hidden", no_argument, NULL, OPTION_SPECIAL},
>     {"bitinst", no_argument, NULL, OPTION_SPECIAL_M32R},
>     {"float", no_argument, NULL, OPTION_SPECIAL_FLOAT},
> *************** md_parse_option (c, arg)
> *** 318,339 ****
>
>       case OPTION_WARN_PARALLEL:
>         warn_explicit_parallel_conflicts = 1;
> -       error_explicit_parallel_conflicts = 0;
>         break;
>
>       case OPTION_NO_WARN_PARALLEL:
>         warn_explicit_parallel_conflicts = 0;
> -       error_explicit_parallel_conflicts = 0;
>         break;
>
> !     case OPTION_ERROR_PARALLEL:
> !       warn_explicit_parallel_conflicts = 1;
> !       error_explicit_parallel_conflicts = 1;
>         break;
>
> !     case OPTION_NO_ERROR_PARALLEL:
> !       error_explicit_parallel_conflicts = 0;
> !       warn_explicit_parallel_conflicts = 0;
>         break;
>
>       case OPTION_SPECIAL:
> --- 321,338 ----
>
>       case OPTION_WARN_PARALLEL:
>         warn_explicit_parallel_conflicts = 1;
>         break;
>
>       case OPTION_NO_WARN_PARALLEL:
>         warn_explicit_parallel_conflicts = 0;
>         break;
>
> !     case OPTION_IGNORE_PARALLEL:
> !       ignore_parallel_conflicts = 1;
>         break;
>
> !     case OPTION_NO_IGNORE_PARALLEL:
> !       ignore_parallel_conflicts = 0;
>         break;
>
>       case OPTION_SPECIAL:
> *************** md_show_usage (stream)
> *** 406,432 ****
>     fprintf (stream, _("\
>     -warn-explicit-parallel-conflicts     warn when parallel
instructions\n"));
>     fprintf (stream, _("\
> !                                          violate contraints\n"));
>     fprintf (stream, _("\
>     -no-warn-explicit-parallel-conflicts  do not warn when parallel\n"));
>     fprintf (stream, _("\
> !                                          instructions violate
contraints\n"));
>     fprintf (stream, _("\
>     -Wp                     synonym
for -warn-explicit-parallel-conflicts\n"));
>     fprintf (stream, _("\
>     -Wnp                    synonym
for -no-warn-explicit-parallel-conflicts\n"));
>     fprintf (stream, _("\
> !   -error-explicit-parallel-conflicts     error when parallel
instructions\n"));
>     fprintf (stream, _("\
> !                                          violate contraints\n"));
>     fprintf (stream, _("\
> !   -no-error-explicit-parallel-conflicts  do not error when
parallel\n"));
>     fprintf (stream, _("\
> !                                          instructions violate
contraints\n"));
>     fprintf (stream, _("\
> !   -Ep                     synonym
for -error-explicit-parallel-conflicts\n"));
>     fprintf (stream, _("\
> !   -Enp                    synonym
for -no-error-explicit-parallel-conflicts\n"));
>
>     fprintf (stream, _("\
>     -warn-unmatched-high    warn when an (s)high reloc has no matching low
reloc\n"));
> --- 405,431 ----
>     fprintf (stream, _("\
>     -warn-explicit-parallel-conflicts     warn when parallel
instructions\n"));
>     fprintf (stream, _("\
> !                                          might violate contraints\n"));
>     fprintf (stream, _("\
>     -no-warn-explicit-parallel-conflicts  do not warn when parallel\n"));
>     fprintf (stream, _("\
> !                                          instructions might violate
contraints\n"));
>     fprintf (stream, _("\
>     -Wp                     synonym
for -warn-explicit-parallel-conflicts\n"));
>     fprintf (stream, _("\
>     -Wnp                    synonym
for -no-warn-explicit-parallel-conflicts\n"));
>     fprintf (stream, _("\
> !   -ignore-parallel-conflicts            do not check parallel
instructions\n"));
>     fprintf (stream, _("\
> !                                          fo contraint violations\n"));
>     fprintf (stream, _("\
> !   -no-ignore-parallel-conflicts         check parallel instructions
for\n"));
>     fprintf (stream, _("\
> !                                          contraint violations\n"));
>     fprintf (stream, _("\
> !   -Ip                     synonym for -ignore-parallel-conflicts\n"));
>     fprintf (stream, _("\
> !   -nIp                    synonym
for -no-ignore-parallel-conflicts\n"));
>
>     fprintf (stream, _("\
>     -warn-unmatched-high    warn when an (s)high reloc has no matching low
reloc\n"));
> *************** first_writes_to_seconds_operands (a, b,
> *** 756,761 ****
> --- 755,763 ----
>     const CGEN_OPINST *b_ops = CGEN_INSN_OPERANDS (b->insn);
>     int a_index;
>
> +   if (ignore_parallel_conflicts)
> +     return 0;
> +
>     /* If at least one of the instructions takes no operands, then there
is
>        nothing to check.  There really are instructions without operands,
>        eg 'nop'.  */
> *************** can_make_parallel (a, b)
> *** 870,876 ****
>       abort ();
>
>     if (first_writes_to_seconds_operands (a, b, TRUE))
> !     return _("Instructions write to the same destination register.");
>
>     a_pipe = CGEN_INSN_ATTR_VALUE (a->insn, CGEN_INSN_PIPE);
>     b_pipe = CGEN_INSN_ATTR_VALUE (b->insn, CGEN_INSN_PIPE);
> --- 872,878 ----
>       abort ();
>
>     if (first_writes_to_seconds_operands (a, b, TRUE))
> !     return _("instructions write to the same destination register.");
>
>     a_pipe = CGEN_INSN_ATTR_VALUE (a->insn, CGEN_INSN_PIPE);
>     b_pipe = CGEN_INSN_ATTR_VALUE (b->insn, CGEN_INSN_PIPE);
> *************** assemble_two_insns (str, str2, parallel_
> *** 1154,1170 ****
>
>     if (parallel_p && warn_explicit_parallel_conflicts)
>       {
> -       void (* func)(const char *, ...);
> -
> -       func = error_explicit_parallel_conflicts ? as_bad : as_warn;
> -
>         if (first_writes_to_seconds_operands (&first, &second, FALSE))
>   /* xgettext:c-format  */
> ! func (_("%s: output of 1st instruction is the same as an input to 2nd
instruction - is this intentional ?"), str2);
>
>         if (first_writes_to_seconds_operands (&second, &first, FALSE))
>   /* xgettext:c-format  */
> ! func (_("%s: output of 2nd instruction is the same as an input to 1st
instruction - is this intentional ?"), str2);
>       }
>
>     if (!parallel_p
> --- 1156,1168 ----
>
>     if (parallel_p && warn_explicit_parallel_conflicts)
>       {
>         if (first_writes_to_seconds_operands (&first, &second, FALSE))
>   /* xgettext:c-format  */
> ! as_warn (_("%s: output of 1st instruction is the same as an input to 2nd
instruction - is this intentional ?"), str2);
>
>         if (first_writes_to_seconds_operands (&second, &first, FALSE))
>   /* xgettext:c-format  */
> ! as_warn (_("%s: output of 2nd instruction is the same as an input to 1st
instruction - is this intentional ?"), str2);
>       }
>
>     if (!parallel_p
> Index: gas/doc/c-m32r.texi
> ===================================================================
> RCS file: /cvs/src/src/gas/doc/c-m32r.texi,v
> retrieving revision 1.7
> diff -c -3 -p -r1.7 c-m32r.texi
> *** gas/doc/c-m32r.texi 3 Dec 2003 17:38:46 -0000 1.7
> --- gas/doc/c-m32r.texi 17 Dec 2003 09:33:13 -0000
> *************** questionable parallel instructions are e
> *** 119,145 ****
>   This is a shorter synonym for the
@emph{-no-warn-explicit-parallel-conflicts}
>   option.
>
> ! @item -error-explicit-parallel-conflicts
> ! @cindex @samp{-error-explicit-parallel-conflicts} option, M32RX
> ! This option performs the same thing as the
> ! @emph{-warn-explicit-parallel-conflicts} expcept that instead of
> ! warning messages being produced, error messages will be produced.  If
> ! any error messages are generated then GAS will not produce an output
> ! file.
>
> ! @item -no-error-explicit-parallel-conflicts
> ! @cindex @samp{-no-error-explicit-parallel-conflicts} option, M32RX
> ! This option disables a previously enabled
> ! @emph{-error-explicit-parallel-conflicts} option.
>
> ! @item -Ep
> ! @cindex @samp{-Ep} option, M32RX
> ! This is a shorter synonym for the
@emph{-error-explicit-parallel-conflicts}
>   option.
>
> ! @item -Enp
> ! @cindex @samp{-Enp} option, M32RX
> ! This is a shorter synonym for the
@emph{-no-error-explicit-parallel-conflicts}
>   option.
>
>   @item -warn-unmatched-high
> --- 119,144 ----
>   This is a shorter synonym for the
@emph{-no-warn-explicit-parallel-conflicts}
>   option.
>
> ! @item -ignore-parallel-conflicts
> ! @cindex @samp{-ignore-parallel-conflicts} option, M32RX
> ! This option tells the assembler's to stop checking parallel
> ! instructions for contraint violations.  This ability is provided for
> ! hardware vendors testing chip designs and should not be used under
> ! normal circumstances.
>
> ! @item -no-ignore-parallel-conflicts
> ! @cindex @samp{-no-ignore-parallel-conflicts} option, M32RX
> ! This option restores the assembler's default behaviour of checking
> ! parallel instructions to detect constraint violations.
>
> ! @item -Ip
> ! @cindex @samp{-Ip} option, M32RX
> ! This is a shorter synonym for the @emph{-ignore-parallel-conflicts}
>   option.
>
> ! @item -nIp
> ! @cindex @samp{-nIp} option, M32RX
> ! This is a shorter synonym for the @emph{-no-ignore-parallel-conflicts}
>   option.
>
>   @item -warn-unmatched-high
> Index: gas/testsuite/gas/m32r/error.exp
> ===================================================================
> RCS file: /cvs/src/src/gas/testsuite/gas/m32r/error.exp,v
> retrieving revision 1.1
> diff -c -3 -p -r1.1 error.exp
> *** gas/testsuite/gas/m32r/error.exp 5 Oct 1999 01:27:35 -0000 1.1
> --- gas/testsuite/gas/m32r/error.exp 17 Dec 2003 09:33:14 -0000
> *************** if [istarget m32r-*-*] {
> *** 9,14 ****
> --- 9,15 ----
>       dg-runtest "$srcdir/$subdir/wrongsize.s" "" ""
>       dg-runtest "$srcdir/$subdir/interfere.s" "" ""
>       dg-runtest "$srcdir/$subdir/outofrange.s" "" ""
> +     dg-runtest "$srcdir/$subdir/parallel.s" "" ""
>
>       dg-finish
>
>
>



More information about the Binutils mailing list