simde icon indicating copy to clipboard operation
simde copied to clipboard

Extended MMX (Cyrix EMMI) functions

Open Torinde opened this issue 3 months ago • 0 comments

https://en.wikipedia.org/wiki/List_of_discontinued_x86_instructions#Cyrix_EMMI_instructions

Slightly relevant for DOS/Win9x/WinXP emulators as there is not a lot of software that uses those.

There is a CPU flag in Linux for those: cxmmx Cyrix MMX extensions

Cyrix Extension to the Multimedia Instruction Set, Application Note 108 (some further docs and software are linked here)

  • [ ] PAVEB mm,mm/m64 0F 50 /r Packed average bytes: arg1 <- (arg1+arg2) >> 1
  • [ ] PADDSIW mm,mm/m64 0F 51 /r Packed add signed words with saturation, using implied destination: imp <- saturate_s16(arg1+arg2)
  • [ ] PMAGW mm,mm/m64 0F 52 /r Packed signed word magnitude maximum value: if (abs(arg2) > abs(arg1)) then arg1 <- arg2
  • [ ] PDISTIB mm,m64 0F 54 /r Packed unsigned byte distance and accumulate to implied destination, with saturation: imp <- saturate_u8(imp + (abs(arg1-arg2)))
  • [ ] PSUBSIW mm,mm/m64 0F 55 /r Packed subtract signed words with saturation, using implied destination: imp <- saturate_s16(arg1-arg2)
  • [ ] PMULHRWC (PMULHRW) mm,mm/m64 0F 59 /r Packed signed word multiply high with rounding: arg1 <- (arg1*arg2+0x4000)>>15
  • [ ] PMULHRIW mm,mm/m64 0F 5D /r Packed signed word multiply high with rounding and implied destination: imp <- (arg1*arg2+0x4000)>>15
  • [ ] PMACHRIW mm,m64[b] 0F 5E /r Packed signed word multiply high with rounding and accumulation to implied destination: imp <- imp + ((arg1*arg2+0x4000)>>15)
  • [ ] PMVZB mm,m64 0F 58 /r if (imp == 0) then arg1 <- arg2 Packed conditional load from memory to MMX register. Condition is evaluated on a per-byte-lane basis, by comparing byte lanes in the implied source to zero (with signed compare) − if the comparison passes, then the corresponding destination lane is loaded from memory, otherwise it keeps its original value.
  • [ ] PMVNZB mm,m64 0F 5A /r if (imp != 0) then arg1 <- arg2
  • [ ] PMVLZB mm,m64 0F 5B /r if (imp < 0) then arg1 <- arg2
  • [ ] PMVGEZB mm,m64 0F 5C /r if (imp >= 0) then arg1 <- arg2

Opcodes overlap with SSE and other subsequent instructions.

Torinde avatar Mar 26 '24 16:03 Torinde