Commit Graph

1074 Commits

Author SHA1 Message Date
isaki
388a353677 R := X even if L < 0 in Step2, according to algorithm of the comment.
This solves many cases of |X| < |Y|.
2013-05-05 13:25:20 +00:00
isaki
283cf893ef Rename modrem -> is_mod for a readability. 2013-05-05 13:17:15 +00:00
isaki
77f57d5580 M68010 -> __mc68010__, pointed out by tsutsui@ 2013-04-21 02:50:48 +00:00
isaki
2cb1fdf4a5 Rewrite around BFFFO inline asm.
o Prepare C version of BFFFO (from XM6i).
  It is helpful in running FPE on other platforms (for example, for a
  test).  It is also helpful in porting to non-m68k 3rd party :)
o A BFFFO is supported on 68020 or later (though I'm not sure whether
  sun2/68010 uses this FPE correctly or not).
2013-04-20 09:32:28 +00:00
isaki
70153dd489 Support sinh(-0.0) and tanh(-0.0). 2013-04-20 07:33:05 +00:00
isaki
0cee51ef54 Support sin(-0.0). 2013-04-20 07:32:45 +00:00
isaki
adcd4b71b5 Clean up some useless codes. 2013-04-20 05:27:05 +00:00
isaki
1db93fc92a Support tan(-0.0). 2013-04-20 05:09:41 +00:00
isaki
956d42b4aa Fix typo in comment. 2013-04-20 04:55:44 +00:00
isaki
026814fd27 Terminate a loop in EXT_FRACBITS(64bits) instead of FP_NMANT(83bits).
I don't know why the mantissa of the accumulator is 83bits, but 64bits
or more are not affected.
2013-04-20 04:54:22 +00:00
isaki
5d5a7da8b2 Break a loop off to avoid a long loop even if the precision is not enough. 2013-04-20 04:38:51 +00:00
isaki
c5ad1dc3ef Update a list of implement/unimplement functions. 2013-04-20 03:26:11 +00:00
isaki
ea6e6f37fa Implement exponential and power functions.
o FETOX   .. exp(x)
o FETOXM1 .. exp(x) - 1
o FTENTOX .. 10^x
o FTWOTOX .. 2^x
At last all mathematics functions of FPE were implemented.
Thanks to Yosuke Sugahara.
2013-04-20 03:06:19 +00:00
isaki
0f49abface s/tayler/taylor/. pointed out by christos@ 2013-04-20 01:48:20 +00:00
isaki
397d02332b Implement a hyperbolic arctangent (FATANH). 2013-04-19 14:05:12 +00:00
isaki
b9e60bfea4 Implement inverse trigonometric functions (i.e., FACOS, FASIN, FATAN
instructions).
o arccos is calculated using arcsin.
o arcsin is calculated using arctan.
o arctan is calculated by the CORDIC.
2013-04-19 13:57:52 +00:00
isaki
b64bbce367 Introduce the CORDIC algorithm.
o sine and cosine (e.g., FSIN, FCOS and FSINCOS instructions) is now
  calculated in the CORDIC instead of Taylor expansion.
o tangent (FTAN) is not touched from a viewpoint of the code size.
o The CORDIC is applicable for hyperbolic functions (e.g., FSINH,
  FCOSH, FTANH instructions), but I didn't use it because its working
  range is poor.
o The CORDIC is also usable for inverse trigonometric functions,
  I will commit it at next phase.
o The code size becomes a bit big.  I cannot evaluate speed on m68k
  for some reasons, but in test on i386 the CORDIC is approximately
  100 times faster in sin/cos.
2013-04-19 13:31:11 +00:00
isaki
cf9a88b6c4 Improve how to use cmp/sub. 2013-04-18 13:40:25 +00:00
isaki
a85a92a0e3 Introduce FPU_CONST_* constants to avoid a magic number. 2013-04-11 13:27:11 +00:00
christos
caafbf4e1b add missing SSIZE_MIN 2013-04-11 00:57:34 +00:00
isaki
c74e131596 quad_t -> uint64_t 2013-04-01 13:59:21 +00:00
isaki
f53c2e8d4b u_int -> uint32_t 2013-03-26 11:30:20 +00:00
isaki
528dcaf553 Fix a wrong "raw" comparison in step3.2.
It should solve a PR kern/47692.
2013-03-26 10:57:13 +00:00
isaki
d183ccf62e Use the #error directive. 2013-03-23 12:08:47 +00:00
isaki
db5a3d6915 Remove about updating fpsr. It was introduced by me but obviously
duplicated with fpu_emul_arith().
2013-03-23 12:06:24 +00:00
isaki
f63adb5419 Fix fpu_ftox().
Update not only exponential but also mantissa when an integer part
becomes 2 by rounding up.  Without this fix, the extended precision
value becomes 0.0 because mantissa (including explicit integer bit)
is all-zero.
2013-03-22 13:46:38 +00:00
isaki
1cd7b13dd0 const-ify. 2013-03-19 09:28:39 +00:00
isaki
81e778a36f Remove 'register'. 2013-03-19 09:17:17 +00:00
matt
f96ef7b3c5 Remove safepri and use IPL_SAFEPRI instead. This may be defined in a MD
header file (if not, a value of 0 is assmued).
2012-07-27 05:36:09 +00:00
rkujawa
68f1c0c41b Add support for all 4 slots of G-REX 4000D and G-REX 1200. Also add
(untested yet) DMA support for G-REX bridges.
2012-07-11 17:13:30 +00:00
rkujawa
efa7930ac2 Set user page table base address dynamically on amiga. This unbreaks machines
with large Zorro III I/O spaces. Patch originally by Michael L. Hitch.
Test on an A4000.
2012-07-09 19:23:45 +00:00
isaki
9cdd524924 Rewrite fpu_int().
Especially, remove the special treatment when |x| < 1
because it forgets to consider FPCR round mode.
See PR/46627 for the detail.  Thanks Y.Sugahara for advice.
2012-06-25 04:52:23 +00:00
martin
6c3cc552c2 Calling _lwp_create() with a bogus ucontext could trigger a kernel
assertion failure (and thus a crash in DIAGNOSTIC kernels). Independently
discovered by YAMAMOTO Takashi and Joel Sing.

To avoid this, introduce a cpu_mcontext_validate() function and move all
sanity checks from cpu_setmcontext() there. Also untangle the netbsd32
compat mess slightly and add a cpu_mcontext32_validate() cousin there.

Add an exhaustive atf test case, based partly on code from Joel Sing.

Should finally fix the remaining open part of PR kern/43903.
2012-05-21 14:15:16 +00:00
christos
7484a2dbbe - Normalize inclusion protection (remove)
- Move CHAR_{MIN,MAX} to a common file.
- Fix broken comments
2012-03-28 17:03:27 +00:00
he
b83eb5c056 Use c89 function declarations in MCOUNT definition. 2012-03-21 19:59:18 +00:00
rmind
ad12c77015 Remove COMPAT_SA / KERN_SA. Welcome to 6.99.3!
Approved by core@.
2012-02-19 21:05:51 +00:00
martin
f8c7c04bbe Add a posix_spawn syscall, as discussed on tech-kern.
Based on the summer of code project by Charles Zhang, heavily reworked
later by me - all bugs are likely mine.
Ok: core, releng.
2012-02-11 23:16:15 +00:00
mlelstv
780696aa56 Enable build of crash(8) for m86k platforms. 2012-01-31 21:17:57 +00:00
para
e62ee4d475 extending vmem(9) to be able to allocated resources for it's own needs.
simplifying uvm_map handling (no special kernel entries anymore no relocking)
make malloc(9) a thin wrapper around kmem(9)
(with private interface for interrupt safety reasons)

releng@ acknowledged
2012-01-27 19:48:38 +00:00
christos
dd23e71080 Use and define ALIGN() ALIGN_POINTER() and STACK_ALIGN() consistently,
and avoid definining them in 10 different places if not needed.
2012-01-24 20:03:36 +00:00
joerg
e8bec33be1 Change CMSG_SPACE and CMSG_LEN to provide Integer Constant Expressions
again. This was changed in sys/socket.h r1.51 to work around fallout
from the IPv6 aux data migration. It broke the historic ABI on some
platforms. This commit restores compatibility for netbsd32 code on such
platforms and provides a template for future changes to the CMSG_*
alignment. Revert PCC/Clang workarounds in postfix and tmux.
2012-01-20 14:08:04 +00:00
tsutsui
99b79ff6ee Remove UCB clause 3. 2011-12-23 05:06:19 +00:00
tsutsui
71bf9b8ae5 Adjust for function merge and move. 2011-12-22 15:50:37 +00:00
tsutsui
17abcf4f77 Remove fuction declarations of m68881_restore() and m68881_save().
They are in <m68k/m68k.h>.
2011-12-22 15:47:15 +00:00
tsutsui
b417004b5f Merge m68881_save() and m68881_restore() (using most common mvme68k ones).
All functions are checked by my eyes, and all GENERIC kernels compile.
2011-12-22 15:33:28 +00:00
tsutsui
a894edf538 Remove obsolete header. 2011-12-22 15:07:08 +00:00
joerg
6133e96c53 Add TLS support for m68k. 2011-11-22 15:25:28 +00:00
tsutsui
556c80110c Merge copy-and-pasted fpu_probe() function (to share it among more m68k ports).
Tested on TT030, Sun3/80, and X68030.
2011-11-15 12:23:21 +00:00
tsutsui
e179a96fd3 Move spread getsfc() and getdfc() functions into common m68k/support.s.
Note:
- ENTRY_NOPROFILE() is okay since they are used only for debug printf
- they are declared to return int so no need to put a return value into %a0
2011-11-15 10:57:00 +00:00
tsutsui
748b6f060e Use pool_allocator_meta rather than pool_allocator_nointr to allocate
struct pv_entry pool in the previous fix for PR port-m68k/45519.
Per comment from yamt@ on source-changes-d@:
http://mail-index.NetBSD.org/source-changes-d/2011/10/31/msg004211.html
2011-11-03 14:39:05 +00:00