Summary: | poor -march=native choices for VIA C7 Esther processors | ||
---|---|---|---|
Product: | gcc | Reporter: | JM <opod> |
Component: | target | Assignee: | Not yet assigned to anyone <unassigned> |
Status: | RESOLVED FIXED | ||
Severity: | minor | CC: | gcc-bugs, sezeroz |
Priority: | P3 | ||
Version: | 4.5.1 | ||
Target Milestone: | 4.7.4 | ||
URL: | http://gcc.gnu.org/ml/gcc-patches/2013-05/msg00941.html | ||
Host: | Target: | i686-pc-linux-gnu | |
Build: | Known to work: | ||
Known to fail: | Last reconfirmed: | ||
Attachments: |
native VIA/CentaurHauls
centaur.patch centaur2.patch |
Description
JM
2010-08-20 15:58:31 UTC
Why do you think it's a poor choice? (In reply to comment #1) The processor clearly supports SSE3 so perhaps -march=prescott would be better instead of -march=pentium-m. I also assumed that -march=pentium-m implies -mfpmath=387 but it does not seem to apply (or matter). Finally, -march=native on my laptop picks up L1 and L2 cache sizes as --params which does not happen for the VIA C7. Just for reference, it is reported as Cache info L1 Instruction cache: 64KB, 4-way associative, 1 lines per tag, line size=64 bytes. L1 Data cache: 64KB 4-way associative, 1 lines per tag, line size=64 bytes. L2 (on CPU) cache: 128KB 10-way associative, 1 lines per tag, line size=64 bytes. HTH Created attachment 22220 [details] native VIA/CentaurHauls (In reply to comment #1) > Why do you think it's a poor choice? This is regression after PR target/44046. Previous behaviour was: sse3 -> "-march=prescott -mtune=generic", now: sse3 -> "-march=pentium-m -mtune=generic". This regression lose sse3 support for C-7 CPU. But in other point, "prescott" as family-15 member, may be (or not) else scheduled, then family-6 clone... Other source of problem - VIA/Centaur CPUs detecting as "Intel" vendor. I believe, Intel support have own reason to make choice sse3 -> pentium-m and lose this sse3, then I suggest to forget this behaviour and add native VIA/CentaurHauls support code. There are 3 point of detection: 1) vendor signature; 2) cache detection: according to Linux kernel code, "detect_caches_amd" behaviour is not vendor-specific and used in kernel also for any x86_64, VIA/Centaur, Transmeta and Cyrix family-5/model-5, but I have no exotic CPUs exclude VIA C-7 in my notebook to test other vendors; 3) model detection - C-7 will be "-march=prescott -mtune=core2" (FIXME if pure "prescott" is better!), also may be fixed c3-2 -mtune=c3 selection (Gentoo Wiki suggest -mtune=generic or -march=c3 to avoid NOPL for some models, but I try to not use variable "generic"). Created attachment 22306 [details]
centaur.patch
Just cleanup (c3-2). "-mtune" not passed to assembler, then "-mtune" vs. NOPL (by Gentoo Wiki) is not useful. May be "-Wa,-mtune=generic" or "-Wa,", but not here...
Created attachment 22445 [details]
centaur2.patch
Compatibility with GNU assembler -mtune set (#40171).
I reconfirm this bug using gcc 4.6.3-1ubuntu5 in Ubuntu 12.04 to compile stuff optimized for VIA C7-D Esther processor. Still the same issue: Using -march=native 1) still chooses -march=pentium-m -mtune=generic (ignoring the sse3 capability) 2) will not detect the L1 and L2 cache parameters IMHO, the centaur2.patch suggested by Dzianis Kahanovich is a good fix. Why hasn't it found its way into the official gcc? Best regards and thanks to Dzianis for his contribution linuxball Implemented for 4.7.4, 4.8.1 and mainline by: Author: uros Date: Thu May 16 19:53:36 2013 New Revision: 198987 URL: http://gcc.gnu.org/viewcvs?rev=198987&root=gcc&view=rev Log: PR target/45359 PR target/46396 * config/i386/driver-i386.c (host_detect_local_cpu): Detect VIA/Centaur processors and determine their cache parameters using detect_caches_amd. Modified: trunk/gcc/ChangeLog trunk/gcc/config/i386/driver-i386.c Author: uros Date: Thu May 16 21:41:26 2013 New Revision: 198989 URL: http://gcc.gnu.org/viewcvs?rev=198989&root=gcc&view=rev Log: * config/i386/driver-i386.c (host_detect_local_cpu): Determine cache parameters using detect_caches_amd also for CYRIX, NSC and TM2 signatures. Modified: trunk/gcc/ChangeLog trunk/gcc/config/i386/driver-i386.c Author: uros Date: Fri May 17 15:06:36 2013 New Revision: 199017 URL: http://gcc.gnu.org/viewcvs?rev=199017&root=gcc&view=rev Log: Backport from mainline 2013-05-16 Uros Bizjak <ubizjak@gmail.com> * config/i386/driver-i386.c (host_detect_local_cpu): Determine cache parameters using detect_caches_amd also for CYRIX, NSC and TM2 signatures. 2013-05-16 Uros Bizjak <ubizjak@gmail.com> Dzianis Kahanovich <mahatma@eu.by> PR target/45359 PR target/46396 * config/i386/driver-i386.c (host_detect_local_cpu): Detect VIA/Centaur processors and determine their cache parameters using detect_caches_amd. 2013-05-15 Uros Bizjak <ubizjak@gmail.com> * config/i386/i386.c (ix86_option_override_internal): Update processor_alias_table for missing PTA_PRFCHW and PTA_FXSR flags. Add PTA_POPCNT to corei7 entry. Do not enable SSE prefetch on non-SSE 3dNow! targets. Enable TARGET_PRFCHW for TARGET_3DNOW targets. * config/i386/i386.md (prefetch): Enable for TARGET_PRFCHW instead of TARGET_3DNOW. (*prefetch_3dnow): Enable for TARGET_PRFCHW only. Modified: branches/gcc-4_8-branch/gcc/ChangeLog branches/gcc-4_8-branch/gcc/config/i386/driver-i386.c branches/gcc-4_8-branch/gcc/config/i386/i386.c branches/gcc-4_8-branch/gcc/config/i386/i386.md Author: uros Date: Fri May 17 17:50:11 2013 New Revision: 199026 URL: http://gcc.gnu.org/viewcvs?rev=199026&root=gcc&view=rev Log: Backport from mainline 2013-05-16 Uros Bizjak <ubizjak@gmail.com> * config/i386/driver-i386.c (host_detect_local_cpu): Determine cache parameters using detect_caches_amd also for CYRIX, NSC and TM2 signatures. 2013-05-16 Uros Bizjak <ubizjak@gmail.com> Dzianis Kahanovich <mahatma@eu.by> PR target/45359 PR target/46396 * config/i386/driver-i386.c (host_detect_local_cpu): Detect VIA/Centaur processors and determine their cache parameters using detect_caches_amd. 2013-05-15 Uros Bizjak <ubizjak@gmail.com> * config/i386/i386.c (ix86_option_override_internal): Add PTA_POPCNT to corei7 entry. Modified: branches/gcc-4_7-branch/gcc/ChangeLog branches/gcc-4_7-branch/gcc/config/i386/driver-i386.c branches/gcc-4_7-branch/gcc/config/i386/i386.c |