NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kern/47248: Using -march=native on Intel I5 causes illegal instructions

On Mon, Nov 26, 2012 at 10:10:00AM +0000, wrote:
> >Synopsis:       Using -march=native on Intel I5 causes illegal instructions

The gcc code that converts -march=native into a list of -mxxx options
(-mcx16 -msahf -maes -mpclmul -mpopcnt -mavx on my i7) is only checking
that the cpu supports the extra instructions, not that the OS also has

The Intel docs vol 1 secton 13.5 tell you to check the OXSAVE bit
as well as the AVX one (otherwise it is likely to be an old OS).
The doc also says to check that the XCR0 bits indicate that AVX
can actually be used - but I suspect the kernel may want to 'lazy-set'
that bit.

Checking OXSAVE is easy, fixed in rev 1.2 of gcc's driver_i386.c


David Laight:

Home | Main Index | Thread Index | Old Index