Announcement

Collapse
No announcement yet.

More Of The Linux Kernel's x86 Assembly Code Gets Rewritten In C

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

  • More Of The Linux Kernel's x86 Assembly Code Gets Rewritten In C

    Phoronix: More Of The Linux Kernel's x86 Assembly Code Gets Rewritten In C

    More of the Linux kernel's complicated and poorly maintained x86 Assembly code continues to be rewritten in modern and clean C...

    http://www.phoronix.com/scan.php?pag...ASM-To-C-Linux

  • #2
    Really appreciate folks who do the dirty stuff like this.

    Comment


    • #3
      Isn''t this going to affect performance in a bad way since the compiler might translate C code into machine code worse than from Assembly?

      Comment


      • #4
        a compiler writes assembly, not machine code. an assembler writes machine code. depending on the quality of the code and the quality of the compiler, well-crafted C could compile to more efficient code than poorly-crafted assembly. of course, the opposite is also possible, and everything in between.

        Comment


        • #5
          Originally posted by Danny3 View Post
          Isn''t this going to affect performance in a bad way since the compiler might translate C code into machine code worse than from Assembly?
          Minor speed loss is a totally acceptable cost for getting rid of unmaintainable Assembly spaghetti code

          Comment


          • #6
            Am I the only once somewhat concerned? It's one thing to say, "this isn't needed" or "that was because..."... but when you pretty much say, "it's not clear what it's supposed to do"... so I removed it... you would think somebody could chime in with "the reasoning" behind it.... yes??

            Comment


            • #7
              Originally posted by cjcox View Post
              Am I the only once somewhat concerned? It's one thing to say, "this isn't needed" or "that was because..."... but when you pretty much say, "it's not clear what it's supposed to do"... so I removed it... you would think somebody could chime in with "the reasoning" behind it.... yes??

              "Clear" in this context means something like "obvious", as in, when someone wants to make a modification, it takes unreasonable amounts of work to understand the meaning of the code.

              Comment


              • #8
                Originally posted by quaz0r View Post
                a compiler writes assembly, not machine code. an assembler writes machine code.
                A compiler is a program that takes in source code and outputs another language. This is typically object (machine) code, but not always: Oracle's java compiler (javac) takes in Java code and outputs java bytecode while emscripten takes in LLVM bytecode and outputs Javascript. An assembler is a special type of compiler which compiles source code written in a machine's specific assembly language in to object (machine) code.

                Many older compilers did use to output assembly language source code that would get fed to an assembler, but nearly all native compilers nowadays generate object code directly.

                Comment


                • #9
                  Honestly, if the code is as messy as they say it is, I don't think there will be any performance loss by coding in C. If the compiler works properly, we might even see performance gains.

                  Either way - cleaning up code is always appreciated.

                  Comment


                  • #10
                    Originally posted by cjcox View Post
                    Am I the only once somewhat concerned? It's one thing to say, "this isn't needed" or "that was because..."... but when you pretty much say, "it's not clear what it's supposed to do"... so I removed it... you would think somebody could chime in with "the reasoning" behind it.... yes??
                    As long as the new C code handles all of the expectations and requirements, then who cares what [else] the old assembly code did, or how it did it?

                    Regression tests should reveal if anything is amiss. And if they don't, then the regression tests are amiss.

                    Comment

                    Working...
                    X