This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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][ARM] -m{cpu,tune,arch}=native


On 20/09/11 11:51, Andrew Stubbs wrote:
> On 09/09/11 12:55, Richard Earnshaw wrote:
>> The part number field is meaningless outside of the context of a a
>> specific vendor -- only taken as a pair can they refer to a specific
>> part.  So why is the vendor field hard-coded rather than factored into
>> the table of parts.
>>
>> Maybe it would be better to have a table of tables, with the top-level
>> table being indexed by vendor id.  Something like
> 
> Yes, but since I only have part numbers for one vendor, I left that sort 
> of thing out on the principle that it's best not to add complexity until 
> you need it.
> 
> Anyway, I have done it now, so here it is. :)
> 
> I've also fixed the problem that if it didn't recognise the CPU, it 
> defaulted to the hard default, ignoring the --with-cpu configured default.
> 
> OK?
> 
> Andrew
> 
> 
> tune-native.patch
> 
> 
> 2011-09-20  Andrew Stubbs  <ams@codesourcery.com>
> 
> 	gcc/
> 	* config.host (arm*-*-linux*): Add driver-arm.o and x-arm.
> 	* config/arm/arm.opt: Add 'native' processor_type and
> 	arm_arch enum values.
> 	* config/arm/arm.h (host_detect_local_cpu): New prototype.
> 	(EXTRA_SPEC_FUNCTIONS): New define.
> 	(MCPU_MTUNE_NATIVE_SPECS): New define.
> 	(DRIVER_SELF_SPECS): New define.
> 	* config/arm/driver-arm.c: New file.
> 	* config/arm/x-arm: New file.
> 	* doc/invoke.texi (ARM Options): Document -mcpu=native,
> 	-mtune=native and -march=native.
> 

There's a presumption in host_detect_local_cpu() that "CPU implementer"
will appear before  "CPU part" in the output of /proc/cpuinfo.  That's
probably a pretty safe assumption (and it appears that it will handle
that case relatively safely -- ie not crash).  I'll let you decide
whether that's important enough to fix.

However another problem I've just spotted is that you never close the
file descriptor if you fail to parse the output properly (ie jump to
not_found).  That should be fixed before this is committed.

OK with the second issue resolved.


R.


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