summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Lioncash2015-12-06 15:03:06 -0500
committerGravatar Lioncash2015-12-06 15:03:06 -0500
commitd03e7f08ff0f6ddbc98a92c01ad013128d9ba564 (patch)
tree6e7a6dda60436c57042e5fab9e7ede23a1da4894 /src
parentMerge pull request #1252 from Subv/cam (diff)
downloadyuzu-d03e7f08ff0f6ddbc98a92c01ad013128d9ba564.tar.gz
yuzu-d03e7f08ff0f6ddbc98a92c01ad013128d9ba564.tar.xz
yuzu-d03e7f08ff0f6ddbc98a92c01ad013128d9ba564.zip
dyncom: const correctness changes
Diffstat (limited to 'src')
-rw-r--r--src/core/arm/dyncom/arm_dyncom_interpreter.cpp2
-rw-r--r--src/core/arm/dyncom/arm_dyncom_run.h4
-rw-r--r--src/core/arm/skyeye_common/vfp/vfp_helper.h8
3 files changed, 7 insertions, 7 deletions
diff --git a/src/core/arm/dyncom/arm_dyncom_interpreter.cpp b/src/core/arm/dyncom/arm_dyncom_interpreter.cpp
index 96c88c83a..2cff2a26a 100644
--- a/src/core/arm/dyncom/arm_dyncom_interpreter.cpp
+++ b/src/core/arm/dyncom/arm_dyncom_interpreter.cpp
@@ -51,7 +51,7 @@ enum {
51 51
52typedef unsigned int (*shtop_fp_t)(ARMul_State* cpu, unsigned int sht_oper); 52typedef unsigned int (*shtop_fp_t)(ARMul_State* cpu, unsigned int sht_oper);
53 53
54static bool CondPassed(ARMul_State* cpu, unsigned int cond) { 54static bool CondPassed(const ARMul_State* cpu, unsigned int cond) {
55 const bool n_flag = cpu->NFlag != 0; 55 const bool n_flag = cpu->NFlag != 0;
56 const bool z_flag = cpu->ZFlag != 0; 56 const bool z_flag = cpu->ZFlag != 0;
57 const bool c_flag = cpu->CFlag != 0; 57 const bool c_flag = cpu->CFlag != 0;
diff --git a/src/core/arm/dyncom/arm_dyncom_run.h b/src/core/arm/dyncom/arm_dyncom_run.h
index 13bef17fc..85c8d798e 100644
--- a/src/core/arm/dyncom/arm_dyncom_run.h
+++ b/src/core/arm/dyncom/arm_dyncom_run.h
@@ -30,7 +30,7 @@
30 * @return If the PC is being read, then the word-aligned PC value is returned. 30 * @return If the PC is being read, then the word-aligned PC value is returned.
31 * If the PC is not being read, then the value stored in the register is returned. 31 * If the PC is not being read, then the value stored in the register is returned.
32 */ 32 */
33static inline u32 CHECK_READ_REG15_WA(ARMul_State* cpu, int Rn) { 33static inline u32 CHECK_READ_REG15_WA(const ARMul_State* cpu, int Rn) {
34 return (Rn == 15) ? ((cpu->Reg[15] & ~0x3) + cpu->GetInstructionSize() * 2) : cpu->Reg[Rn]; 34 return (Rn == 15) ? ((cpu->Reg[15] & ~0x3) + cpu->GetInstructionSize() * 2) : cpu->Reg[Rn];
35} 35}
36 36
@@ -43,6 +43,6 @@ static inline u32 CHECK_READ_REG15_WA(ARMul_State* cpu, int Rn) {
43 * @return If the PC is being read, then the incremented PC value is returned. 43 * @return If the PC is being read, then the incremented PC value is returned.
44 * If the PC is not being read, then the values stored in the register is returned. 44 * If the PC is not being read, then the values stored in the register is returned.
45 */ 45 */
46static inline u32 CHECK_READ_REG15(ARMul_State* cpu, int Rn) { 46static inline u32 CHECK_READ_REG15(const ARMul_State* cpu, int Rn) {
47 return (Rn == 15) ? ((cpu->Reg[15] & ~0x1) + cpu->GetInstructionSize() * 2) : cpu->Reg[Rn]; 47 return (Rn == 15) ? ((cpu->Reg[15] & ~0x1) + cpu->GetInstructionSize() * 2) : cpu->Reg[Rn];
48} 48}
diff --git a/src/core/arm/skyeye_common/vfp/vfp_helper.h b/src/core/arm/skyeye_common/vfp/vfp_helper.h
index 91a8d4d57..3358ff1d9 100644
--- a/src/core/arm/skyeye_common/vfp/vfp_helper.h
+++ b/src/core/arm/skyeye_common/vfp/vfp_helper.h
@@ -249,7 +249,7 @@ enum : u32 {
249 VFP_SNAN = (VFP_NAN|VFP_NAN_SIGNAL) 249 VFP_SNAN = (VFP_NAN|VFP_NAN_SIGNAL)
250}; 250};
251 251
252static inline int vfp_single_type(vfp_single* s) 252static inline int vfp_single_type(const vfp_single* s)
253{ 253{
254 int type = VFP_NUMBER; 254 int type = VFP_NUMBER;
255 if (s->exponent == 255) { 255 if (s->exponent == 255) {
@@ -293,7 +293,7 @@ static inline void vfp_single_unpack(vfp_single* s, s32 val, u32* fpscr)
293 293
294// Re-pack a single-precision float. This assumes that the float is 294// Re-pack a single-precision float. This assumes that the float is
295// already normalised such that the MSB is bit 30, _not_ bit 31. 295// already normalised such that the MSB is bit 30, _not_ bit 31.
296static inline s32 vfp_single_pack(vfp_single* s) 296static inline s32 vfp_single_pack(const vfp_single* s)
297{ 297{
298 u32 val = (s->sign << 16) + 298 u32 val = (s->sign << 16) +
299 (s->exponent << VFP_SINGLE_MANTISSA_BITS) + 299 (s->exponent << VFP_SINGLE_MANTISSA_BITS) +
@@ -335,7 +335,7 @@ struct vfp_double {
335#define vfp_double_packed_exponent(v) (((v) >> VFP_DOUBLE_MANTISSA_BITS) & ((1 << VFP_DOUBLE_EXPONENT_BITS) - 1)) 335#define vfp_double_packed_exponent(v) (((v) >> VFP_DOUBLE_MANTISSA_BITS) & ((1 << VFP_DOUBLE_EXPONENT_BITS) - 1))
336#define vfp_double_packed_mantissa(v) ((v) & ((1ULL << VFP_DOUBLE_MANTISSA_BITS) - 1)) 336#define vfp_double_packed_mantissa(v) ((v) & ((1ULL << VFP_DOUBLE_MANTISSA_BITS) - 1))
337 337
338static inline int vfp_double_type(vfp_double* s) 338static inline int vfp_double_type(const vfp_double* s)
339{ 339{
340 int type = VFP_NUMBER; 340 int type = VFP_NUMBER;
341 if (s->exponent == 2047) { 341 if (s->exponent == 2047) {
@@ -379,7 +379,7 @@ static inline void vfp_double_unpack(vfp_double* s, s64 val, u32* fpscr)
379 379
380// Re-pack a double-precision float. This assumes that the float is 380// Re-pack a double-precision float. This assumes that the float is
381// already normalised such that the MSB is bit 30, _not_ bit 31. 381// already normalised such that the MSB is bit 30, _not_ bit 31.
382static inline s64 vfp_double_pack(vfp_double* s) 382static inline s64 vfp_double_pack(const vfp_double* s)
383{ 383{
384 u64 val = ((u64)s->sign << 48) + 384 u64 val = ((u64)s->sign << 48) +
385 ((u64)s->exponent << VFP_DOUBLE_MANTISSA_BITS) + 385 ((u64)s->exponent << VFP_DOUBLE_MANTISSA_BITS) +