diff options
| author | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2024-07-06 09:53:31 +0200 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2024-07-06 09:53:31 +0200 |
| commit | 7a9da2133cb0f9b72fa81577efc4ece81ca44020 (patch) | |
| tree | cee2c0ee39e89ee34a25e10387fd16c6256a251b | |
| parent | 0495962407af7f89b72e41c8b099cfba51d68e08 (diff) | |
MHR-36: NDK, Update Linker and C++ driver.
Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
| -rw-r--r-- | Doxyfile | 4 | ||||
| -rw-r--r-- | Sources/compile_flags.txt | 2 | ||||
| -rw-r--r-- | Sources/cplusplus.cc | 45 | ||||
| -rw-r--r-- | Sources/link.cc | 2 |
4 files changed, 22 insertions, 31 deletions
@@ -42,7 +42,7 @@ DOXYFILE_ENCODING = UTF-8 # title of most generated pages and in a few other places. # The default value is: My Project. -PROJECT_NAME = NewOS SDK +PROJECT_NAME = NDK # The PROJECT_NUMBER tag can be used to enter a project or revision number. This # could be handy for archiving the generated documentation or if some version @@ -54,7 +54,7 @@ PROJECT_NUMBER = 2.0.0 # for a project that appears at the top of each page and should give viewer a # quick idea about the purpose of the project. Keep the description short. -PROJECT_BRIEF = "MPCC" +PROJECT_BRIEF = "NewOS Developer Kit" # With the PROJECT_LOGO tag one can specify a logo or an icon that is included # in the documentation. The maximum height of the logo should not exceed 55 diff --git a/Sources/compile_flags.txt b/Sources/compile_flags.txt index 028be9d..f9acaba 100644 --- a/Sources/compile_flags.txt +++ b/Sources/compile_flags.txt @@ -1,5 +1,5 @@ -std=c++20 -I../ --I../StdKit +-I../Comm -I./ -I./Detail/ diff --git a/Sources/cplusplus.cc b/Sources/cplusplus.cc index 12847dc..39e5441 100644 --- a/Sources/cplusplus.cc +++ b/Sources/cplusplus.cc @@ -14,7 +14,7 @@ #define kPrintF printf #define kSplashCxx() \ -kPrintF(kWhite "%s\n", "ZECC C++, (c) 2024 Zeta Electronics, all rights reserved.") +kPrintF(kWhite "%s\n", "Zeta C++ Compiler Driver, (c) 2024 Zeta Electronics, all rights reserved.") // import, @free_at_exit { ... }, fn foo() -> auto { ... } @@ -193,30 +193,8 @@ static CompilerBackendCPlusPlus* kCompilerBackend = nullptr; static std::vector<detail::CompilerType> kCompilerVariables; static std::vector<std::string> kCompilerFunctions; -/// detail namespaces - -namespace detail -{ - union number_cast final { - number_cast(UInt64 raw) - : raw(raw) - { - } - - char number[8]; - UInt64 raw; - }; -} // namespace detail - -const char* CompilerBackendCPlusPlus::Language() -{ - return "Zeta C++"; -} - static std::vector<std::string> kRegisterMap; -static size_t kLevelFunction = 0UL; - static std::vector<std::string> cRegisters = { "rbx", "rsi", @@ -226,6 +204,10 @@ static std::vector<std::string> cRegisters = { "r13", "r14", "r15", + "xmm12", + "xmm13", + "xmm14", + "xmm15", }; /// @brief The PEF calling convention (caller must save rax, rbp) @@ -241,10 +223,19 @@ static std::vector<std::string> cRegistersCall = { "xmm11", }; +static size_t kLevelFunction = 0UL; + +/// detail namespaces + +const char* CompilerBackendCPlusPlus::Language() +{ + return "Zeta C++"; +} + ///////////////////////////////////////////////////////////////////////////////////////// /// @name Compile -/// @brief Generate MASM from a C++ source. +/// @brief Generate MASM assembly from a C++ source. ///////////////////////////////////////////////////////////////////////////////////////// @@ -677,12 +668,12 @@ public: if (dest.empty()) { dest = "CXX-MPCC-"; - + std::random_device rd; auto seed_data = std::array<int, std::mt19937::state_size> {}; - + std::generate(std::begin(seed_data), std::end(seed_data), std::ref(rd)); - + std::seed_seq seq(std::begin(seed_data), std::end(seed_data)); std::mt19937 generator(seq); diff --git a/Sources/link.cc b/Sources/link.cc index 757b26a..4c459b5 100644 --- a/Sources/link.cc +++ b/Sources/link.cc @@ -35,7 +35,7 @@ #include <fstream> #include <iostream> -#define kLinkerVersion "Zeta Linker %s, (c) Zeta Electronics Corporation 2024, all rights reserved.\n" +#define kLinkerVersion "Zeta Linker Driver %s, (c) Zeta Electronics Corporation 2024, all rights reserved.\n" #define StringCompare(DST, SRC) strcmp(DST, SRC) |
