Theoretically, would it be possible for a multi core CPU to emulate a single core CPU?

Discussion in 'Computer Programming, Emulation, and Game Modding' started by GoldenSun3DS, Apr 16, 2015.

  1. GoldenSun3DS
    OP

    GoldenSun3DS GBAtemp Regular

    Member
    264
    34
    Apr 27, 2013
    United States
    On my phone (Galaxy S6), Limbo PC emulator can use multiple threads to emulate old PCs.

    Would it be possible to apply that same strategy on a desktop with high multi thread performance but low single thread performance for low thread tasks?

    Like have an octave core and emulate a dual Intel with multithreading, for example.
     
  2. sarkwalvein

    sarkwalvein Professional asshole at GBATemp

    Member
    GBAtemp Patron
    sarkwalvein is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    4,669
    4,644
    Jun 29, 2007
    Germany
    Niedersachsen
    No. If a given program was not made to take advantage of multiple cores or multi-threading it would be from difficult to impossible to run it's code in parallel and achieve any parallel speed up.
    The only efficient parallelization that can be done with that kind of code if hardware based instruction level parallelization, optimized via out of order execution, and it is already done by your CPU.
     
  3. PityOnU

    PityOnU GBAtemp Advanced Fan

    Member
    907
    327
    Jul 5, 2012
    United States
  4. GoldenSun3DS
    OP

    GoldenSun3DS GBAtemp Regular

    Member
    264
    34
    Apr 27, 2013
    United States
    I'm talking about emulation.

    I'm pretty sure the SNES was a single core processor, and the Higan emulator can take advantage of more than one core when emulating it.

    Bit of an extreme example, but you get my point.
     
  5. sarkwalvein

    sarkwalvein Professional asshole at GBATemp

    Member
    GBAtemp Patron
    sarkwalvein is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    4,669
    4,644
    Jun 29, 2007
    Germany
    Niedersachsen
    You can't achieve speedup.
    Of course emulation will result in way slower execution.
    Serial code from the emulated system is executed serially, not in parallel.
    Multiple cores may be used in the recompiling stage, to emulate additional chips, etc.
    The serial code from the SNES main cpu is executed serially.
    I don't know if you understand that doing this you will lose performance.

    I am sleeping and on my phone, writing on this shit is a PITA.
    Please read my previous post, take a look at Amdahl's law, think that in a different system you have many chips and components to emulate and those could be emulated on different threads, that would require synchronization and eat performance, meditate and write again after thinking and thinking.