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
class CPU
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
[].extend ArchitectureListExtension
end
......
......@@ -3,19 +3,15 @@ require "os/mac/pathname"
module Hardware
class CPU
class << self
OPTIMIZATION_FLAGS = {
:penryn => "-march=core2 -msse4.1",
:core2 => "-march=core2",
:core => "-march=prescott",
PPC_OPTIMIZATION_FLAGS = {
:g3 => "-mcpu=750",
:g4 => "-mcpu=7400",
:g4e => "-mcpu=7450",
:g5 => "-mcpu=970",
:g5_64 => "-mcpu=970 -arch ppc64"
:g5_64 => "-mcpu=970 -arch ppc64",
}.freeze
def optimization_flags
OPTIMIZATION_FLAGS
OPTIMIZATION_FLAGS.merge(PPC_OPTIMIZATION_FLAGS)
end
# These methods use info spewed out by sysctl.
......
......@@ -8,6 +8,25 @@ module Hardware
PPC_64BIT_ARCHS = [:ppc64].freeze
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
:dunno
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