Movatterモバイル変換


[0]ホーム

URL:


This is the mail archive of thebinutils@sources.redhat.commailing list for thebinutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav:[Date Prev] [Date Next][Thread Prev] [Thread Next]
Other format:[Raw text]

Re: [PATCH] Add .set arch=FOO support to MIPS gas.


(err, looks like you either accidentally committed this, or committedit with a bad cvs log message...  FYI.)anyway, what i was thinking about re: the s_mipsset change was thepatch below.less code overall, less duplicated code/semantics, and if wackoarchitecture *do* pop up at some point in the future, it's easy enoughto handle them (put 'if' between the switch and 'if (reset)' code).Anyway, if you want it, here it is.  If you like it, commit it; thisis my last comment on your patch since it's gone in and i've said mybit.  8-)cgd--2003-06-29  Chris Demetriou  <cgd@broadcom.com>        * config/tc-mips.c (s_mipsset): Implement -march= handling        differently.Index: gas/config/tc-mips.c===================================================================RCS file: /cvs/src/src/gas/config/tc-mips.c,vretrieving revision 1.222diff -u -p -r1.222 tc-mips.c--- gas/config/tc-mips.c30 Jun 2003 04:10:48 -00001.222+++ gas/config/tc-mips.c30 Jun 2003 05:33:13 -0000@@ -12367,12 +12367,12 @@ s_mipsset (x)     mips_opts.ase_mdmx = 1;   else if (strcmp (name, "nomdmx") == 0)     mips_opts.ase_mdmx = 0;-  else if (strncmp (name, "mips", 4) == 0)+  else if (strncmp (name, "mips", 4) == 0 || strncmp (name, "arch=", 5) == 0)     {       int reset = 0; -      /* Permit the user to change the ISA on the fly.  Needless to- say, misuse can cause serious problems.  */+      /* Permit the user to change the ISA and architecture on the fly.+ Needless to say, misuse can cause serious problems.  */       if (strcmp (name, "mips0") == 0) {   reset = 1;@@ -12394,6 +12394,25 @@ s_mipsset (x) mips_opts.isa = ISA_MIPS32R2;       else if (strcmp (name, "mips64") == 0) mips_opts.isa = ISA_MIPS64;+      else if (strcmp (name, "arch=default") == 0)+{+  reset = 1;+  mips_opts.arch = file_mips_arch;+  mips_opts.isa = file_mips_isa;+}+      else if (strncmp (name, "arch=", 5) == 0)+{+  const struct mips_cpu_info *p;++  p = mips_parse_cpu("internal use", name + 5);+  if (!p)+    as_bad (_("unknown architecture %s"), name + 5);+  else+    {+      mips_opts.arch = p->cpu;+      mips_opts.isa = p->isa;+    }+}       else as_bad (_("unknown ISA level %s"), name + 4); @@ -12464,47 +12483,6 @@ s_mipsset (x)   mips_opts = s->options;   mips_opts_stack = s->next;   free (s);-}-    }-  else if (strncmp (name, "arch=", 5) == 0)-    {-      /* Permit the user to change the architecture on the fly.  Needless- to say, misuse can cause serious problems.  */-      if (strcmp (name + 5, "default") == 0)-{-  mips_opts.arch = file_mips_arch;-  mips_opts.isa = file_mips_isa;-  mips_opts.gp32 = file_mips_gp32;-  mips_opts.fp32 = file_mips_fp32;-}-      else-{-  const struct mips_cpu_info *p;--  p = mips_parse_cpu("internal use", name + 5);-  if (!p)-    as_bad (_("unknown architecture %s"), name + 5);-  else-    {-      mips_opts.arch = p->cpu;-      mips_opts.isa = p->isa;-    }--  switch (mips_opts.arch)-    {-      case CPU_R3000:-      case CPU_R3900:-      case CPU_R6000:-      case CPU_MIPS32:-      case CPU_MIPS32R2:-mips_opts.gp32 = 1;-mips_opts.fp32 = 1;-break;-      default:-mips_opts.gp32 = 0;-mips_opts.fp32 = 0;-break;-    } }     }   else

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav:[Date Prev] [Date Next][Thread Prev] [Thread Next]

[8]ページ先頭

©2009-2025 Movatter.jp