[lkml]   [2007]   [Feb]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: patch to use more symbolic constants in asm
On Wednesday 21 February 2007 12:10, Arjan van de Ven wrote:
> From: Arjan van de Ven <>
> Subject: Use symbolic constants in inline assembly
> This patch replaces several of the %0/%1 uses in x86-64 inline assembly
> with symbolic names (this is a new gcc 3.x feature, but that's ok now).
> This tends to, imo, make the inline assembly a lot more readable, and
> for sure it's less error prone in terms of finding which %<number>
> corresponds with which variable.

At least for two arguments i don't really see the value, but ok.

> objdump -d of the vmlinux before and after the patch is the same; also
> boot tested.

You should do i386 too then; one reason I didn't touch bitops
for example was to keep the code more similar.

> static inline void set_cr4(unsigned long cr4)
> {
> - asm volatile("mov %0,%%cr4" :: "r" (cr4) : "memory");
> + asm volatile("mov %[cr4],%%cr4" :: [cr4] "r" (cr4) : "memory");

I'm not sure that's really an improvement for example.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2007-02-21 12:59    [W:0.034 / U:0.264 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site