Bug 46396 - gcc not detect caches for VIA CPUs
Summary: gcc not detect caches for VIA CPUs
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.5.1
: P3 normal
Target Milestone: 4.7.4
Assignee: Not yet assigned to anyone
URL: http://gcc.gnu.org/ml/gcc-patches/201...
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-09 15:05 UTC by Dzianis Kahanovich
Modified: 2013-05-17 18:01 UTC (History)
0 users

See Also:
Host:
Target: x86
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
via_caches.patch (405 bytes, patch)
2010-11-09 15:05 UTC, Dzianis Kahanovich
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dzianis Kahanovich 2010-11-09 15:05:25 UTC
Created attachment 22346 [details]
via_caches.patch

gcc not detect caches for VIA CPUs. But this task is too simple: according to Linux kernel code, "detect_caches_amd" function code is not so vendor-specific, and used in kernel also for any x86_64, VIA/Centaur, Transmeta and Cyrix family-5/model-5. By some reasons (actual & tech) I suggest only code for VIA/Centaur CPUs (works fine for C7). This patch sure applicable to 4.5 & trunk branches and must for any.
Comment 1 Dzianis Kahanovich 2010-11-09 15:18:04 UTC
PS If you think it possible, you may use more complex (+1 hunk) VIA detection patch, attached to Bug #45359.
Comment 2 Andrew Pinski 2010-11-09 17:13:18 UTC
Patches should be sent to gcc-patches@.
Comment 3 Uroš Bizjak 2013-05-17 18:01:56 UTC
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