From 607071853b965f08906775e72bc2561023d1f0eb Mon Sep 17 00:00:00 2001 From: SimoneN64 Date: Tue, 24 Oct 2023 15:33:19 +0200 Subject: [PATCH] Fix actions --- .github/workflows/build.yml | 10 ++---- src/backend/core/JIT/instructions.cpp | 12 ------- .../core/registers/cop/cop1instructions.cpp | 36 +++++++++---------- src/frontend/Language.cpp | 11 ------ src/frontend/Language.hpp | 8 ++++- 5 files changed, 28 insertions(+), 49 deletions(-) delete mode 100644 src/frontend/Language.cpp diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8c77d223..8d74f6cd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -24,12 +24,8 @@ jobs: sudo make install - name: Build Kaizen run: | - cmake \ - -G Ninja \ - -B build \ - -DCMAKE_BUILD_TYPE=Release \ - -S src - ninja -j$(nproc) -C build + cmake -G Ninja -B build -DCMAKE_BUILD_TYPE=Release + cmake --build build --config Release - name: Collect artifacts run: | mkdir upload @@ -51,7 +47,7 @@ jobs: vcpkg install sdl2[vulkan]:x64-windows fmt:x64-windows nlohmann-json:x64-windows mio:x64-windows - name: Build Kaizen run: | - cmake -B build -T clangcl -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_BUILD_TYPE=Release -S src + cmake -B build -T clangcl -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_BUILD_TYPE=Release cmake --build build --config Release - name: Collect artifacts run: | diff --git a/src/backend/core/JIT/instructions.cpp b/src/backend/core/JIT/instructions.cpp index d1fc7fb9..16beac43 100644 --- a/src/backend/core/JIT/instructions.cpp +++ b/src/backend/core/JIT/instructions.cpp @@ -213,9 +213,6 @@ void JIT::b(u32 instr, const Xbyak::Reg64& op1, const T& op2, BranchCond cond) { template void JIT::b(u32 instr, const Xbyak::Reg64& op1, const Xbyak::Reg64& op2, BranchCond cond); template void JIT::b(u32 instr, const Xbyak::Reg64& op1, const int& op2, BranchCond cond); -template void JIT::b(u32, const Xbyak::Reg64& op1, const Xbyak::Reg64& op2, BranchCond cond); -template void JIT::b(u32, const Xbyak::Reg64& op1, const int& op2, BranchCond cond); - template void JIT::blink(u32 instr, const Xbyak::Reg64& op1, const T& op2, BranchCond cond) { s16 imm = instr; @@ -227,9 +224,6 @@ void JIT::blink(u32 instr, const Xbyak::Reg64& op1, const T& op2, BranchCond con template void JIT::blink(u32 instr, const Xbyak::Reg64& op1, const Xbyak::Reg64& op2, BranchCond cond); template void JIT::blink(u32 instr, const Xbyak::Reg64& op1, const int& op2, BranchCond cond); -template void JIT::blink(u32, const Xbyak::Reg64& op1, const Xbyak::Reg64& op2, BranchCond cond); -template void JIT::blink(u32, const Xbyak::Reg64& op1, const int& op2, BranchCond cond); - template void JIT::bl(u32 instr, const Xbyak::Reg64& op1, const T& op2, BranchCond cond) { s16 imm = instr; @@ -239,9 +233,6 @@ void JIT::bl(u32 instr, const Xbyak::Reg64& op1, const T& op2, BranchCond cond) template void JIT::bl(u32 instr, const Xbyak::Reg64& op1, const Xbyak::Reg64& op2, BranchCond cond); template void JIT::bl(u32 instr, const Xbyak::Reg64& op1, const int& op2, BranchCond cond); -template void JIT::bl(u32, const Xbyak::Reg64& op1, const Xbyak::Reg64& op2, BranchCond cond); -template void JIT::bl(u32, const Xbyak::Reg64& op1, const int& op2, BranchCond cond); - template void JIT::bllink(u32 instr, const Xbyak::Reg64& op1, const T& op2, BranchCond cond) { mov(rcx, qword[rdi + offsetof(Registers, nextPC)]); @@ -253,9 +244,6 @@ void JIT::bllink(u32 instr, const Xbyak::Reg64& op1, const T& op2, BranchCond co template void JIT::bllink(u32 instr, const Xbyak::Reg64& op1, const Xbyak::Reg64& op2, BranchCond cond); template void JIT::bllink(u32 instr, const Xbyak::Reg64& op1, const int& op2, BranchCond cond); -template void JIT::bllink(u32, const Xbyak::Reg64& op1, const Xbyak::Reg64& op2, BranchCond cond); -template void JIT::bllink(u32, const Xbyak::Reg64& op1, const int& op2, BranchCond cond); - void JIT::lui(u32 instr) { u64 val = s64(s16(instr)); val <<= 16; diff --git a/src/backend/core/registers/cop/cop1instructions.cpp b/src/backend/core/registers/cop/cop1instructions.cpp index 89970685..c38c2bb7 100644 --- a/src/backend/core/registers/cop/cop1instructions.cpp +++ b/src/backend/core/registers/cop/cop1instructions.cpp @@ -153,6 +153,24 @@ FORCE_INLINE void SetFPUCauseCVTRaised(Registers& regs, int raised) { SetFPUCauseRaised(regs, raised); } +#define F_TO_U32(f) (*((u32*)(&(f)))) +#define D_TO_U64(d) (*((u64*)(&(d)))) +#define U64_TO_D(d) (*((double*)(&(d)))) +#define U32_TO_F(f) (*((float*)(&(f)))) + +template +FORCE_INLINE bool isqnan(T f) { + if constexpr(std::is_same_v) { + u32 v = F_TO_U32(f); + return (v & 0x7FC00000) == 0x7FC00000; + } else if constexpr(std::is_same_v) { + u64 v = D_TO_U64(f); + return (v & 0x7FF8000000000000) == 0x7FF8000000000000; + } else { + Util::panic("Invalid float type in isqnan"); + } +} + template FORCE_INLINE void SetCauseByArg(Registers& regs, T f) { int c = std::fpclassify(f); @@ -176,11 +194,6 @@ FORCE_INLINE void SetCauseByArg(Registers& regs, T f) { } } -#define F_TO_U32(f) (*((u32*)(&(f)))) -#define D_TO_U64(d) (*((u64*)(&(d)))) -#define U64_TO_D(d) (*((double*)(&(d)))) -#define U32_TO_F(f) (*((float*)(&(f)))) - template FORCE_INLINE void SetCauseOnResult(Registers& regs, T& d) { Cop1& cop1 = regs.cop1; @@ -254,19 +267,6 @@ FORCE_INLINE bool isnan(T f) { } } -template -FORCE_INLINE bool isqnan(T f) { - if constexpr(std::is_same_v) { - u32 v = F_TO_U32(f); - return (v & 0x7FC00000) == 0x7FC00000; - } else if constexpr(std::is_same_v) { - u64 v = D_TO_U64(f); - return (v & 0x7FF8000000000000) == 0x7FF8000000000000; - } else { - Util::panic("Invalid float type in isqnan"); - } -} - #define checknanregs(fs, ft) do { \ if(isnan(fs) || isnan(ft)) { \ regs.cop1.fcr31.cause_invalid_operation = true; \ diff --git a/src/frontend/Language.cpp b/src/frontend/Language.cpp deleted file mode 100644 index f88df5ab..00000000 --- a/src/frontend/Language.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include - -namespace Language { -void SetLanguage(std::map& lang, int selectedLang) { - switch (selectedLang) { - case AvailableLangs::ENGLISH: lang = english; break; - case AvailableLangs::ITALIAN: lang = italian; break; - default: Util::panic("Language not supported, index {}\n", selectedLang); - } -} -} \ No newline at end of file diff --git a/src/frontend/Language.hpp b/src/frontend/Language.hpp index 9c058d37..6c4ee8bc 100644 --- a/src/frontend/Language.hpp +++ b/src/frontend/Language.hpp @@ -83,5 +83,11 @@ static const std::array languages = { "Italiano" }; -void SetLanguage(std::map& lang, int selectedLang); +static FORCE_INLINE void SetLanguage(std::map& lang, int selectedLang) { + switch (selectedLang) { + case AvailableLangs::ENGLISH: lang = english; break; + case AvailableLangs::ITALIAN: lang = italian; break; + default: Util::panic("Language not supported, index {}\n", selectedLang); + } +} } \ No newline at end of file