From 6b89aadfb5d7104bae2860c30bb682ae83625977 Mon Sep 17 00:00:00 2001 From: fp64 <106717720+fp64@users.noreply.github.com> Date: Sun, 19 Feb 2023 02:30:17 -0500 Subject: [PATCH] Fix the sign of cos(2*n+1) Also fix the license text. --- Core/MIPS/MIPSVFPUUtils.cpp | 3 +-- Core/MIPS/vfpu_sin_lut.h | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Core/MIPS/MIPSVFPUUtils.cpp b/Core/MIPS/MIPSVFPUUtils.cpp index e03badb91b1b..d6e62adb5175 100644 --- a/Core/MIPS/MIPSVFPUUtils.cpp +++ b/Core/MIPS/MIPSVFPUUtils.cpp @@ -993,7 +993,6 @@ float vfpu_sin(float x) { return (sign ? -1.0f : +1.0f) * float(int32_t(ret)) * 3.7252903e-09f; // 0x1p-28f } -// WARNING: not tested. float vfpu_cos(float x) { uint32_t bits; memcpy(&bits, &x, sizeof(x)); @@ -1022,7 +1021,7 @@ float vfpu_cos(float x) { } sign ^= ((significand << 7) & 0x80000000u); significand &= 0x00FFFFFFu; - if(significand > 0x00800000u) { + if(significand >= 0x00800000u) { significand = 0x01000000u - significand; sign ^= 0x80000000u; } diff --git a/Core/MIPS/vfpu_sin_lut.h b/Core/MIPS/vfpu_sin_lut.h index d2bec3021179..ba891c86abcc 100644 --- a/Core/MIPS/vfpu_sin_lut.h +++ b/Core/MIPS/vfpu_sin_lut.h @@ -1,4 +1,4 @@ -// Copyright (c) 2012- PPSSPP Project. +// Copyright (c) 2023- PPSSPP Project. // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by