lkml.org 
[lkml]   [2021]   [Jan]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v17 08/26] x86/mm: Introduce _PAGE_COW
From
Date
On 1/21/2021 12:26 PM, Dave Hansen wrote:
>> Usually, the compiler is better at making code efficient than humans. I
>> find that coding it in the most human-readable way is best unless I
>> *know* the compiler is unable to generate god code.
>
> "good code", even.
>
> I really want a "god code" compiler, though. :)
>
With my version of GCC, the shifting implementation creates five
instructions, all operate on registers only. The other implementation
also creates five instructions, but introduces one jump and one memory
access. But, you are right, being readable is also important. Maybe we
can tweak it a little or create something similar to those in bitops.

--
Yu-cheng

\
 
 \ /
  Last update: 2021-01-21 21:47    [W:0.052 / U:0.208 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site