Add linux math emulator to the FAQ system
authorGary Clark II <gclarkii@radon.gbdata.com>
Mon, 18 Apr 1994 20:10:58 +0000 (20:10 +0000)
committerGary Clark II <gclarkii@radon.gbdata.com>
Mon, 18 Apr 1994 20:10:58 +0000 (20:10 +0000)
contrib/FAQ/programs/fp-emu/README [new file with mode: 0644]
contrib/FAQ/programs/fp-emu/README.first [new file with mode: 0644]
contrib/FAQ/programs/fp-emu/emu_install [new file with mode: 0644]
contrib/FAQ/programs/fp-emu/files.i386.add [new file with mode: 0644]
contrib/FAQ/programs/fp-emu/fpem.tar [new file with mode: 0644]
contrib/FAQ/programs/fp-emu/npx_h.diff [new file with mode: 0644]

diff --git a/contrib/FAQ/programs/fp-emu/README b/contrib/FAQ/programs/fp-emu/README
new file mode 100644 (file)
index 0000000..ff9ec20
--- /dev/null
@@ -0,0 +1,40 @@
+This is my first try to integrate linux's 387 emulator into NetBSD.
+
+Files: README - this file
+       npx_h.dif - a diff to /sys/arch/i386/include/npx.h
+       file.i386.add - add this to files.i386
+       fpem.tar - untar from /sys/arch/i386/i386, it will create a dir
+                  named fpemul.
+
+Changes:
+       in npx.h the padding in the save87 struct had to be increased to 
+       the size of the i387_union in the emulator. This diff
+       may be made to be #ifdef MATH_EMULATE as a space saver.
+       Also instead of the magic number it would be nicer to calculate
+       it with some sizeof's. 
+       I removed that ifndef dontdef, that was crazy!
+
+       For changes in the emulator itself se the Changelog file
+       there. That some 40 files that the emulator is, may be cat-ed
+       together if this bothers someone, and if someone is willing to do.
+
+       When adding the files to files.i386 don't forget to uncomment
+       the old emulator - math_emulate.c -.
+
+testing:
+       Since i don't have (yet) that deep knowledge in the NetBSD 
+       internals, it is possible thet something really stupid has been
+       done. Nevertheless, my system looks ok. (it's a 2 week old
+       current) i have ran some simple tests, they did work. Someone
+       should try paranoia.
+       Speed increases from 1.5 up to 8 times have been measured.
+
+       It's worth noting that i did *not* look inside the actulal math
+       routines, nor i know how they work, but i think those have been 
+       well tested.
+
+
+       Hope this helps.
+
+               Szabolcs Szigeti (pink@fsz.bme.hu)
+
diff --git a/contrib/FAQ/programs/fp-emu/README.first b/contrib/FAQ/programs/fp-emu/README.first
new file mode 100644 (file)
index 0000000..fe5af06
--- /dev/null
@@ -0,0 +1,11 @@
+This is the New Linux math emulator as ported to NetBSD.
+It runs fine and allows you to run programs such as ghostscript and other
+floating point intensive programs.  Read the file README for more information
+on this packages history.
+
+To install run the program emu_install.  This program assumes that you
+have your sources in the standard place. (/sys/*)
+
+Gary Clark II
+gclarkii@freefall.cdrom.com
+FreeBSD-FAQ maintainer
diff --git a/contrib/FAQ/programs/fp-emu/emu_install b/contrib/FAQ/programs/fp-emu/emu_install
new file mode 100644 (file)
index 0000000..ca3b4ad
--- /dev/null
@@ -0,0 +1,13 @@
+#!/bin/sh 
+
+
+patch -d /sys/i386/include < npx_h.diff
+wait
+cat files.i386.add >> /sys/i386/conf/files.i386
+wait
+cp fpem.tar /sys/i386/i386
+cd /sys/i386/i386
+tar xvf fpem.tar
+rm fpem.tar
+wait
+
diff --git a/contrib/FAQ/programs/fp-emu/files.i386.add b/contrib/FAQ/programs/fp-emu/files.i386.add
new file mode 100644 (file)
index 0000000..626ea5e
--- /dev/null
@@ -0,0 +1,32 @@
+#i386/i386/math_emulate.c      optional math_emulate
+i386/i386/fpemul/div_small.s   optional math_emulate
+i386/i386/fpemul/errors.c      optional math_emulate
+i386/i386/fpemul/fpu_arith.c   optional math_emulate
+i386/i386/fpemul/fpu_aux.c     optional math_emulate
+i386/i386/fpemul/fpu_entry.c   optional math_emulate
+i386/i386/fpemul/fpu_etc.c     optional math_emulate
+i386/i386/fpemul/fpu_trig.c    optional math_emulate
+i386/i386/fpemul/get_address.c optional math_emulate
+i386/i386/fpemul/load_store.c  optional math_emulate
+i386/i386/fpemul/poly_2xm1.c   optional math_emulate
+i386/i386/fpemul/poly_atan.c   optional math_emulate
+i386/i386/fpemul/poly_div.s    optional math_emulate
+i386/i386/fpemul/poly_l2.c     optional math_emulate
+i386/i386/fpemul/poly_mul64.s  optional math_emulate
+i386/i386/fpemul/poly_sin.c    optional math_emulate
+i386/i386/fpemul/poly_tan.c    optional math_emulate
+i386/i386/fpemul/polynomial.s  optional math_emulate
+i386/i386/fpemul/reg_add_sub.c optional math_emulate
+i386/i386/fpemul/reg_compare.c optional math_emulate
+i386/i386/fpemul/reg_constant.c        optional math_emulate
+i386/i386/fpemul/reg_div.s     optional math_emulate
+i386/i386/fpemul/reg_ld_str.c  optional math_emulate
+i386/i386/fpemul/reg_mul.c     optional math_emulate
+i386/i386/fpemul/reg_norm.s    optional math_emulate
+i386/i386/fpemul/reg_round.s   optional math_emulate
+i386/i386/fpemul/reg_u_add.s   optional math_emulate
+i386/i386/fpemul/reg_u_div.s   optional math_emulate
+i386/i386/fpemul/reg_u_mul.s   optional math_emulate
+i386/i386/fpemul/reg_u_sub.s   optional math_emulate
+i386/i386/fpemul/wm_shrx.s     optional math_emulate
+i386/i386/fpemul/wm_sqrt.s     optional math_emulate
diff --git a/contrib/FAQ/programs/fp-emu/fpem.tar b/contrib/FAQ/programs/fp-emu/fpem.tar
new file mode 100644 (file)
index 0000000..c8d8481
Binary files /dev/null and b/contrib/FAQ/programs/fp-emu/fpem.tar differ
diff --git a/contrib/FAQ/programs/fp-emu/npx_h.diff b/contrib/FAQ/programs/fp-emu/npx_h.diff
new file mode 100644 (file)
index 0000000..17863d6
--- /dev/null
@@ -0,0 +1,25 @@
+*** 1.1        1993/10/23 09:59:12
+--- npx.h      1993/10/24 17:37:00
+***************
+*** 73,83 ****
+  struct       save87 {
+       struct  env87 sv_env;           /* floating point control/status */
+       struct  fpacc87 sv_ac[8];       /* accumulator contents, 0-7 */
+- #ifndef dontdef
+       u_long  sv_ex_sw;       /* status word for last exception (was pad) */
+       u_long  sv_ex_tw;       /* tag word for last exception (was pad) */
+!      u_char  sv_pad[8 * 2 - 2 * 4];  /* bogus historical padding */
+! #endif
+  };
+  
+  /* Cyrix EMC memory - mapped coprocessor context switch information */
+--- 73,81 ----
+  struct       save87 {
+       struct  env87 sv_env;           /* floating point control/status */
+       struct  fpacc87 sv_ac[8];       /* accumulator contents, 0-7 */
+       u_long  sv_ex_sw;       /* status word for last exception (was pad) */
+       u_long  sv_ex_tw;       /* tag word for last exception (was pad) */
+!      u_char  sv_pad[60];     /* bogus historical padding */
+  };
+  
+  /* Cyrix EMC memory - mapped coprocessor context switch information */