summaryrefslogtreecommitdiffstats
path: root/sys/amd64/include/ieeefp.h
Commit message (Collapse)AuthorAgeFilesLines
* People porting FreeBSD to new architectures ought not have todas2011-10-211-3/+8
| | | | | | | | | | | | | implement a deprecated FPU control interface in addition to the standard one. To make this clearer, further deprecate ieeefp.h by not declaring the function prototypes except on architectures that implement them already. Currently i386 and amd64 implement the ieeefp.h interface for compatibility, and for fp[gs]etprec(), which doesn't exist on most other hardware. Powerpc, sparc64, and ia64 partially implement it and probably shouldn't, and other architectures don't implement it at all.
* Fix fpset*() to not trap if there is a currently unmasked exception.bde2008-01-111-12/+42
| | | | | | | | | | | | | | | | | | | Unmasked exceptions (which can be fixed up using fpset*() before they trap) are very rare, especially on amd64 since SSE exceptions trap synchronously, but I want to merge the faster amd64 implementations of fpset*() back to i386 without introducing the bug on i386. The i386 implementation has always avoided the trap automatically by changing things using load/store of the FP environment, but this is very slow. Most changes only affect the control word, so they can usually be done much more efficiently, and amd64 has always done this, but loading the control word can trap. This version use the fast method only in the usual case where it will not trap. This only costs a couple of integer instructions (including one branch which I haven't optimized carefully yet) in the usual case, but bloats the inlines a lot. The inlines were already a bit too large to handle both the FPU and SSE.
* Fix some style bugs:bde2008-01-111-24/+25
| | | | | | | | | | | - fix a previous style fix: shifts should be in the correct direction even if they are null. - restore a comment about namespace pollution from floatingpoint.h 1.12 and update it. - remove unused namespace pollution FP_*REG. - improve some comments. - sort macro definitions for entry points. - don't use underscores for macro args.
* Simplify the ifdefs:bde2008-01-091-21/+14
| | | | | | | | | | | | | | | | | - fix this to compile with C++ by casting ints to enums in a few places and by using the correct parameter type for _fpsetprec(). Remove __cplusplus ifdefs which disabled the buggy code. - remove __CC_SUPPORTS___INLINE ifdefs. `__inline' vs `inline', and either of these #defined away, are supposed to be handled by very old ifdefs in <sys/cdefs.h>. Thus the __CC_SUPPORTS___INLINE macro is not needed here (or anywhere else that it used). It is less needed here than in most places, since this file is userland-only and userland is far from supporting INTEL_COMPILER. The __CC_SUPPORTS___INLINE__ macro which was used here is even less needed. It is to support spelling `inline' as `__inline__' instead of the usual spelling `__inline'. Fix some style bugs that I missed in the previous commit (remove unused asms and sort more variables).
* Fix some style bugs (mainly, use explicit shifts when accessing bit-fieldsbde2008-01-091-31/+31
| | | | | even if the shift count happens to be 0, sort declarations, and spell __inline normally).
* Improve some comments.bde2008-01-091-14/+13
|
* The memory operands to fldcw and ldmxcsr are inputs, not outputs.jhb2005-04-121-2/+2
|
* Remove fpsetsticky(). This was added for SysV compatibility, but duedas2005-03-151-20/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | to mistakes from day 1, it has always had semantics inconsistent with SVR4 and its successors. In particular, given argument M: - On Solaris and FreeBSD/{alpha,sparc64}, it clobbers the old flags and *sets* the new flag word to M. (NetBSD, too?) - On FreeBSD/{amd64,i386}, it *clears* the flags that are specified in M and leaves the remaining flags unchanged (modulo a small bug on amd64.) - On FreeBSD/ia64, it is not implemented. There is no way to fix fpsetsticky() to DTRT for both old FreeBSD apps and apps ported from other operating systems, so the best approach seems to be to kill the function and fix any apps that break. I couldn't find any ports that use it, and any such ports would already be broken on FreeBSD/ia64 and Linux anyway. By the way, the routine has always been undocumented in FreeBSD, except for an MLINK to a manpage that doesn't describe it. This manpage has stated since 5.3-RELEASE that the functions it describes are deprecated, so that must mean that functions that it is *supposed* to describe but doesn't are even *more* deprecated. ;-) Note that fpresetsticky() has been retained on FreeBSD/i386. As far as I can tell, no other operating systems or ports of FreeBSD implement it, so there's nothing for it to be inconsistent with. PR: 75862 Suggested by: bde
* netchild's mega-patch to isolate compiler dependencies into a centraljoerg2005-03-021-5/+13
| | | | | | | | | | | | | | | | place. This moves the dependency on GCC's and other compiler's features into the central sys/cdefs.h file, while the individual source files can then refer to #ifdef __COMPILER_FEATURE_FOO where they by now used to refer to #if __GNUC__ > 3.1415 && __BARC__ <= 42. By now, GCC and ICC (the Intel compiler) have been actively tested on IA32 platforms by netchild. Extension to other compilers is supposed to be possible, of course. Submitted by: netchild Reviewed by: various developers on arch@, some time ago
* Update the graffiti.peter2003-11-081-0/+1
|
* Fix a dumbass mistake. I had the 'set' and 'get' reversed in thepeter2003-08-021-2/+2
| | | | fpsetround/fpgetround macro pairs.
* Extend the machine/ieeefp.h that was inherited from i386 to supportpeter2003-07-221-55/+165
| | | | | | | | | the SSE mxcsr register as well. Since gcc will intermix SSE2 and x87 FP code, the fpsetround() etc mode had better be the same. There are hooks to enable these inlines to be instantiated inside libc for non-gcc or C++ callers. (g++ doesn't like the inlines that tried to extract an integer and convert it to an enum).
* o Move the contents of <machine/floatingpoint.h> over tomarcel2003-01-191-0/+80
| | | | | | | | | | | | | | | <machine/ieeefp.h> where it belongs. o Remove the i386 specific inclusion of <machine/floatingpoint.h> from <ieeefp.h>, now that including <machine/ieeefp.h> is enough for all architectures. o Allow <machine/ieeefp.h> to inline the functions exposed by the headers by checking for _IEEEFP_INLINED_ in the MI header. When defined, prototypes are not given and it is assumed that the MD headers, when inlining only a subset of the functions provide prototypes for the functions not being inlined. Based on patch from: Terry Lambert <tlambert2@mindspring.com> Tested with: make release.
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* On FPU exceptions, pass a useful error code (one of the FPE_...cracauer1999-07-251-1/+2
| | | | | | | | | | | | | | | | macros) to the signal handler, for old-style BSD signal handlers as the second (int) argument, for SA_SIGINFO signal handlers as siginfo_t->si_code. This is source-compatible with Solaris, except that we have no <siginfo.h> (which isn't even mentioned in POSIX 1003.1b). An rather complete example program is at http://www3.cons.org/cracauer/freebsd-signal.c This will be added to the regression tests in src/. This commit also adds code to disable the (hardware) FPU from userconfig, so that you can use a software FP emulator on a machine that has hardware floating point. See LINT.
* Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$. We are notpeter1997-02-221-1/+1
| | | | ready for it yet.
* Make the long-awaited change from $Id$ to $FreeBSD$jkh1997-01-141-1/+1
| | | | | | | | This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long. Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise.
* Fix a bunch of spelling errors in the comment fields ofmpp1996-01-301-4/+4
| | | | a bunch of system include files.
* Delete redundant #ifdef __i386__, be consistent about idempotencywollman1994-08-051-8/+4
| | | | | | protection. Submitted by: Bruce Evans
* Move ieeefp.h over, and put it in the correct subdirectory this time.wollman1994-08-041-0/+104
Submitted by: Andrew Moore
OpenPOWER on IntegriCloud