On Sun, 2005-02-27 at 19:32 -0500, David Edelsohn wrote: > >>>>> Benjamin Herrenschmidt writes: > > Ben> The only problem I see is that the day we have a CPU, let's call it > Ben> POWER8 for the sake of this demonstration, that has altivec and is > Ben> different enough to justify a specific "optimize" option, we'll have to > Ben> use -mcpu=POWER8 -mno-altivec for the whole kernel, which makes it > Ben> difficult to enable altivec only for the raid6 file since the kenrel > Ben> makefiles, afaik, can only add an option to a specific file. Unless > Ben> -mcpu=POWER8 -mno-altivec -maltivec is legal ... > > It depends why you are using -mcpu=power8. If one wants to > generate common PowerPC code tuned for POWER8, one could use > -mtune=power8. If one specifically wants to generate POWER4, POWER5, etc. > base architecture instructions, GCC probably should add a PowerPC/AS > generic cpu type to match the existing "powerpc" and "powerpc64" types so > that one could enable the instructions common to the architecture and tune > for the latest processor without enabling processor-specific features.
I'm talking about processor specific features. For example, we currently use -mcpu=power4 with CONFIG_POWER4 is enabled to enable gcc to generate power4-and-later only instructions. What if we want a similar CONFIG_POWER8 option in the future because those new instructions make an interesting enough difference in perfs ? -mcpu=power8 will enable altivec by default, so I'll have to add -mno-altivec to the "generic" CFLAGS. But then, how can I specify in the "additional" CFLAGS for the RAID6 code -maltivec ? Ben.