x86/asm: Use "m" operand constraint in WRUSSQ asm template
authorUros Bizjak <ubizjak@gmail.com>
Tue, 19 Mar 2024 17:16:46 +0000 (18:16 +0100)
committerIngo Molnar <mingo@kernel.org>
Wed, 20 Mar 2024 11:04:38 +0000 (12:04 +0100)
commit648337147d3550c1ca3d1b500e66dbda12e2d836
tree3122e80d008ebea46dbe1db2c9dafd2ab58e5f07
parentd689863c1a60b9936b47a34fa5c3330de374f4fc
x86/asm: Use "m" operand constraint in WRUSSQ asm template

The WRUSSQ instruction uses a memory operand, so use "m"
operand constraint instead of forcing usage of pointer
register using "r" constraint. The generated assembly
code improves from:

   6ece3: 48 8d 43 f8           lea    -0x8(%rbx),%rax
   ...
   6eceb: 66 48 0f 38 f5 18     wrussq %rbx,(%rax)

to:

   6ecea: 66 48 0f 38 f5 43 f8  wrussq %rax,-0x8(%rbx)

Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Ard Biesheuvel <ardb@kernel.org>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Link: https://lore.kernel.org/r/20240319171714.76342-1-ubizjak@gmail.com
arch/x86/include/asm/special_insns.h