Hello my name is Daniel Hanrahan. Do you think my games should have optional calls to assembly functions for certain CPUs and GPUs in order to reach maximum possible performance and use parts/functions of the CPUs and GPUs that are not standard, but it’s use for them would for tasks that is not perfect for the standard parts of CPUs and GPUs if possible, for example: instead of using the standard parts/functions of the z80 for the randomization you use the refresh register instead. Let me be clear my games have good performance.

Link to my games: https://daniel-hanrahan-tools-and-games.github.io/

  • Azzu@lemmy.dbzer0.com
    link
    fedilink
    arrow-up
    1
    ·
    2 hours ago

    “have optional calls” is not really how this works.

    If you’re in an interpreted language, like python, java, c#, you don’t have to do anything, because they compile for the architecture they’re running on already, i.e. using whatever CPU features are available.

    If you have a compiled language, and your users compile themselves, then they are choosing which CPU features to use, so you don’t have to do anything. If you distribute pre-built binaries, then you simply have to compile it once for each architecture you want to support, and distribute the correct binary to each user (usually done with an installer).

    For graphics, your graphics API also already takes care of using system-specific instructions, and shaders are compiled by it before/while running also using system-specific instructions.

    So there’s really no “optional” path that you have to specifically put into your program, so nothing like

    Func work()
        If isArm then doArmStuff()
        Else if isZen4 then doZen4Stuff()
        ...
    End
    
  • richmondez@lemdro.id
    link
    fedilink
    English
    arrow-up
    1
    ·
    3 hours ago

    You need to profile your binaries to find out where they spend most of their cpu time and try and optimise those areas with more efficient code before you even consider micro optimisations like asm for specific cpus. Considerations like algorithm choice and cache efficiency of your data will all likely have a larger effect.