-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit fixes the ARM compiles. There is still work to be done to get parity to x86: - The Vector unit tests fail because of the call to sqrt(). - The CPUID code needs to be reworked. But this is progress in the right direction. :) Partially fixes #26
- Loading branch information
1 parent
10384ab
commit f94ab31
Showing
8 changed files
with
171 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
Code/max/Hardware/CPU/CPUIDPolicies/AArch64CPUIDPolicy.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Copyright 2019, The max Contributors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#include <max/Hardware/CPU/CPUIDPolicies/AArch64CPUIDPolicy.hpp> | ||
|
||
namespace max | ||
{ | ||
namespace CPU | ||
{ | ||
|
||
void AArch64CPUIDPolicy::CPUID( CPUIDSubleafResult & /*Registers*/, uint32_t /*Leaf*/ ) noexcept | ||
{ | ||
} | ||
|
||
void AArch64CPUIDPolicy::CPUIDExtended( CPUIDSubleafResult & /*Registers*/, uint32_t /*Leaf*/, uint32_t /*Subleaf*/ ) noexcept | ||
{ | ||
} | ||
|
||
} // namespace CPU | ||
} // namespace max |
29 changes: 29 additions & 0 deletions
29
Code/max/Hardware/CPU/CPUIDPolicies/AArch64CPUIDPolicy.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Copyright 2019, The max Contributors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#ifndef MAX_CPU_AARCH64CPUIDPOLICY_HPP | ||
#define MAX_CPU_AARCH64CPUIDPOLICY_HPP | ||
|
||
#include <array> | ||
#include <cstdint> | ||
#include "../CPUIDSubleafResult.hpp" | ||
|
||
namespace max | ||
{ | ||
namespace CPU | ||
{ | ||
|
||
class AArch64CPUIDPolicy | ||
{ | ||
public: | ||
|
||
static void CPUID( CPUIDSubleafResult & Registers, uint32_t Leaf ) noexcept; | ||
static void CPUIDExtended( CPUIDSubleafResult & Registers, uint32_t Leaf, uint32_t Subleaf ) noexcept; | ||
|
||
}; | ||
|
||
} // namespace CPU | ||
} // namespace max | ||
|
||
#endif // #ifndef MAX_CPU_AARCH64CPUIDPOLICY_HPP |
24 changes: 24 additions & 0 deletions
24
Code/max/Hardware/CPU/IsCPUIDAvailablePolicies/ArmIsCPUIDAvailablePolicy.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Copyright 2019, The max Contributors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#ifndef MAX_CPUID_ARMISCPUIDAVAILABLEPOLICY_HPP | ||
#define MAX_CPUID_ARMISCPUIDAVAILABLEPOLICY_HPP | ||
|
||
namespace max | ||
{ | ||
namespace CPU | ||
{ | ||
|
||
class ArmIsCPUIDAvailablePolicy | ||
{ | ||
public: | ||
|
||
static bool IsCPUIDAvailable() noexcept { return true; } | ||
|
||
}; | ||
|
||
} // namespace CPU | ||
} // namespace max | ||
|
||
#endif // #ifndef MAX_CPUID_ARMISCPUIDAVAILABLEPOLICY_HPP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
PROGRAM_NAME = max | ||
CXX_SRCS = \ | ||
../../Code/max/Hardware/CPU/CPUIDPolicies/AArch64CPUIDPolicy.cpp \ | ||
../../Code/max/Hardware/CPU/Associativity.cpp \ | ||
../../Code/max/Hardware/CPU/CacheInfo.cpp \ | ||
../../Code/max/Hardware/CPU/CacheLevel.cpp \ | ||
../../Code/max/Hardware/CPU/CPUID.cpp \ | ||
../../Code/max/Hardware/CPU/CPUIDSubleafArgumentsAndResult.cpp \ | ||
../../Code/max/Hardware/CPU/Prefetch.cpp \ | ||
../../Code/max/Hardware/CPU/TLB.cpp \ | ||
../../Code/max/Hardware/CPU/TraceCache.cpp \ | ||
../../Code/max/Logging/DoNothingLogger.cpp \ | ||
../../Code/max/Testing/CoutResultPolicy.cpp | ||
CXX_OBJS = $(CXX_SRCS:.cpp=.o) | ||
|
||
INCLUDE_PATHS = \ | ||
../../Code | ||
INCLUDE_PATHS_FLAGS = $(foreach d, $(INCLUDE_PATHS), -I$d) | ||
|
||
LIBRARY_PATHS = \ | ||
. | ||
LIBRARY_PATHS_FLAGS = $(foreach d, $(LIBRARY_PATHS), -L$d) | ||
|
||
AUTOMATED_TEST_CXX_SRCS = \ | ||
../../Code/max/Algorithms/IsBetweenTest.cpp \ | ||
../../Code/max/Containers/Bits8Test.cpp \ | ||
../../Code/max/Containers/Bits16Test.cpp \ | ||
../../Code/max/Containers/Bits32Test.cpp \ | ||
../../Code/max/Containers/RangeTest.cpp \ | ||
../../Code/max/Containers/VectorTest.cpp \ | ||
../../Code/max/Testing/AutomatedTestsEntryPoint.cpp | ||
AUTOMATED_TEST_CXX_OBJS = $(AUTOMATED_TEST_CXX_SRCS:.cpp=.o) | ||
|
||
MANUAL_TEST_CXX_SRCS = \ | ||
../../Code/max/Compiling/AliasingOptimizationsTest.cpp \ | ||
../../Code/max/Compiling/ConfigurationTest.cpp \ | ||
../../Code/max/Testing/ManualTestsEntryPoint.cpp | ||
MANUAL_TEST_CXX_OBJS = $(MANUAL_TEST_CXX_SRCS:.cpp=.o) | ||
|
||
CPPFLAGS += $(INCLUDE_PATHS_FLAGS) -std=c++14 -Werror -Wall -Wextra -Wpedantic -Wconversion -Wsign-conversion | ||
LINKER_FLAGS += $(LIBRARY_PATHS_FLAGS) | ||
|
||
|
||
|
||
|
||
all: lib$(PROGRAM_NAME).a maxAutomatedTests maxManualTests | ||
|
||
lib$(PROGRAM_NAME).a: $(PCH_OBJS) $(CXX_OBJS) | ||
ar rcs lib$(PROGRAM_NAME).a $(CXX_OBJS) | ||
|
||
maxAutomatedTests: $(AUTOMATED_TEST_CXX_OBJS) | ||
clang++ -g $(AUTOMATED_TEST_CXX_OBJS) $(LINKER_FLAGS) -l$(PROGRAM_NAME) -o maxAutomatedTests | ||
|
||
maxManualTests: $(MANUAL_TEST_CXX_OBJS) | ||
clang++ -g $(MANUAL_TEST_CXX_OBJS) $(LINKER_FLAGS) -l$(PROGRAM_NAME) -o maxManualTests | ||
.cpp.o: | ||
clang++ -g $(CPPFLAGS) -c $< -o $@ | ||
|
||
clean: | ||
@- $(RM) lib$(PROGRAM_NAME).a | ||
@- $(RM) $(CXX_OBJS) | ||
@- $(RM) maxAutomatedTests | ||
@- $(RM) $(AUTOMATED_TEST_CXX_OBJS) | ||
@- $(RM) maxManualTests | ||
@- $(RM) $(MANUAL_TEST_CXX_OBJS) | ||
|
||
distclean: clean |