[llvm] r193742 - [SystemZ] Automatically detect zEC12 and z196 hosts

Ulrich Weigand Ulrich.Weigand at de.ibm.com
Thu Oct 31 05:33:09 PDT 2013


Richard Sandiford <rsandifo at linux.vnet.ibm.com> wrote:

> +        if (!Lines[I].drop_front(Pos).getAsInteger(10, Id)) {
> +          if (Id >= 2827)
> +            return "zEC12";
> +          if (Id >= 2817)
> +            return "z196";
> +        }

While this has been the case in recent machines, the machine
type number is not guaranteed to increase with future models.
For example, the pre-zSeries S/390 machines had the model
number 9672 ...  (Of course, this was 32-bit only and so
we don't support it anyway in LLVM.)

It's still probably better to explicitly check for known
model numbers.  Here's the list currently supported by
the Linux kernel:

        switch (cpu_id.machine) {
        case 0x9672:
#if !defined(CONFIG_64BIT)
        default:        /* Use "g5" as default for 31 bit kernels. */
#endif
                strcpy(elf_platform, "g5");
                break;
        case 0x2064:
        case 0x2066:
#if defined(CONFIG_64BIT)
        default:        /* Use "z900" as default for 64 bit kernels. */
#endif
                strcpy(elf_platform, "z900");
                break;
        case 0x2084:
        case 0x2086:
                strcpy(elf_platform, "z990");
                break;
        case 0x2094:
        case 0x2096:
                strcpy(elf_platform, "z9-109");
                break;
        case 0x2097:
        case 0x2098:
                strcpy(elf_platform, "z10");
                break;
        case 0x2817:
        case 0x2818:
                strcpy(elf_platform, "z196");
                break;
        case 0x2827:
        case 0x2828:
                strcpy(elf_platform, "zEC12");
                break;
        }

Bye,
Ulrich




More information about the llvm-commits mailing list