aboutsummaryrefslogtreecommitdiff
path: root/lib/msun/i387
Commit message (Collapse)AuthorAgeFilesLines
* Remove residual blank line at start of MakefileWarner Losh2024-07-151-1/+0
| | | | | | | This is a residual of the $FreeBSD$ removal. MFC After: 3 days (though I'll just run the command on the branches) Sponsored by: Netflix
* lib/msun: Cleanup after $FreeBSD$ removalSteve Kargl2024-01-281-1/+0
| | | | | | | Remove no longer needed explicit inclusion of sys/cdefs.h. PR: 276669 MFC after: 1 week
* lib: Automated cleanup of cdefs and other formattingWarner Losh2023-11-271-1/+0
| | | | | | | | | | | | | | | | Apply the following automated changes to try to eliminate no-longer-needed sys/cdefs.h includes as well as now-empty blank lines in a row. Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/ Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/ Remove /\n+#if.*\n#endif.*\n+/ Remove /^#if.*\n#endif.*\n/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/ Sponsored by: Netflix
* Remove $FreeBSD$: one-line sh patternWarner Losh2023-08-161-1/+0
| | | | Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
* Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-1651-103/+0
| | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* Remove $FreeBSD$: one-line .h patternWarner Losh2023-08-161-1/+0
| | | | Remove /^\s*\*+\s*\$FreeBSD\$.*$\n/
* Remove $FreeBSD$: two-line .h patternWarner Losh2023-08-161-2/+0
| | | | Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
* spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDWarner Losh2023-05-122-2/+2
| | | | | | | | | The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of BSD-2-Clause. Discussed with: pfg MFC After: 3 days Sponsored by: Netflix
* libm: Correct some typos in source code commentsGordon Bergling2022-09-039-9/+9
| | | | | | | | | | | | | | - s/modfied/modified/ - s/minimun/minimum/ While here, fix some mandoc warnings: - whitespace at end of input line - unusual Xr punctuation - missing comma before name Obtained from: NetBSD MFC after: 5 days
* Add CFI start/end proc directives to arm64, i386, and ppcConrad Meyer2020-12-058-0/+8
| | | | | | | | | | | | | | Follow-up to r353959 and r368070: do the same for other architectures. arm32 already seems to use its own .fnstart/.fnend directives, which appear to be ARM-specific variants of the same thing. Likewise, MIPS uses .frame directives. Reviewed by: arichardson Differential Revision: https://reviews.freebsd.org/D27387 Notes: svn path=/head/; revision=368354
* Resolve conflicts between macros in fenv.h and ieeefp.hDimitry Andric2018-05-311-8/+8
| | | | | | | | | | | | | | | | | | | | | | | This is a follow-up to r321483, which disabled -Wmacro-redefined for some lib/msun tests. If an application included both fenv.h and ieeefp.h, several macros such as __fldcw(), __fldenv() were defined in both headers, with slightly different arguments, leading to conflicts. Fix this by putting all the common macros in the machine-specific versions of ieeefp.h. Where needed, update the arguments in places where the macros are invoked. This also slightly reduces the differences between the amd64 and i386 versions of ieeefp.h. Reviewed by: kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D15633 Notes: svn path=/head/; revision=334445
* lib: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-262-0/+4
| | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using mis-identified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Notes: svn path=/head/; revision=326219
* Oops, the previous i386 version of e_fmodf.S and e_fmodl.S wasBruce Evans2016-09-042-15/+11
| | | | | | | actually the amd64 version. Notes: svn path=/head/; revision=305385
* Disconnect the "optimized" asm variants of cos(), sin() and tan() fromBruce Evans2016-09-041-2/+2
| | | | | | | | | | | | | | | | | | | | | | the build on i386. Leave them in the source tree for regression tests. The asm functions were always much less accurate (by a factor of more than 10**18 in the worst case). They were faster on old CPUs. But with each new generation of CPUs they get relatively slower. The double precision C version's average advantage is about a factor of 2 on Haswell. The asm functions were already intentionally avoided in float and long double precision on i386 and in all precisions on amd64. Float precision and amd64 give larger advantages to the C version. The long double precision C code and compilers' understanding of long double precision are not so good, so the i387 is still slightly faster for long double precision, except for the unimportant subcase of huge args where the sub-optimal C code now somehow beats the i387 by about a factor of 2. Notes: svn path=/head/; revision=305384
* Add asm versions of fmod(), fmodf() and fmodl() on amd64. Add asmBruce Evans2016-09-043-2/+77
| | | | | | | | | | | | versions of fmodf() amd fmodl() on i387. fmod is similar to remainder, and the C versions are 3 to 9 times slower than the asm versions on x86 for both, but we had the strange mixture of all 6 variants of remainder in asm and only 1 of 6 variants of fmod in asm. Notes: svn path=/head/; revision=305382
* Merge the 386 and amd64 versions of the fenv.h, to make cc -m32Konstantin Belousov2013-04-211-259/+0
| | | | | | | | | | compilations which use fenv.h work. Reviewed by: tjil Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=249724
* Optimise i387 trigonometric functions. Replace "andw 0x400,%ax \ jnz" withTijl Coosemans2012-09-163-16/+16
| | | | | | | "sahf \ jp", "fprem1" with "fprem" and "fstsw %ax" with "fnstsw %ax". Notes: svn path=/head/; revision=240566
* Bugfix: feenableexcept() and fedisableexcept() should just return theDavid Schultz2011-10-211-4/+4
| | | | | | | | | old exception mask, not mask | ~FE_ALL_EXCEPT. MFC after: 2 weeks Notes: svn path=/head/; revision=226594
* Use #include "fenv.h" instead of #include <fenv.h>. This makes itDavid Schultz2011-10-161-1/+1
| | | | | | | | | more convenient to compile the math library by itself. Requested by: bde Notes: svn path=/head/; revision=226415
* Replace two lines accidentally removed in r226218. Thanks to bdeDavid Schultz2011-10-151-0/+3
| | | | | | | for noticing this. Notes: svn path=/head/; revision=226372
* Provide external definitions of all of the standardized functions inDavid Schultz2011-10-103-13/+28
| | | | | | | | | | | | | | | | | | | | fenv.h that are currently inlined. The definitions are provided in fenv.c via 'extern inline' declaractions. This assumes the compiler handles 'extern inline' as specified in C99, which has been true under FreeBSD since 8.0. The goal is to eventually remove the 'static' keyword from the inline definitions in fenv.h, so that non-inlined references all wind up pointing to the same external definition like they're supposed to. I am deferring the second step to provide a window where newly-compiled apps will still link against old math libraries. (This isn't supported, but there's no need to cause undue breakage.) Reviewed by: stefanf, bde Notes: svn path=/head/; revision=226218
* Add section .note.GNU-stack for assembly files used by 386 and amd64.Konstantin Belousov2011-01-0748-0/+96
| | | | Notes: svn path=/head/; revision=217108
* Use __FBSDID() instead of RCSID() in most .S files under lib/msun/i386,Dimitry Andric2010-10-0120-40/+20
| | | | | | | | | | | and one under lib/msun/amd64. This avoids adding the identifiers to the .text section, and moves them to the .comment section instead. Suggested by: bde Approved by: rpaulo (mentor) Notes: svn path=/head/; revision=213337
* Placate new binutils, by using 16-bit %ax instead of 32-bit %eax as anKonstantin Belousov2010-02-032-13/+19
| | | | | | | | | | | | argument for fnstsw. Explicitely specify sizes for the XMM control and status word and X87 control and status words. Reviewed by: das Tested by: avg MFC after: 2 weeks Notes: svn path=/head/; revision=203441
* Use, in uncovered part, the END() macro in order to improve debugging.Attilio Rao2009-05-2540-0/+40
| | | | | | | | | | | | In this specific case, Valgrind won't get confused when analyzing such functions. Sponsored by: Sandvine Incorporated Tested by: emaste MFC: 3 days Notes: svn path=/head/; revision=192760
* On i386, gcc truncates long double constants to double precisionDavid Schultz2008-08-021-0/+86
| | | | | | | | | | | | | | | | | | | at compile time regardless of the dynamic precision, and there's no way to disable this misfeature at compile time. Hence, it's impossible to generate the appropriate tables of constants for the long double inverse trig functions in a straightforward way on i386; this change hacks around the problem by encoding the underlying bits in the table. Note that these functions won't pass the regression test on i386, even with the FPU set to extended precision, because the regression test is similarly damaged by gcc. However, the tests all pass when compiled with a modified version of gcc. Reported by: bde Notes: svn path=/head/; revision=181152
* Add assembly versions of remquol() and remainderl().David Schultz2008-03-303-2/+114
| | | | Notes: svn path=/head/; revision=177768
* Hook up sqrtl() to the build.David Schultz2008-03-021-1/+1
| | | | Notes: svn path=/head/; revision=176722
* MD implementations of sqrtl().David Schultz2008-03-021-0/+43
| | | | Notes: svn path=/head/; revision=176721
* Implement rintl(), nearbyintl(), lrintl(), and llrintl().David Schultz2008-01-144-1/+116
| | | | | | | Thanks to bde@ for feedback and testing of rintl(). Notes: svn path=/head/; revision=175309
* Add logbl(3) to libm.David Schultz2007-12-172-1/+45
| | | | Notes: svn path=/head/; revision=174698
* Use C comments since we now preprocess these files with CPP.Daniel Eischen2007-04-291-1/+3
| | | | Notes: svn path=/head/; revision=169092
* Fix a problem relating to fesetenv() clobbering i387 register stack.David Schultz2007-01-061-1/+12
| | | | | | | | | | | | | | Details: As a side-effect of restoring a saved FP environment, fesetenv() overwrites the tag word, which indicates which i387 registers are in use. Normally this isn't a problem because the calling convention requires the register stack to be empty on function entry and exit. However, fesetenv() is inlined, so we need to tell gcc explicitly that the i387 registers get clobbered. PR: 85101 Notes: svn path=/head/; revision=165841
* Remove an unneeded fnstcw instruction.David Schultz2007-01-051-6/+5
| | | | | | | Noticed by: bde Notes: svn path=/head/; revision=165795
* Moved __BEGIN_DECLS up a little so that it covers __test_sse() and C++Bruce Evans2006-10-141-2/+2
| | | | | | | | | isn't broken, PR: 104425 Notes: svn path=/head/; revision=163358
* Removed the optimized asm versions of scalb() and scalbf(). TheseBruce Evans2006-07-053-62/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | functions are only for compatibility with obsolete standards. They shouldn't be used, so they shouldn't be optimized. Use the generic versions instead. This fixes scalbf() as a side effect. The optimized asm version left garbage on the FP stack. I fixed the corresponding bug in the optimized asm scalb() and scalbn() in 1996. NetBSD fixed it in scalb(), scalbn() and scalbnf() in 1999 but missed fixing it in scalbf(). Then in 2005 the bug was reimplemented in FreeBSD by importing NetBSD's scalbf(). The generic versions have slightly different error handling: - the asm versions blindly round the second parameter to a (floating point) integer and proceed, while the generic versions return NaN if this rounding changes the value. POSIX permits both behaviours (these functions are XSI extensions and the behaviour for a bogus non-integral second parameter is unspecified). Apart from this and the bug in scalbf(), the behaviour of the generic versions seems to be identical. (I only exhusatively tested generic_scalbf(1.0F, anyfloat) == asm_scalb(1.0F, anyfloat). This covers many representative corner cases involving NaNs and Infs but doesn't test exception flags. The brokenness of scalbf() showed up as weird behaviour after testing just 7 integer cases sequentially.) Notes: svn path=/head/; revision=160118
* Add symbol versioning to libm.Daniel Eischen2006-03-272-0/+15
| | | | Notes: svn path=/head/; revision=157196
* Fixed some comments added in rev.1.5.Bruce Evans2005-10-301-5/+7
| | | | | | | | | | | | | | The log message for 1.5 said that some small (one or two ulp) inaccuracies were fixed, and a comment implied that the critical change is to switch the rounding mode to to-nearest, with a switch of the precision to extended at no extra cost. Actually, the errors are very large (ucbtest finds ones of several hundred ulps), and it is the switch of the precision that is critical. Another comment was wrong about NaNs being handled sloppily. Notes: svn path=/head/; revision=151879
* Prevent these functions from using stack outside of their frame.Daniel Eischen2005-05-063-15/+15
| | | | | | | | Reported by: Marc Olzheim <marcolz at stack dot nl> OK'd by: das Notes: svn path=/head/; revision=145969
* More optimized math functions.David Schultz2005-04-169-4/+226
| | | | Notes: svn path=/head/; revision=145171
* Implement and document remquo() and remquof().David Schultz2005-03-253-2/+126
| | | | Notes: svn path=/head/; revision=144091
* Make the fenv.h routines work for programs that use SSE forDavid Schultz2005-03-172-85/+262
| | | | | | | | | | | | | | | | | | | | | | | | | | | | floating-point arithmetic on i386. Now I'm going to make excuses for why this code is kinda scary: - To avoid breaking the ABI with 5.3-RELEASE, we can't change sizeof(fenv_t). I stuck the saved mxcsr in some discontiguous reserved bits in the existing structure. - Attempting to access the mxcsr on older processors results in an illegal instruction exception, so support for SSE must be detected at runtime. (The extra baggage is optimized away if either the application or libm is compiled with -msse{,2}.) I didn't run tests to ensure that this doesn't SIGILL on older 486's lacking the cpuid instruction or on other processors lacking SSE. Results from running the fenv regression test on these processors would be appreciated. (You'll need to compile the test with -DNO_STRICT_DFL_ENV.) If you have an 80386, or if your processor supports SSE but the kernel didn't enable it, then you're probably out of luck. Also, I un-inlined some of the functions that grew larger as a result of this change, moving them from fenv.h to fenv.c. Notes: svn path=/head/; revision=143769
* Replace fegetmask() and fesetmask() with feenableexcept(),David Schultz2005-03-161-4/+15
| | | | | | | | | | | | | fedisableexcept(), and fegetexcept(). These two sets of routines provide the same functionality. I implemented the former as an undocumented internal interface to make the regression test easier to write. However, fe(enable|disable|get)except() is already part of glibc, and I would like to avoid gratuitous differences. The only major flaw in the glibc API is that there's no good way to report errors on processors that don't support all the unmasked exceptions. Notes: svn path=/head/; revision=143708
* - Define the LDBL_PREC to be the number of significant bits in a longDavid Schultz2005-03-071-0/+5
| | | | | | | | double's mantissa. - Add an assembly version of scalbnl. Notes: svn path=/head/; revision=143209
* Add scalbnl, also known as as ldexpl.David Schultz2005-03-071-0/+19
| | | | Notes: svn path=/head/; revision=143206
* Alias scalbnf as ldexpf. The two are identical in binaryDavid Schultz2005-03-071-0/+3
| | | | | | | floating-point formats. Notes: svn path=/head/; revision=143205
* Remove the i387 versions of atan(), atan2(), and atan2f().David Schultz2005-02-214-106/+3
| | | | | | | | | | They are slower than the MI routines on modern hardware, except for degenerate cases such as the Pentium 4. PR: 67469 Notes: svn path=/head/; revision=142176
* Remove i387 versions of asin() and acos(). Although the hardwareDavid Schultz2005-02-203-112/+1
| | | | | | | | | | | instruction was faster on the 486, it's slower than our MD version on modern processors. Determined by: bde PR: 67469 Notes: svn path=/head/; revision=142150
* Remove the float versions of the i387 trig functions obtained fromDavid Schultz2005-02-204-48/+2
| | | | | | | | | | | NetBSD. They're buggy, giving particularly for inputs larger in magnitude than 2**63. Noticed by: bde PR: 67469 Notes: svn path=/head/; revision=142149
* Move machine-dependent crud to its own makefile.David Schultz2005-02-041-0/+11
| | | | Notes: svn path=/head/; revision=141281