Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

irjit: Fix vi2us/vi2s with non-consecutive #17129

Merged
merged 3 commits into from
Mar 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Common/GPU/Vulkan/VulkanMemory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
// Additionally, Common/Vulkan/* , including this file, are also licensed
// under the public domain.

#include <algorithm>
#include <set>
#include <mutex>

Expand Down
4 changes: 3 additions & 1 deletion Common/MemoryUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,11 +206,12 @@ void *AllocateExecutableMemory(size_t size) {
}

void *AllocateMemoryPages(size_t size, uint32_t memProtFlags) {
size = ppsspp_round_page(size);
#ifdef _WIN32
if (sys_info.dwPageSize == 0)
GetSystemInfo(&sys_info);
uint32_t protect = ConvertProtFlagsWin32(memProtFlags);
// Make sure to do this after GetSystemInfo().
size = ppsspp_round_page(size);
#if PPSSPP_PLATFORM(UWP)
void* ptr = VirtualAllocFromApp(0, size, MEM_COMMIT, protect);
#else
Expand All @@ -221,6 +222,7 @@ void *AllocateMemoryPages(size_t size, uint32_t memProtFlags) {
return nullptr;
}
#else
size = ppsspp_round_page(size);
uint32_t protect = ConvertProtFlagsUnix(memProtFlags);
void *ptr = mmap(0, size, protect, MAP_ANON | MAP_PRIVATE, -1, 0);
if (ptr == MAP_FAILED) {
Expand Down
10 changes: 7 additions & 3 deletions Core/MIPS/IR/IRCompVFPU.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ namespace MIPSComp {
regs[3] == regs[2] + 1;
}

static bool IsVec2(VectorSize sz, const u8 regs[2]) {
return sz == V_Pair && IsConsecutive2(regs) && (regs[0] & 1) == 0;
}

static bool IsVec4(VectorSize sz, const u8 regs[4]) {
return sz == V_Quad && IsConsecutive4(regs) && (regs[0] & 3) == 0;
}
Expand Down Expand Up @@ -1534,10 +1538,10 @@ namespace MIPSComp {

int nOut = GetNumVectorElements(outsize);

// If src registers aren't contiguous, make them (mainly for bits == 8.)
if (sz == V_Quad && !IsVec4(sz, sregs)) {
// If src registers aren't contiguous, make them.
if (!IsVec2(sz, sregs) && !IsVec4(sz, sregs)) {
// T prefix is unused.
for (int i = 0; i < 4; i++) {
for (int i = 0; i < GetNumVectorElements(sz); i++) {
srcregs[i] = IRVTEMP_PFX_T + i;
ir.Write(IROp::FMov, srcregs[i], sregs[i]);
}
Expand Down