Skip to content
Snippets Groups Projects
Commit 11624b9a authored by Mike McQuaid's avatar Mike McQuaid Committed by GitHub
Browse files

hardware: move generic logic from linux. (#454)

parent 416e51bc
No related branches found
No related tags found
No related merge requests found
module Hardware module Hardware
class CPU class CPU
class << self class << self
OPTIMIZATION_FLAGS = {
:penryn => "-march=core2 -msse4.1",
:core2 => "-march=core2",
:core => "-march=prescott"
}.freeze
def optimization_flags
OPTIMIZATION_FLAGS
end
# Linux supports x86 only, and universal archs do not apply
def arch_32_bit
:i386
end
def arch_64_bit
:x86_64
end
def universal_archs def universal_archs
[].extend ArchitectureListExtension [].extend ArchitectureListExtension
end end
......
...@@ -3,19 +3,15 @@ require "os/mac/pathname" ...@@ -3,19 +3,15 @@ require "os/mac/pathname"
module Hardware module Hardware
class CPU class CPU
class << self class << self
PPC_OPTIMIZATION_FLAGS = {
OPTIMIZATION_FLAGS = {
:penryn => "-march=core2 -msse4.1",
:core2 => "-march=core2",
:core => "-march=prescott",
:g3 => "-mcpu=750", :g3 => "-mcpu=750",
:g4 => "-mcpu=7400", :g4 => "-mcpu=7400",
:g4e => "-mcpu=7450", :g4e => "-mcpu=7450",
:g5 => "-mcpu=970", :g5 => "-mcpu=970",
:g5_64 => "-mcpu=970 -arch ppc64" :g5_64 => "-mcpu=970 -arch ppc64",
}.freeze }.freeze
def optimization_flags def optimization_flags
OPTIMIZATION_FLAGS OPTIMIZATION_FLAGS.merge(PPC_OPTIMIZATION_FLAGS)
end end
# These methods use info spewed out by sysctl. # These methods use info spewed out by sysctl.
......
...@@ -8,6 +8,25 @@ module Hardware ...@@ -8,6 +8,25 @@ module Hardware
PPC_64BIT_ARCHS = [:ppc64].freeze PPC_64BIT_ARCHS = [:ppc64].freeze
class << self class << self
OPTIMIZATION_FLAGS = {
:penryn => "-march=core2 -msse4.1",
:core2 => "-march=core2",
:core => "-march=prescott",
:dunno => "",
}.freeze
def optimization_flags
OPTIMIZATION_FLAGS
end
def arch_32_bit
:i386
end
def arch_64_bit
:x86_64
end
def type def type
:dunno :dunno
end end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment