Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extended MMX (Cyrix EMMI) functions #1162

Open
12 tasks
Torinde opened this issue Mar 26, 2024 · 0 comments
Open
12 tasks

Extended MMX (Cyrix EMMI) functions #1162

Torinde opened this issue Mar 26, 2024 · 0 comments
Labels
instruction-set-support Implementing new SIMD ISA extensions portably

Comments

@Torinde
Copy link
Contributor

Torinde commented Mar 26, 2024

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.

@mr-c mr-c added the instruction-set-support Implementing new SIMD ISA extensions portably label Mar 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
instruction-set-support Implementing new SIMD ISA extensions portably
Projects
None yet
Development

No branches or pull requests

2 participants