This is the mail archive of the binutils@sourceware.org mailing list for the binutils 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] S/390: Support the .machine pseudo


"Andreas Krebbel" <krebbel@linux.vnet.ibm.com> writes:

> @@ -350,6 +352,35 @@ s390_target_format (void)
>    return s390_arch_size == 64 ? "elf64-s390" : "elf32-s390";
>  }
>  
> +/* Map a CPU string as given with -march= or .machine to the
> +   respective enum s390_opcode_cpu_val value.  0xffffffff is returned
> +   in case of an error.  */
> +
> +static int
          unsigned int
> +s390_parse_cpu (char *arg)
> +{
> +  if (strcmp (arg, "g5") == 0)
> +    return S390_OPCODE_G5;
> +  else if (strcmp (arg, "g6") == 0)
> +    return S390_OPCODE_G6;
> +  else if (strcmp (arg, "z900") == 0)
> +    return S390_OPCODE_Z900;
> +  else if (strcmp (arg, "z990") == 0)
> +    return S390_OPCODE_Z990;
> +  else if (strcmp (arg, "z9-109") == 0)
> +    return S390_OPCODE_Z9_109;
> +  else if (strcmp (arg, "z9-ec") == 0)
> +    return S390_OPCODE_Z9_EC;
> +  else if (strcmp (arg, "z10") == 0)
> +    return S390_OPCODE_Z10;
> +  else if (strcmp (arg, "z196") == 0)
> +    return S390_OPCODE_Z196;
> +  else if (strcmp (arg, "all") == 0)
> +    return S390_OPCODE_MAXCPU - 1;
> +  else
> +    return ~(unsigned int)0;

"return -1" will work fine in any case.

Andreas.

-- 
Andreas Schwab, schwab@redhat.com
GPG Key fingerprint = D4E8 DBE3 3813 BB5D FA84  5EC7 45C6 250E 6F00 984E
"And now for something completely different."


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