Announcement

Collapse
No announcement yet.

GCC 10 Lands Support For Emulating MMX With SSE Instructions

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
    Veto
    Senior Member

  • Veto
    replied
    Originally posted by Tomin View Post
    Can't Linux emulate MMX if processor doesn't support it? At least in the early days Linux could emulate x87 instructions if user didn't have an FPU. If that can be implemented for MMX too, then in theory it really could be dropped. I hope that no performance critical application is using these instructions anymore. Really old software should run fast enough with emulation. Fast enough meaning faster than with the hardware it was designed for. Or at least that's what I would expect but correct me if you know better.
    Yes, the MMX instructions could conceivably be trapped and emulated by the OS in a future processor. However trapping an instruction and running an interrupt is very inefficient compared to emulating it "inline" by the compiler, so the various techniques will likely supplement each other:
    • Trapping or microcode emulation for closed source legacy applications
    • Compiler emulation for applications where recompiling is feasible, but rewriting code is not.
    • Code rewrite for "live" code bases.
    However because trapping is so expensive, it will likely be many years, before Intel and AMD will dare to remove the instructions from the microcode.
    Veto
    Senior Member
    Last edited by Veto; 17 May 2019, 08:54 PM.

    Leave a comment:

  • carewolf
    Senior Member

  • carewolf
    replied
    Originally posted by _Alex_ View Post
    The 8 byte vectorizer gain in the article, I don't understand. What does this even mean? The EMMS instruction that isn't there? Possible context switches that don't need to save MMX state?
    MMX isn't the same speed as SSE. It is much slower instruction for instruction (2x slower in best if cases) So doing 8 byte vectors with SSE instead of MMX will give a significant performance boost. And even better if the code is mixing 8 byte vectors with 16 byte vectors which code originally written for NEON might.

    Leave a comment:

  • xorbe
    Senior Member

  • xorbe
    replied
    Originally posted by wizard69 View Post
    Why?

    would it not make more sense to modernize code that is still using MMX?
    This was my immediate thought too. MMX is super old. Who is asking for this? (A genuine question out of curiosity.)

    Leave a comment:

  • Tomin
    Senior Member

  • Tomin
    replied
    Can't Linux emulate MMX if processor doesn't support it? At least in the early days Linux could emulate x87 instructions if user didn't have an FPU. If that can be implemented for MMX too, then in theory it really could be dropped. I hope that no performance critical application is using these instructions anymore. Really old software should run fast enough with emulation. Fast enough meaning faster than with the hardware it was designed for. Or at least that's what I would expect but correct me if you know better.

    Leave a comment:

  • _Alex_
    Phoronix Member

  • _Alex_
    replied
    There are some CPUs like Pentium-M 32bit (~2004) where MMX is much faster than SSE... for the rest it should be the same performance, with the added issue that SSE opcodes are bigger in size than MMX which then affects the caches and by extension might affect performance.

    The 8 byte vectorizer gain in the article, I don't understand. What does this even mean? The EMMS instruction that isn't there? Possible context switches that don't need to save MMX state?

    Leave a comment:

  • starshipeleven
    Premium Supporter

  • starshipeleven
    replied
    Originally posted by Weasel View Post
    This isn't going to help applications that are already built for MMX and not open source. So dropping it would be retarded.
    I would hazard a guess:
    having the compiler do this conversion is very likely going to yield faster performance than relying on the "software MMX" (aka provided by microcode) that will be the "MMX" support in newer CPUs that don't really support MMX in hardware anymore.

    Stuff that can't be recompiled will get fucked, but at least it will still run so that's not that bad I guess.

    Leave a comment:

  • starshipeleven
    Premium Supporter

  • starshipeleven
    replied
    Originally posted by wizard69 View Post
    Why?

    would it not make more sense to modernize code that is still using MMX?
    Are you paying for the refactoring?

    Because recompiling with different flags is pretty cheap.

    Leave a comment:

  • Weasel
    Senior Member

  • Weasel
    replied
    This isn't going to help applications that are already built for MMX and not open source. So dropping it would be retarded.

    Leave a comment:

  • davidbepo
    Senior Member

  • davidbepo
    replied
    this should first be seen on ocean cove cores, i dunno when they are coming tough

    Leave a comment:

  • wizard69
    Senior Member

  • wizard69
    replied
    Why?

    would it not make more sense to modernize code that is still using MMX?

    Leave a comment:

Working...
X