summaryrefslogtreecommitdiffhomepage
path: root/Sources/cplusplus.cc
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2024-07-06 09:53:31 +0200
committerAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2024-07-06 09:53:31 +0200
commit7a9da2133cb0f9b72fa81577efc4ece81ca44020 (patch)
treecee2c0ee39e89ee34a25e10387fd16c6256a251b /Sources/cplusplus.cc
parent0495962407af7f89b72e41c8b099cfba51d68e08 (diff)
MHR-36: NDK, Update Linker and C++ driver.
Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'Sources/cplusplus.cc')
-rw-r--r--Sources/cplusplus.cc45
1 files changed, 18 insertions, 27 deletions
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);