Skip to content

Commit

Permalink
Sparc: use the FLUSHW instruction when available
Browse files Browse the repository at this point in the history
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 <me@mortis.eu>
  • Loading branch information
muggenhor committed Jan 14, 2014
1 parent bae7251 commit 76711b1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions platform/switch_sparc_sun_gcc.h
Original file line number Diff line number Diff line change
Expand Up @@ -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));

Expand Down

0 comments on commit 76711b1

Please sign in to comment.