summaryrefslogtreecommitdiffstats
path: root/sys/amd64/include/fpu.h
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>2001-07-12 06:32:51 +0000
committerpeter <peter@FreeBSD.org>2001-07-12 06:32:51 +0000
commite00129231d89ad2ab6ec8862931dd864ff079d0c (patch)
treeacb374c639798d8213f972fae7e8609dec013b5f /sys/amd64/include/fpu.h
parentb5164c6585fabc3c848ff92ada3f6ffb64a9e8f2 (diff)
downloadFreeBSD-src-e00129231d89ad2ab6ec8862931dd864ff079d0c.zip
FreeBSD-src-e00129231d89ad2ab6ec8862931dd864ff079d0c.tar.gz
Activate SSE/SIMD. This is the extra context switching support that
we are required to do if we let user processes use the extra 128 bit registers etc. This is the base part of the diff I got from: http://www.issei.org/issei/FreeBSD/sse.html I believe this is by: Mr. SUZUKI Issei <issei@issei.org> SMP support apparently by: Takekazu KATO <kato@chino.it.okayama-u.ac.jp> Test code by: NAKAMURA Kazushi <kaz@kobe1995.net>, see http://kobe1995.net/~kaz/FreeBSD/SSE.en.html I have fixed a couple of style(9) deviations. I have some followup commits to fix a couple of non-style things.
Diffstat (limited to 'sys/amd64/include/fpu.h')
-rw-r--r--sys/amd64/include/fpu.h38
1 files changed, 37 insertions, 1 deletions
diff --git a/sys/amd64/include/fpu.h b/sys/amd64/include/fpu.h
index 11f0478..1474f2f 100644
--- a/sys/amd64/include/fpu.h
+++ b/sys/amd64/include/fpu.h
@@ -85,6 +85,42 @@ struct save87 {
u_char sv_pad[64]; /* padding; used by emulators */
};
+struct envxmm {
+ u_int16_t en_cw; /* control word (16bits) */
+ u_int16_t en_sw; /* status word (16bits) */
+ u_int16_t en_tw; /* tag word (16bits) */
+ u_int16_t en_opcode; /* opcode last executed (11 bits ) */
+ u_int32_t en_fip; /* floating point instruction pointer */
+ u_int16_t en_fcs; /* floating code segment selector */
+ u_int16_t en_pad0; /* padding */
+ u_int32_t en_foo; /* floating operand offset */
+ u_int16_t en_fos; /* floating operand segment selector */
+ u_int16_t en_pad1; /* padding */
+ u_int32_t en_mxcsr; /* SSE sontorol/status register */
+ u_int32_t en_pad2; /* padding */
+};
+
+/* Contents of each SSE extended accumulator */
+struct xmmacc {
+ u_char xmm_bytes[16];
+};
+
+struct savexmm {
+ struct envxmm sv_env;
+ struct {
+ struct fpacc87 fp_acc;
+ u_char fp_pad[6]; /* padding */
+ } sv_fp[8];
+ struct xmmacc sv_xmm[8];
+ u_long sv_ex_sw; /* status word for last exception */
+ u_char sv_pad[220];
+} __attribute__((aligned(16)));
+
+union savefpu {
+ struct save87 sv_87;
+ struct savexmm sv_xmm;
+};
+
/*
* The hardware default control word for i387's and later coprocessors is
* 0x37F, giving:
@@ -108,7 +144,7 @@ struct save87 {
int npxdna __P((void));
void npxexit __P((struct proc *p));
void npxinit __P((int control));
-void npxsave __P((struct save87 *addr));
+void npxsave __P((union savefpu *addr));
int npxtrap __P((void));
#endif
OpenPOWER on IntegriCloud