Thread (18 messages) 18 messages, 5 authors, 2026-03-17

Re: [RFC PATCH v2 2/7] arm64/runtime-const: Introduce runtime_const_mask_32()

From: K Prateek Nayak <kprateek.nayak@amd.com>
Date: 2026-03-16 17:11:31
Also in: linux-arch, linux-riscv, linux-s390, lkml

Hello David,

On 3/16/2026 5:20 PM, David Laight wrote:
quoted
Introduce runtime_const_mask_32 to further optimize the mask operation
in the futex hash computation hot path. GCC generates a:

  movz  w1, #lo16, lsl #0     // w1 = bits [15:0]
  movk  w1, #hi16, lsl #16    // w1 = full 32-bit value
  and   w0, w0, w1          // w0 = w0 & w1
I don't thing the '&' needs to be part of the asm block.
Just generate the 32bit constant and do the mask in C.
That will let the compiler schedule the instructions.
It also make the code patching more generally useful.
Ack! That makes sense. I'll update it in the next version.
Thank you for taking a look at the series.

-- 
Thanks and Regards,
Prateek

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help