• KubeRoot
    link
    fedilink
    English
    arrow-up
    2
    ·
    5 hours ago

    I might be wrong, but doesn’t SSE require you to explicitly use it in C/C++? Laying out your data as arrays and specifically calling the SIMD operations on them?

    • dejected_warp_core@lemmy.world
      link
      fedilink
      English
      arrow-up
      1
      ·
      3 hours ago

      Honestly, I’m not 100% sure. I would bet that a modern compiler would just “do the right thing” but I’ve never written code in such a high performance fashion before.

    • acockworkorange@mander.xyz
      link
      fedilink
      English
      arrow-up
      2
      ·
      4 hours ago

      There’s absolutely nothing you can do in C that you can’t also do in assembly. Because assembly is just the bunch of bits that the compiler generates.

      That said, you’d have to be insane to write a game featuring SIMD instructions these days in assembly.

      • Buddahriffic@lemmy.world
        link
        fedilink
        English
        arrow-up
        1
        ·
        49 minutes ago

        I think they meant the other way around, that if you wanted to use it in C/C++, you’d have to either use assembly or some specific SSE construct otherwise the compiler wouldn’t bother.

        That probably was the case at one point, but I’d be surprised if it’s still the case. Though maybe that’s part of the reason why the Intel compiler can generate faster code. But I suspect it’s more of a case of better optimization by people who have a better understanding of how it works under the hood, and maybe better utilization of newer instruction set extensions.

        SSE has been around for a long time and is present in most (all?) x86 chips these days and I’d be very surprised if gcc and other popular compilers don’t use it effectively today. Some of the other extensions might be different though.