[MT patch]: lowercase architecture names

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[MT patch]: lowercase architecture names

Nathan Sidwell
This patch changes the mt assembler to only accept lowercase architecture names,
in line with existing practice.  GCC's multilib support forced lower case names
and now gcc itself is case sensitive.  The patch also changes the default to
ms1-16-002, which is the same as gcc's default.

ok?

nathan
--
Nathan Sidwell    ::   http://www.codesourcery.com   ::     CodeSourcery LLC
[hidden email]    ::     http://www.planetfall.pwp.blueyonder.co.uk


2005-12-20  Nathan Sidwell  <[hidden email]>

        * config/tc-mt.c (mt_arch): Default to ms1_16_002.
        (md_parse_options): Only allow lowercase.
        (md_show_usage): Update.

Index: gas/config/tc-mt.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-mt.c,v
retrieving revision 1.3
diff -c -3 -p -r1.3 tc-mt.c
*** gas/config/tc-mt.c 16 Dec 2005 10:23:07 -0000 1.3
--- gas/config/tc-mt.c 20 Dec 2005 09:39:29 -0000
*************** enum mt_architectures
*** 99,105 ****
    };
 
  /* MT architecture we are using for this output file.  */
! static enum mt_architectures mt_arch = ms1_64_001;
 
  int
  md_parse_option (int c ATTRIBUTE_UNUSED, char * arg)
--- 99,105 ----
    };
 
  /* MT architecture we are using for this output file.  */
! static enum mt_architectures mt_arch = ms1_16_002;
 
  int
  md_parse_option (int c ATTRIBUTE_UNUSED, char * arg)
*************** md_parse_option (int c ATTRIBUTE_UNUSED,
*** 107,134 ****
    switch (c)
      {
      case OPTION_MARCH:
!       if (strcasecmp (arg, "MS1-64-001") == 0)
    {
     mt_flags = (mt_flags & ~EF_MT_CPU_MASK) | EF_MT_CPU_MRISC;
     mt_mach = bfd_mach_ms1;
     mt_mach_bitmask = 1 << MACH_MS1;
     mt_arch = ms1_64_001;
    }
!       else if (strcasecmp (arg, "MS1-16-002") == 0)
    {
     mt_flags = (mt_flags & ~EF_MT_CPU_MASK) | EF_MT_CPU_MRISC;
     mt_mach = bfd_mach_ms1;
     mt_mach_bitmask = 1 << MACH_MS1;
     mt_arch = ms1_16_002;
    }
!       else if (strcasecmp (arg, "MS1-16-003") == 0)
    {
     mt_flags = (mt_flags & ~EF_MT_CPU_MASK) | EF_MT_CPU_MRISC2;
     mt_mach = bfd_mach_mrisc2;
     mt_mach_bitmask = 1 << MACH_MS1_003;
     mt_arch = ms1_16_003;
    }
!       else if (strcasecmp (arg, "MS2") == 0)
    {
     mt_flags = (mt_flags & ~EF_MT_CPU_MASK) | EF_MT_CPU_MS2;
     mt_mach = bfd_mach_mrisc2;
--- 107,134 ----
    switch (c)
      {
      case OPTION_MARCH:
!       if (strcmp (arg, "ms1-64-001") == 0)
    {
     mt_flags = (mt_flags & ~EF_MT_CPU_MASK) | EF_MT_CPU_MRISC;
     mt_mach = bfd_mach_ms1;
     mt_mach_bitmask = 1 << MACH_MS1;
     mt_arch = ms1_64_001;
    }
!       else if (strcmp (arg, "ms1-16-002") == 0)
    {
     mt_flags = (mt_flags & ~EF_MT_CPU_MASK) | EF_MT_CPU_MRISC;
     mt_mach = bfd_mach_ms1;
     mt_mach_bitmask = 1 << MACH_MS1;
     mt_arch = ms1_16_002;
    }
!       else if (strcmp (arg, "ms1-16-003") == 0)
    {
     mt_flags = (mt_flags & ~EF_MT_CPU_MASK) | EF_MT_CPU_MRISC2;
     mt_mach = bfd_mach_mrisc2;
     mt_mach_bitmask = 1 << MACH_MS1_003;
     mt_arch = ms1_16_003;
    }
!       else if (strcmp (arg, "ms2") == 0)
    {
     mt_flags = (mt_flags & ~EF_MT_CPU_MASK) | EF_MT_CPU_MS2;
     mt_mach = bfd_mach_mrisc2;
*************** void
*** 150,160 ****
  md_show_usage (FILE * stream)
  {
    fprintf (stream, _("MT specific command line options:\n"));
!   fprintf (stream, _("  -march=ms1-64-001         allow ms1-64-001 instructions (default) \n"));
!   fprintf (stream, _("  -march=ms1-16-002         allow ms1-16-002 instructions \n"));
!   fprintf (stream, _("  -march=ms1-16-003         allow ms1-16-003 instructions \n"));
    fprintf (stream, _("  -march=ms2                allow ms2 instructions \n"));
!   fprintf (stream, _("  -nosched                  disable scheduling restrictions \n"));
  }
 
 
--- 150,160 ----
  md_show_usage (FILE * stream)
  {
    fprintf (stream, _("MT specific command line options:\n"));
!   fprintf (stream, _("  -march=ms1-64-001         allow ms1-64-001 instructions\n"));
!   fprintf (stream, _("  -march=ms1-16-002         allow ms1-16-002 instructions (default)\n"));
!   fprintf (stream, _("  -march=ms1-16-003         allow ms1-16-003 instructions\n"));
    fprintf (stream, _("  -march=ms2                allow ms2 instructions \n"));
!   fprintf (stream, _("  -nosched                  disable scheduling restrictions\n"));
  }
 
 
Reply | Threaded
Open this post in threaded view
|

Re: [MT patch]: lowercase architecture names

Nick Clifton
Hi Nathan,

> This patch changes the mt assembler to only accept lowercase
> architecture names, in line with existing practice.  GCC's multilib
> support forced lower case names and now gcc itself is case sensitive.  
> The patch also changes the default to ms1-16-002, which is the same as
> gcc's default.

Is this really of any benefit ?  Is there some intention to have
uppercase variants of the name mean something different ?

Cheers
   Nick


Reply | Threaded
Open this post in threaded view
|

Re: [MT patch]: lowercase architecture names

Nathan Sidwell
Nick Clifton wrote:

> Hi Nathan,
>
>> This patch changes the mt assembler to only accept lowercase
>> architecture names, in line with existing practice.  GCC's multilib
>> support forced lower case names and now gcc itself is case sensitive.  
>> The patch also changes the default to ms1-16-002, which is the same as
>> gcc's default.
>
>
> Is this really of any benefit ?  Is there some intention to have
> uppercase variants of the name mean something different ?

No, there's no intention for upper case to mean something different.  The thing
is, uppercase does not work -- the new multilib machinery expects the
architectures to be lower case.  The existing port also only worked with
exclusively upper case or lower case rather than the mixed case which strcasecmp
will accept.  Being stricter is an attempt to head off confusing errors.

nathan

--
Nathan Sidwell    ::   http://www.codesourcery.com   ::     CodeSourcery LLC
[hidden email]    ::     http://www.planetfall.pwp.blueyonder.co.uk

Reply | Threaded
Open this post in threaded view
|

Re: [MT patch]: lowercase architecture names

Nick Clifton
Hi Nathan,

>> Is this really of any benefit ?  Is there some intention to have
>> uppercase variants of the name mean something different ?
>
> No, there's no intention for upper case to mean something different.  
> The thing is, uppercase does not work -- the new multilib machinery
> expects the architectures to be lower case.  The existing port also only
> worked with exclusively upper case or lower case rather than the mixed
> case which strcasecmp will accept.  Being stricter is an attempt to head
> off confusing errors.

In which case the patch is approved, please apply it.

Cheers
   Nick