From 76711b1276698c0af2bc62fbb5a8c2d762696fda Mon Sep 17 00:00:00 2001 From: Giel van Schijndel Date: Thu, 12 Dec 2013 18:23:01 +0100 Subject: [PATCH] Sparc: use the FLUSHW instruction when available This instruction tends to have better performance than ta ST_FLUSHWINDOWS It isn't available on all systems though, hence the conditional. Signed-off-by: Giel van Schijndel --- platform/switch_sparc_sun_gcc.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/platform/switch_sparc_sun_gcc.h b/platform/switch_sparc_sun_gcc.h index 5c672056..113de52a 100644 --- a/platform/switch_sparc_sun_gcc.h +++ b/platform/switch_sparc_sun_gcc.h @@ -55,7 +55,11 @@ slp_switch(void) * * Then put the stack pointer into stackref. */ __asm__ volatile ( +#ifdef __sparcv9 + "flushw\n\t" +#else "ta %1\n\t" +#endif "mov %%sp, %0" : "=r" (stackref) : "i" (ST_FLUSH_WINDOWS));