Skip to content

Commit

Permalink
SPU: basic function analysis implemented
Browse files Browse the repository at this point in the history
Basic stack frame layout analysis.
Function detection in Giga mode.
Basic use of new information in SPU LLVM.

This is WIP and may not work correctly.
Optimizations include but not limited to:
 * Compiling SPU functions as native functions when eligible
 * Avoiding register context write-out
  • Loading branch information
Nekotekina committed May 6, 2019
1 parent f480ba1 commit e3ca4dd
Show file tree
Hide file tree
Showing 3 changed files with 1,001 additions and 191 deletions.
27 changes: 18 additions & 9 deletions rpcs3/Emu/Cell/SPUAnalyser.h
Expand Up @@ -11,6 +11,7 @@ struct spu_itype
static constexpr struct branch_tag{} branch{}; // Branch Instructions
static constexpr struct floating_tag{} floating{}; // Floating-Point Instructions
static constexpr struct quadrop_tag{} _quadrop{}; // 4-op Instructions
static constexpr struct xfloat_tag{} xfloat{}; // Instructions producing xfloat values

enum type : unsigned char
{
Expand Down Expand Up @@ -146,24 +147,26 @@ struct spu_itype
FMS, // quadrop_tag last

FA,
DFA,
FS,
DFS,
FM,
FREST,
FRSQEST,
FI,
CSFLT,
CUFLT,
FRDS, // xfloat_tag last

DFA,
DFS,
DFM,
DFMA,
DFNMS,
DFMS,
DFNMA,
FREST,
FRSQEST,
FI,
CSFLT,
FESD,

CFLTS,
CUFLT,
CFLTU,
FRDS,
FESD,
FCEQ,
FCMEQ,
FCGT,
Expand Down Expand Up @@ -252,6 +255,12 @@ struct spu_itype
{
return value >= MPYA && value <= FMS;
}

// Test for xfloat instruction
friend constexpr bool operator &(type value, xfloat_tag)
{
return value >= FMA && value <= FRDS;
}
};

struct spu_iflag
Expand Down

0 comments on commit e3ca4dd

Please sign in to comment.