Fix SSE support on Core 2 processors
DRY it off a bit.
This commit is contained in:
parent
0543bbcccc
commit
c6d98678ac
@ -45,31 +45,34 @@ cflags=%w[-O3]
|
|||||||
# http://gcc.gnu.org/onlinedocs/gcc-4.2.1/gcc/i386-and-x86_002d64-Options.html
|
# http://gcc.gnu.org/onlinedocs/gcc-4.2.1/gcc/i386-and-x86_002d64-Options.html
|
||||||
if MACOS_VERSION >= 10.6
|
if MACOS_VERSION >= 10.6
|
||||||
case Hardware.intel_family
|
case Hardware.intel_family
|
||||||
when :penryn
|
when :penryn, :core2
|
||||||
cflags<<'-march=core2'<<'-msse4.1'
|
cflags<<"-march=core2"
|
||||||
when :core2
|
when :core
|
||||||
cflags<<"-march=core2"<<'-msse4'
|
cflags<<"-march=prescott"
|
||||||
when :core1
|
|
||||||
cflags<<"-march=prescott"<<'-msse3'
|
|
||||||
end
|
end
|
||||||
ENV['LDFLAGS']="-arch x86_64"
|
ENV['LDFLAGS']="-arch x86_64"
|
||||||
cflags<<'-m64'<<'-mmmx'
|
cflags<<"-m64"
|
||||||
else
|
else
|
||||||
case Hardware.intel_family
|
case Hardware.intel_family
|
||||||
when :penryn
|
when :penryn, :core2
|
||||||
cflags<<"-march=nocona"<<'-msse4.1'
|
cflags<<"-march=nocona"
|
||||||
when :core2
|
when :core
|
||||||
cflags<<"-march=nocona"<<'-msse4'
|
cflags<<"-march=prescott"
|
||||||
when :core1
|
|
||||||
cflags<<"-march=prescott"<<'-msse3'
|
|
||||||
end
|
end
|
||||||
# to be consistent with cflags, we ignore the existing environment
|
# to be consistent with cflags, we ignore the existing environment
|
||||||
ENV['LDFLAGS']=""
|
ENV['LDFLAGS']=""
|
||||||
cflags<<'-mmmx'<<"-mfpmath=sse"
|
cflags<<"-mfpmath=sse"
|
||||||
|
|
||||||
# gcc 4.0 is the default on Leopard
|
# gcc 4.0 is the default on Leopard
|
||||||
ENV['CC']='gcc-4.2'
|
ENV['CC']="gcc-4.2"
|
||||||
ENV['CXX']='g++-4.2'
|
ENV['CXX']="g++-4.2"
|
||||||
|
end
|
||||||
|
|
||||||
|
cflags<<"-mmmx"
|
||||||
|
case Hardware.intel_family
|
||||||
|
when :penryn
|
||||||
|
cflags<<"-msse4.1"
|
||||||
|
when :core2, :core
|
||||||
|
cflags<<"-msse3"
|
||||||
end
|
end
|
||||||
|
|
||||||
# -w: keep signal to noise high
|
# -w: keep signal to noise high
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user