Announcement

Collapse
No announcement yet.

Glibc log2 Function Up To 69% Faster Thanks To FMA

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Glibc log2 Function Up To 69% Faster Thanks To FMA

    Phoronix: Glibc log2 Function Up To 69% Faster Thanks To FMA

    Intel engineer and open-source compiler expert H.J. Lu has landed a much faster log2() implementation within the GNU C Library (glibc) that makes use of FMA instructions with modern x86_64 CPUs...

    Phoronix, Linux Hardware Reviews, Linux hardware benchmarks, Linux server benchmarks, Linux benchmarking, Desktop Linux, Linux performance, Open Source graphics, Linux How To, Ubuntu benchmarks, Ubuntu hardware, Phoronix Test Suite

  • #2
    Nice.

    Comment


    • #3
      Hmmm... Need to test that patch on my good ol' FX.

      Comment


      • #4
        Hopefully, No one discover a vulnerability with FMA in the future.

        Comment


        • #5
          Hmm. Is there an actual implementation?
          From the diff I can only see compiling stuff with simd-instructions.
          Or is the actual code somewhere else?

          Comment


          • #6
            Nice ಡ⁠ ͜⁠ ⁠ʖ⁠ ⁠ಡ

            Comment


            • #7
              Originally posted by milkylainen View Post
              Hmm. Is there an actual implementation?
              From the diff I can only see compiling stuff with simd-instructions.
              Or is the actual code somewhere else?

              Look closer, Lenny.

              In e_log_2-fma.c (new file), it's defining __log2 to __log2_fma, then including e_log2.c

              Comment


              • #8
                Yeah, there's no hand-tuned implementation, it's just building the common one with -mfma.

                Comment


                • #9
                  Originally posted by intelfx View Post
                  Yeah, there's no hand-tuned implementation, it's just building the common one with -mfma.
                  The main thing is that it's using the compiler builtin __log2_fma(). Not compiling with -mfma would cause that builtin to be undefined, so it's just an enabler.

                  Also, the diff doesn't add -mfma to an existing file. Rather, it adds a new file and defines an override variable, in the Makefile, which causes it to be compiled with that flag.
                  Last edited by coder; 13 August 2023, 03:22 PM.

                  Comment


                  • #10
                    Originally posted by Setif View Post
                    Hopefully, No one discover a vulnerability with FMA in the future.
                    Most of the worrisome problems these days seem to be stemming from speculative execution rather than "actual" bugs in the instruction's implementation (like Intel FDIV used to be).

                    Comment

                    Working...
                    X