jit-ir: Add notes and report about vrot prefixes.

This commit is contained in:
Unknown W. Brackets 2016-05-15 14:03:45 -07:00
parent ab1461faca
commit e960158490
3 changed files with 24 additions and 0 deletions

View File

@ -1716,6 +1716,17 @@ namespace MIPSComp {
// calling the math library.
void IRFrontend::Comp_VRot(MIPSOpcode op) {
CONDITIONAL_DISABLE;
if (!js.HasNoPrefix()) {
// Prefixes work strangely for this:
// * They never apply to cos (whether d or s prefixes.)
// * They mostly apply to sin/0, e.g. 0:1, M, or |x|.
DISABLE;
}
// Vector rotation matrix (weird prefixes)
// d[N] = SINCOSVAL(s[0], imm[N])
// The imm selects: cos index, sin index, 0 or sin for others, sin sign flip.
int vd = _VD;
int vs = _VS;
int imm = (op >> 16) & 0x1f;
@ -1844,6 +1855,10 @@ namespace MIPSComp {
if (js.HasUnknownPrefix())
DISABLE;
// Vector butterfly operation
// vbfy2: d[0] = s[0] + s[2], d[1] = s[1] + s[3], d[2] = s[0] - s[2], d[3] = s[1] - s[3]
// vbfy1: d[N*2] = s[N*2] + s[N*2+1], d[N*2+1] = s[N*2] - s[N*2+1]
VectorSize sz = GetVecSize(op);
int n = GetNumVectorElements(sz);
if (n != 2 && n != 4) {

View File

@ -1297,6 +1297,7 @@ namespace MIPSInt
// Generates one line of a rotation matrix around one of the three axes
void Int_Vrot(MIPSOpcode op) {
// Note: prefixes behave strangely for this.
int vd = _VD;
int vs = _VS;
int imm = (op >> 16) & 0x1f;

View File

@ -3410,6 +3410,14 @@ void Jit::CompVrotShuffle(u8 *dregs, int imm, int n, bool negSin) {
// Very heavily used by FF:CC
void Jit::Comp_VRot(MIPSOpcode op) {
CONDITIONAL_DISABLE;
if (js.HasUnknownPrefix()) {
DISABLE;
}
if (!js.HasNoPrefix()) {
// Prefixes work strangely for this, see IRCompVFPU.
WARN_LOG_REPORT(JIT, "vrot instruction using prefixes at %08x", GetCompilerPC());
DISABLE;
}
int vd = _VD;
int vs = _VS;