Lines 538-571
const char *host_detect_local_cpu (int argc, const char **argv)
Link Here
|
538 |
cpu = "pentium"; |
538 |
cpu = "pentium"; |
539 |
break; |
539 |
break; |
540 |
case PROCESSOR_PENTIUMPRO: |
540 |
case PROCESSOR_PENTIUMPRO: |
541 |
if (model == 28) |
541 |
switch (model) |
542 |
cpu = "atom"; |
|
|
543 |
else if (model >= 28 && l2sizekb < 2048) |
544 |
/* Assume it's a small core if there's less than 2MB cache */ |
545 |
cpu = "atom"; |
546 |
else if (has_longmode) |
547 |
cpu = "core2"; |
548 |
else if (arch) |
549 |
{ |
542 |
{ |
550 |
if (has_sse3) |
543 |
case 0x1c: |
551 |
/* It is Core Duo. */ |
544 |
case 0x26: |
552 |
cpu = "pentium-m"; |
545 |
/* Atom. */ |
553 |
else if (has_sse2) |
546 |
cpu = "atom"; |
554 |
/* It is Pentium M. */ |
547 |
break; |
555 |
cpu = "pentium-m"; |
548 |
case 0x1a: |
556 |
else if (has_sse) |
549 |
case 0x1e: |
557 |
/* It is Pentium III. */ |
550 |
case 0x1f: |
558 |
cpu = "pentium3"; |
551 |
case 0x2e: |
559 |
else if (has_mmx) |
552 |
/* FIXME: Optimize for Nehalem. */ |
560 |
/* It is Pentium II. */ |
553 |
cpu = "core2"; |
561 |
cpu = "pentium2"; |
554 |
break; |
|
|
555 |
case 0x25: |
556 |
case 0x2f: |
557 |
/* FIXME: Optimize for Westmere. */ |
558 |
cpu = "core2"; |
559 |
break; |
560 |
case 0x17: |
561 |
case 0x1d: |
562 |
/* Penryn. FIXME: -mtune=core2 is slower than -mtune=generic */ |
563 |
cpu = "core2"; |
564 |
break; |
565 |
case 0x0f: |
566 |
/* Merom. FIXME: -mtune=core2 is slower than -mtune=generic */ |
567 |
cpu = "core2"; |
568 |
break; |
569 |
default: |
570 |
if (arch) |
571 |
{ |
572 |
if (has_ssse3) |
573 |
/* If it is an unknown CPU with SSSE3, assume Core 2. */ |
574 |
cpu = "core2"; |
575 |
else if (has_sse3) |
576 |
/* It is Core Duo. */ |
577 |
cpu = "pentium-m"; |
578 |
else if (has_sse2) |
579 |
/* It is Pentium M. */ |
580 |
cpu = "pentium-m"; |
581 |
else if (has_sse) |
582 |
/* It is Pentium III. */ |
583 |
cpu = "pentium3"; |
584 |
else if (has_mmx) |
585 |
/* It is Pentium II. */ |
586 |
cpu = "pentium2"; |
587 |
else |
588 |
/* Default to Pentium Pro. */ |
589 |
cpu = "pentiumpro"; |
590 |
} |
562 |
else |
591 |
else |
563 |
/* Default to Pentium Pro. */ |
592 |
/* For -mtune, we default to -mtune=generic. */ |
564 |
cpu = "pentiumpro"; |
593 |
cpu = "generic"; |
|
|
594 |
break; |
565 |
} |
595 |
} |
566 |
else |
|
|
567 |
/* For -mtune, we default to -mtune=generic. */ |
568 |
cpu = "generic"; |
569 |
break; |
596 |
break; |
570 |
case PROCESSOR_PENTIUM4: |
597 |
case PROCESSOR_PENTIUM4: |
571 |
if (has_sse3) |
598 |
if (has_sse3) |