FEX icon indicating copy to clipboard operation
FEX copied to clipboard

IR: ConstProp potentially incorrect mask

Open Sonicadvance1 opened this issue 4 years ago • 3 comments

https://github.com/FEX-Emu/FEX/blob/main/External/FEXCore/Source/Interface/IR/Passes/ConstProp.cpp#L358

This mask value is set but never used. Looks like it should be used in place of imm on line auto newArg = RemoveUselessMasking(IREmit, IROp->Args[i], imm); but needs to be investigated.

Sonicadvance1 avatar Jan 10 '22 06:01 Sonicadvance1

I'll take a look

skmp avatar Jan 11 '22 08:01 skmp

The code there is definitely buggy, however as RemoveUselessMasking has been disabled it doesn't actually optimize anything.

Related: #594

The only functional parts of the optimization are

  • BFE/SBFE (partially)
  • VFADD/VFSUB/VFMUL/VFDIV/FCMP
  • VMOV (partially)

skmp avatar Jan 13 '22 18:01 skmp

I think the entire optimization pass needs a rewrite, both to work out the kinks, and to be faster

skmp avatar Jan 13 '22 18:01 skmp