mirror of
https://github.com/citra-emu/citra.git
synced 2024-11-25 10:30:15 +00:00
fixup! static -> inline in headers, moved instruction/helper/load_store.h function bodies into .cpp file
This commit is contained in:
parent
c3967e798b
commit
366a8c5ce9
@ -287,6 +287,7 @@ if(ARCHITECTURE_x86_64)
|
|||||||
arm/jit_x64/instructions/synchronisation.cpp
|
arm/jit_x64/instructions/synchronisation.cpp
|
||||||
arm/jit_x64/instructions/status_register.cpp
|
arm/jit_x64/instructions/status_register.cpp
|
||||||
arm/jit_x64/instructions/thumb.cpp
|
arm/jit_x64/instructions/thumb.cpp
|
||||||
|
arm/jit_x64/instructions/helper/load_store.cpp
|
||||||
arm/jit_x64/interface.cpp
|
arm/jit_x64/interface.cpp
|
||||||
arm/jit_x64/interpret.cpp
|
arm/jit_x64/interpret.cpp
|
||||||
arm/jit_x64/jit_x64.cpp
|
arm/jit_x64/jit_x64.cpp
|
||||||
|
@ -122,7 +122,7 @@ enum class Register {
|
|||||||
INVALID_REG = 99
|
INVALID_REG = 99
|
||||||
};
|
};
|
||||||
|
|
||||||
static Register operator+ (Register arm_reg, int number) {
|
inline Register operator+ (Register arm_reg, int number) {
|
||||||
ASSERT(arm_reg != Register::INVALID_REG);
|
ASSERT(arm_reg != Register::INVALID_REG);
|
||||||
|
|
||||||
int value = static_cast<int>(arm_reg) + number;
|
int value = static_cast<int>(arm_reg) + number;
|
||||||
|
@ -43,7 +43,7 @@ constexpr bool IsValidArmReg(ArmReg arm_reg) {
|
|||||||
return static_cast<unsigned>(arm_reg) <= 15;
|
return static_cast<unsigned>(arm_reg) <= 15;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool IsEvenArmReg(ArmReg arm_reg) {
|
inline bool IsEvenArmReg(ArmReg arm_reg) {
|
||||||
ASSERT(IsValidArmReg(arm_reg));
|
ASSERT(IsValidArmReg(arm_reg));
|
||||||
return static_cast<unsigned>(arm_reg) % 2 == 0;
|
return static_cast<unsigned>(arm_reg) % 2 == 0;
|
||||||
}
|
}
|
||||||
|
73
src/core/arm/jit_x64/instructions/helper/load_store.cpp
Normal file
73
src/core/arm/jit_x64/instructions/helper/load_store.cpp
Normal file
@ -0,0 +1,73 @@
|
|||||||
|
// Copyright 2016 Citra Emulator Project
|
||||||
|
// Licensed under GPLv2 or any later version
|
||||||
|
// Refer to the license.txt file included.
|
||||||
|
|
||||||
|
#include "common/common_types.h"
|
||||||
|
#include "common/swap.h"
|
||||||
|
|
||||||
|
#include "core/arm/jit_x64/instructions/helper/load_store.h"
|
||||||
|
#include "core/memory.h"
|
||||||
|
|
||||||
|
namespace JitX64 {
|
||||||
|
|
||||||
|
u64 Load64LE(u32 addr) {
|
||||||
|
// TODO: Improve this.
|
||||||
|
return Memory::Read32(addr) | (static_cast<u64>(Memory::Read32(addr + 4)) << 32);
|
||||||
|
}
|
||||||
|
|
||||||
|
u64 Load64BE(u32 addr) {
|
||||||
|
// TODO: Improve this.
|
||||||
|
return Common::swap32(Memory::Read32(addr)) | (static_cast<u64>(Common::swap32(Memory::Read32(addr + 4))) << 32);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Store64LE(u32 addr, u32 v1, u32 v2) {
|
||||||
|
Memory::Write32(addr, v1);
|
||||||
|
Memory::Write32(addr + 4, v2);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Store64BE(u32 addr, u32 v1, u32 v2) {
|
||||||
|
Memory::Write32(addr, Common::swap32(v2));
|
||||||
|
Memory::Write32(addr + 4, Common::swap32(v1));
|
||||||
|
}
|
||||||
|
|
||||||
|
u32 Load32LE(u32 addr) {
|
||||||
|
return Memory::Read32(addr);
|
||||||
|
}
|
||||||
|
|
||||||
|
u32 Load32BE(u32 addr) {
|
||||||
|
return Common::swap32(Memory::Read32(addr));
|
||||||
|
}
|
||||||
|
|
||||||
|
void Store32LE(u32 addr, u32 value) {
|
||||||
|
Memory::Write32(addr, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Store32BE(u32 addr, u32 value) {
|
||||||
|
Memory::Write32(addr, Common::swap32(value));
|
||||||
|
}
|
||||||
|
|
||||||
|
u16 Load16LE(u32 addr) {
|
||||||
|
return Memory::Read16(addr);
|
||||||
|
}
|
||||||
|
|
||||||
|
u16 Load16BE(u32 addr) {
|
||||||
|
return Common::swap16(Memory::Read16(addr));
|
||||||
|
}
|
||||||
|
|
||||||
|
void Store16LE(u32 addr, u16 value) {
|
||||||
|
Memory::Write16(addr, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Store16BE(u32 addr, u16 value) {
|
||||||
|
Memory::Write16(addr, Common::swap16(value));
|
||||||
|
}
|
||||||
|
|
||||||
|
u32 Load8(u32 addr) {
|
||||||
|
return Memory::Read8(addr);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Store8(u32 addr, u8 value) {
|
||||||
|
Memory::Write8(addr, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -2,10 +2,9 @@
|
|||||||
// Licensed under GPLv2 or any later version
|
// Licensed under GPLv2 or any later version
|
||||||
// Refer to the license.txt file included.
|
// Refer to the license.txt file included.
|
||||||
|
|
||||||
#include "common/common_types.h"
|
#pragma once
|
||||||
#include "common/swap.h"
|
|
||||||
|
|
||||||
#include "core/memory.h"
|
#include "common/common_types.h"
|
||||||
|
|
||||||
namespace JitX64 {
|
namespace JitX64 {
|
||||||
|
|
||||||
@ -13,64 +12,22 @@ namespace JitX64 {
|
|||||||
|
|
||||||
constexpr u32 RESERVATION_GRANULE_MASK = 0xFFFFFFF8;
|
constexpr u32 RESERVATION_GRANULE_MASK = 0xFFFFFFF8;
|
||||||
|
|
||||||
static u64 Load64LE(u32 addr) {
|
u64 Load64LE(u32 addr);
|
||||||
// TODO: Improve this.
|
u64 Load64BE(u32 addr);
|
||||||
return Memory::Read32(addr) | (static_cast<u64>(Memory::Read32(addr + 4)) << 32);
|
void Store64LE(u32 addr, u32 v1, u32 v2);
|
||||||
}
|
void Store64BE(u32 addr, u32 v1, u32 v2);
|
||||||
|
|
||||||
static u64 Load64BE(u32 addr) {
|
u32 Load32LE(u32 addr);
|
||||||
// TODO: Improve this.
|
u32 Load32BE(u32 addr);
|
||||||
return Common::swap32(Memory::Read32(addr)) | (static_cast<u64>(Common::swap32(Memory::Read32(addr + 4))) << 32);
|
void Store32LE(u32 addr, u32 value);
|
||||||
}
|
void Store32BE(u32 addr, u32 value);
|
||||||
|
|
||||||
static void Store64LE(u32 addr, u32 v1, u32 v2) {
|
u16 Load16LE(u32 addr);
|
||||||
Memory::Write32(addr, v1);
|
u16 Load16BE(u32 addr);
|
||||||
Memory::Write32(addr + 4, v2);
|
void Store16LE(u32 addr, u16 value);
|
||||||
}
|
void Store16BE(u32 addr, u16 value);
|
||||||
|
|
||||||
static void Store64BE(u32 addr, u32 v1, u32 v2) {
|
u32 Load8(u32 addr);
|
||||||
Memory::Write32(addr, Common::swap32(v2));
|
void Store8(u32 addr, u8 value);
|
||||||
Memory::Write32(addr + 4, Common::swap32(v1));
|
|
||||||
}
|
|
||||||
|
|
||||||
static u32 Load32LE(u32 addr) {
|
|
||||||
return Memory::Read32(addr);
|
|
||||||
}
|
|
||||||
|
|
||||||
static u32 Load32BE(u32 addr) {
|
|
||||||
return Common::swap32(Memory::Read32(addr));
|
|
||||||
}
|
|
||||||
|
|
||||||
static void Store32LE(u32 addr, u32 value) {
|
|
||||||
Memory::Write32(addr, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void Store32BE(u32 addr, u32 value) {
|
|
||||||
Memory::Write32(addr, Common::swap32(value));
|
|
||||||
}
|
|
||||||
|
|
||||||
static u16 Load16LE(u32 addr) {
|
|
||||||
return Memory::Read16(addr);
|
|
||||||
}
|
|
||||||
|
|
||||||
static u16 Load16BE(u32 addr) {
|
|
||||||
return Common::swap16(Memory::Read16(addr));
|
|
||||||
}
|
|
||||||
|
|
||||||
static void Store16LE(u32 addr, u16 value) {
|
|
||||||
Memory::Write16(addr, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void Store16BE(u32 addr, u16 value) {
|
|
||||||
Memory::Write16(addr, Common::swap16(value));
|
|
||||||
}
|
|
||||||
|
|
||||||
static u32 Load8(u32 addr) {
|
|
||||||
return Memory::Read8(addr);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void Store8(u32 addr, u8 value) {
|
|
||||||
Memory::Write8(addr, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace JitX64
|
} // namespace JitX64
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
|
|
||||||
#include "core/arm/jit_x64/jit_x64.h"
|
#include "core/arm/jit_x64/jit_x64.h"
|
||||||
#include "core/arm/jit_x64/instructions/helper/load_store.h"
|
#include "core/arm/jit_x64/instructions/helper/load_store.h"
|
||||||
|
#include "core/memory.h"
|
||||||
|
|
||||||
namespace JitX64 {
|
namespace JitX64 {
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user