Optimize andes_clear_page() and andes_copy_page() with prefetch
[linux-2.6/linux-mips.git] / include / asm-sparc64 / visasm.h
blob175549c93e7334ae5a925b4f8df2ec9f79c523a3
1 /* $Id: visasm.h,v 1.4 1999/04/19 01:25:55 davem Exp $ */
2 #ifndef _SPARC64_VISASM_H
3 #define _SPARC64_VISASM_H
5 /* visasm.h: FPU saving macros for VIS routines
7 * Copyright (C) 1998 Jakub Jelinek (jj@ultra.linux.cz)
8 */
10 #include <asm/pstate.h>
11 #include <asm/ptrace.h>
13 #define AOFF_task_fpregs (((ASIZ_task) + (64 - 1)) & ~(64 - 1))
15 /* Clobbers %o5, %g1, %g2, %g3, %g7, %icc, %xcc */
17 #define VISEntry \
18 rd %fprs, %o5; \
19 andcc %o5, (FPRS_FEF|FPRS_DU), %g0; \
20 be,pt %icc, 297f; \
21 sethi %hi(297f), %g7; \
22 ba,pt %xcc, VISenter; \
23 or %g7, %lo(297f), %g7; \
24 297: wr %g0, FPRS_FEF, %fprs; \
26 #define VISExit \
27 wr %g0, 0, %fprs;
29 /* Clobbers %o5, %g1, %g2, %g3, %g7, %icc, %xcc.
30 * Must preserve %o5 between VISEntryHalf and VISExitHalf */
32 #define VISEntryHalf \
33 rd %fprs, %o5; \
34 andcc %o5, FPRS_FEF, %g0; \
35 be,pt %icc, 297f; \
36 sethi %hi(298f), %g7; \
37 ba,pt %xcc, VISenterhalf; \
38 or %g7, %lo(298f), %g7; \
39 clr %o5; \
40 297: wr %o5, FPRS_FEF, %fprs; \
41 298:
43 #define VISExitHalf \
44 wr %o5, 0, %fprs;
46 #ifndef __ASSEMBLY__
47 extern __inline__ void save_and_clear_fpu(void) {
48 __asm__ __volatile__ ("
49 rd %%fprs, %%o5
50 andcc %%o5, %0, %%g0
51 be,pt %%icc, 299f
52 sethi %%hi(298f), %%g7
53 ba VISenter ! Note. This cannot be bp, as it may be too far from VISenter.
54 or %%g7, %%lo(298f), %%g7
55 298: wr %%g0, 0, %%fprs
56 299:
57 " : : "i" (FPRS_FEF|FPRS_DU) :
58 "o5", "g1", "g2", "g3", "g7", "cc");
60 #endif
62 #endif /* _SPARC64_ASI_H */