summaryrefslogtreecommitdiffstats
path: root/include/asm-sparc64/fpumacro.h
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>1997-04-29 21:13:14 +0000
committer <ralf@linux-mips.org>1997-04-29 21:13:14 +0000
commit19c9bba94152148523ba0f7ef7cffe3d45656b11 (patch)
tree40b1cb534496a7f1ca0f5c314a523c69f1fee464 /include/asm-sparc64/fpumacro.h
parent7206675c40394c78a90e74812bbdbf8cf3cca1be (diff)
Import of Linux/MIPS 2.1.36
Diffstat (limited to 'include/asm-sparc64/fpumacro.h')
-rw-r--r--include/asm-sparc64/fpumacro.h53
1 files changed, 53 insertions, 0 deletions
diff --git a/include/asm-sparc64/fpumacro.h b/include/asm-sparc64/fpumacro.h
new file mode 100644
index 000000000..9928a38c2
--- /dev/null
+++ b/include/asm-sparc64/fpumacro.h
@@ -0,0 +1,53 @@
+/* fpumacro.h: FPU related macros.
+ *
+ * Copyright (C) 1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
+ */
+
+#ifndef _SPARC64_FPUMACRO_H
+#define _SPARC64_FPUMACRO_H
+
+extern __inline__ void fpsave32(unsigned long *fpregs, unsigned long *fsr)
+{
+ __asm__ __volatile__ ("
+ wr %%g0, %2, %%asi
+ stx %%fsr, [%1]
+ stda %%f0, [%0] %%asi
+ stda %%f16, [%0 + 64] %%asi
+ " : : "r" (fpregs), "r" (fsr), "i" (ASI_BLK_P));
+}
+
+extern __inline__ void fpload32(unsigned long *fpregs, unsigned long *fsr)
+{
+ __asm__ __volatile__ ("
+ wr %%g0, %2, %%asi
+ ldda [%0] %%asi, %%f0
+ ldda [%0 + 64] %%asi, %%f16
+ ldx [%1], %%fsr
+ " : : "r" (fpregs), "r" (fsr), "i" (ASI_BLK_P));
+}
+
+extern __inline__ void fpsave(unsigned long *fpregs, unsigned long *fsr)
+{
+ __asm__ __volatile__ ("
+ wr %%g0, %2, %%asi
+ stx %%fsr, [%1]
+ stda %%f0, [%0] %%asi
+ stda %%f16, [%0 + 64] %%asi
+ stda %%f32, [%0 + 128] %%asi
+ stda %%f48, [%0 + 192] %%asi
+ " : : "r" (fpregs), "r" (fsr), "i" (ASI_BLK_P));
+}
+
+extern __inline__ void fpload(unsigned long *fpregs, unsigned long *fsr)
+{
+ __asm__ __volatile__ ("
+ wr %%g0, %2, %%asi
+ ldda [%0] %%asi, %%f0
+ ldda [%0 + 64] %%asi, %%f16
+ ldda [%0 + 128] %%asi, %%f32
+ ldda [%0 + 192] %%asi, %%f48
+ ldx [%1], %%fsr
+ " : : "r" (fpregs), "r" (fsr), "i" (ASI_BLK_P));
+}
+
+#endif /* !(_SPARC64_FPUMACRO_H) */