Skip to content

Commit

Permalink
Fix the sign of cos(2*n+1)
Browse files Browse the repository at this point in the history
Also fix the license text.
  • Loading branch information
fp64 committed Feb 19, 2023
1 parent a5de1e9 commit 6b89aad
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions Core/MIPS/MIPSVFPUUtils.cpp
Expand Up @@ -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));
Expand Down Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion 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
Expand Down

0 comments on commit 6b89aad

Please sign in to comment.