Skip to contentSkip to conversation

Optimize IA64's get_current()

PATCH New Samuel Thibault 1 participant 1 message Jan 17, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Optimize IA64's get_current()

Let gcc access r13 itself, leading to better code

extras/mini-os/include/ia64/arch_sched.h +1 -2
diff -r a66bdc82d8fa extras/mini-os/include/ia64/arch_sched.h
@@ -82,8 +82,7 @@ void arch_switch_threads(struct thread* 
 
 static inline struct thread* get_current(void)
 {
-	struct thread *current;
-	__asm ("mov %0=r13" : "=r" (current));
+	register struct thread *current asm("r13");
 	return current;
 }