aboutsummaryrefslogtreecommitdiff
path: root/lib/libc/sparc64/fpu
Commit message (Collapse)AuthorAgeFilesLines
* Remove sparc64 specific parts of libc.Warner Losh2020-02-2616-3648/+0
| | | | | | | | | | | | | | | Also update comments for which architectures use 128 bit long doubles, as appropriate. The softfloat specialization routines weren't updated since they appear to be from an upstream source which we may want to update in the future to get a more favorable license. Reviewed by: emaste@ Differential Revision: https://reviews.freebsd.org/D23658 Notes: svn path=/head/; revision=358348
* lib: Fix several typos and minor errorsEitan Adler2017-12-271-1/+1
| | | | | | | | | | | - duplicate words - typos - references to old versions of FreeBSD Reviewed by: imp, benno Notes: svn path=/head/; revision=327232
* libc: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-253-0/+6
| | | | | | | | | | | | | | | 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=326193
* General further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-205-5/+15
| | | | | | | | | | | | | | | | | Mainly focus on files that use BSD 3-Clause license. 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. Special thanks to Wind River for providing access to "The Duke of Highlander" tool: an older (2014) run over FreeBSD tree was useful as a starting point. Notes: svn path=/head/; revision=326025
* Renumber copyright clause 4Warner Losh2017-02-2811-11/+11
| | | | | | | | | | | | Renumber cluase 4 to 3, per what everybody else did when BSD granted them permission to remove clause 3. My insistance on keeping the same numbering for legal reasons is too pedantic, so give up on that point. Submitted by: Jan Schaumann <jschauma@stevens.edu> Pull Request: https://github.com/freebsd/freebsd/pull/96 Notes: svn path=/head/; revision=314436
* libc: spelling fixes.Pedro F. Giffuni2016-04-301-1/+1
| | | | | | | Mostly on comments. Notes: svn path=/head/; revision=298830
* Fix unused-but-set-variableBaptiste Daroussin2015-11-151-1/+1
| | | | | | | Spotted by: gcc 5.2 Notes: svn path=/head/; revision=290883
* Replace use of ${.CURDIR} by ${LIBC_SRCTOP} and define ${LIBC_SRCTOP}Marcel Moolenaar2014-03-041-2/+2
| | | | | | | | | | | | | | if not already defined. This allows building libc from outside of lib/libc using a reach-over makefile. A typical use-case is to build a standard ILP32 version and a COMPAT32 version in a single iteration by building the COMPAT32 version using a reach-over makefile. Obtained from: Juniper Networks, Inc. Notes: svn path=/head/; revision=262722
* Fix undefined behavior: (1 << 31) is not defined as 1 is an int and thisEitan Adler2013-11-302-4/+4
| | | | | | | | | | | | | | | | shifts into the sign bit. Instead use (1U << 31) which gets the expected result. This fix is not ideal as it assumes a 32 bit int, but does fix the issue for most cases. A similar change was made in OpenBSD. Discussed with: -arch, rdivacky Reviewed by: cperciva Notes: svn path=/head/; revision=258780
* Computations on NaNs are supposed to return one of the input NaNs unchanged.David Schultz2012-01-162-4/+3
| | | | | | | | | | Fix a few places in the sparc64 floating-point emulator where this wasn't being handled properly. Submitted by: bde Notes: svn path=/head/; revision=230193
* Avoid aliasing which leads to incorrect results when compiling with theMarius Strobl2010-03-211-12/+11
| | | | | | | | | | | default strict aliasing rules. PR: 144900 Submitted by: Peter Jeremy MFC after: 3 days Notes: svn path=/head/; revision=205410
* - While SPARC V9 allows tininess to be detected either before or afterMarius Strobl2010-03-201-5/+10
| | | | | | | | | | | | | | | | rounding (impl. dep. #55), the SPARC JPS1 responsible for SPARC64 and UltraSPARC processors defines that in all cases tinyness is detected before rounding, therefore rounding up to the smallest normalised number should set the underflow flag. - If an infinite result is rounded down, the result should have an exponent 1 less than the value for infinity. PR: 144900 Submitted by: Peter Jeremy MFC after: 3 days Notes: svn path=/head/; revision=205397
* Division should take both arguments' signs into account when theMarius Strobl2010-03-201-7/+9
| | | | | | | | | | | the dividend is infinity or zero and the divisor is not the same. PR: 144900 Submitted by: Peter Jeremy MFC after: 3 days Notes: svn path=/head/; revision=205396
* FPU_DEBUG requires <stdio.h>.Marius Strobl2010-03-203-1/+12
| | | | | | | | | PR: 144900 Submitted by: Peter Jeremy MFC after: 3 days Notes: svn path=/head/; revision=205395
* Ensure that __fpu_ftox() both returns the high bits and res[1] containsMarius Strobl2010-03-201-5/+7
| | | | | | | | | | | the low bits also in the default case. PR: 144900 Obtained from: OpenBSD MFC after: 3 days Notes: svn path=/head/; revision=205394
* - Remove a bogus forward declaration.Marius Strobl2010-03-202-7/+3
| | | | | | | - Fix whitespace. Notes: svn path=/head/; revision=205393
* Fix a typo in r204974 so that FTYPE_LNG matches the initialisers ofMarius Strobl2010-03-111-1/+1
| | | | | | | | | the opmask array. Pointed out by: Peter Jeremy Notes: svn path=/head/; revision=205002
* - The OPSZ macro actually only does the right thing for int32 and int64Marius Strobl2010-03-102-29/+21
| | | | | | | | | | | | | | | | | | | | operands but not for double and extended double ones. Instead of trying to fix the macro just nuke it and unroll the loops in the correct way though as extended double operands turn out to be the only special case. - For FxTO{s,d,q} the source operand is int64 so rs2 has to be re-decoded after setting type accordingly as it's generally decoded using the low 2 bits as the type, which are 0 for these three instructions. - Similarly, in case of F{s,d,q}TOx the target is int64 so rd has to be re-decoded using not only the operand mask appropriate for int64 but also the correct register number encoding. - Use const where appropriate. - Wrap long lines. Submitted by: Peter Jeremy (partly) MFC after: 3 days Notes: svn path=/head/; revision=204974
* The NetBSD Foundation has granted permission to remove clause 3 and 4 fromJoel Dahl2010-03-031-7/+0
| | | | | | | | | their software. Obtained from: NetBSD Notes: svn path=/head/; revision=204640
* Fix some bugs that caused sparc64's quad precision sqrt to getDavid Schultz2008-04-121-5/+5
| | | | | | | | | the wrong answer for virtually all inputs. Thanks to remko for access to a sparc64 box for testing. Notes: svn path=/head/; revision=178139
* Make the software emulator for long doubles set the FPU exceptionDavid Schultz2008-04-121-0/+15
| | | | | | | | | | flags appropriately. The next step is to make it raise a SIGFPE if any exceptions are unmasked. Thanks to remko for access to a sparc64 box for testing. Notes: svn path=/head/; revision=178138
* Use an intermediate pointer to avoid a strict aliasing warning.John Birrell2007-11-231-1/+2
| | | | Notes: svn path=/head/; revision=173859
* Per Regents of the University of Calfornia letter, remove advertisingWarner Losh2007-01-0911-54/+0
| | | | | | | | | clause. # If I've done so improperly on a file, please let me know. Notes: svn path=/head/; revision=165903
* Fix a typo in __fpu_ftox() that caused long double to long (and long long)Marius Strobl2006-12-241-9/+10
| | | | | | | | | | | | conversion of negative numbers to always result in -1. While at it, rearrange the nearby comment so it fits in 80 chars per line, like the rest of this file does. PR: 107130 MFC after: 1 day Notes: svn path=/head/; revision=165529
* fix bus error in newsyslog by making sure that fields in struct fpemuKip Macy2006-10-121-0/+1
| | | | | | | that are accessed as 8 byte quantities are 8 byte aligned Notes: svn path=/head/; revision=163258
* For _Qp_{fge,fgt,fle,flt}() the SCD states that "Exceptions mimic fcmpeq",Marius Strobl2006-04-161-4/+4
| | | | | | | | | | this means they should set the cmpe flag when calling __fpu_compare(). Submitted by: stefanf MFC after: 2 weeks Notes: svn path=/head/; revision=157791
* Add the functions _Qp_cmp() and _Qp_cmpe() as described in the SparcStefan Farfeleder2005-06-211-8/+11
| | | | | | | | | | | Compliance Definition. On sparc64, GCC emits _Qp_cmp() calls for its __builtin_isfoo() functions which are used for C99's isfoo() macros. Approved by: re(dwhite) PR: 73782 Notes: svn path=/head/; revision=147519
* Fix long (and long long) to long double, unsigned to long double and unsignedStefan Farfeleder2005-05-272-10/+24
| | | | | | | | | | | | | | | | | | long (and unsigned long long) to long double conversions. - Add a parameter that specifies the position of the sign bit to the _QP_TTOQ macro, previously it always looked at bit 31. Pass a negative number to disable sign inspection for unsigned types. This fixes _Qp_xtoq(), _Qp_uitoq() and _Qp_uxtoq(). - In the functions __fpu_itof() and __fpu_xtof(), look at the sign bit to decide whether we're doing a conversion from an unsigned type. If so, don't negate the mantissa if the integer exceeds the biggest signed number. PR: 55773 Patch by: Stephen Paskaluk (based upon) MFC after: 2 weeks Notes: svn path=/head/; revision=146673
* s/round/fpround/ to avoid naming clash with GCC builtin function.Alexander Kabaev2004-07-281-8/+8
| | | | Notes: svn path=/head/; revision=132755
* Use unions to avoid violating C99 strict aliasing rules.Dag-Erling Smørgrav2004-03-161-17/+14
| | | | Notes: svn path=/head/; revision=127091
* Remove unused variables. Add required headers and functionJacques Vidrine2004-01-062-2/+0
| | | | | | | declarations. Notes: svn path=/head/; revision=124182
* libc_r wasn't so tied to libc for 22 months.Ruslan Ermilov2002-11-181-1/+1
| | | | Notes: svn path=/head/; revision=107052
* Use FOO(a) for macros with variadic args, instead of FOO(a,) or FOO(a, ).Jake Burkholder2002-09-021-3/+3
| | | | | | | Submitted by: gcc3.2 Notes: svn path=/head/; revision=102831
* Remove unneeded include of machine/emul.h.Jake Burkholder2002-06-181-1/+0
| | | | Notes: svn path=/head/; revision=98373
* Implement _Qp_sqrt. I've been unable to find a C program that gcc generatesJake Burkholder2002-06-041-0/+14
| | | | | | | a call to this for, but apparently somehing in libstdc++ does. Notes: svn path=/head/; revision=97823
* Add a support macro to convert the 5-bit packed register field ofJake Burkholder2002-05-112-62/+88
| | | | | | | | | | | | | | | | | a floating point instruction into a 6-bit register number for double and quad arguments. Make use of the new INSFPdq_RN macro where apporpriate; this is required for correctly handling the "high" fp registers (>= %f32). Fix a number of bugs related to the handling of the high registers which were caused by using __fpu_[gs]etreg() where __fpu_[gs]etreg64() should be used (the former can only access the low, single-precision, registers). Submitted by: tmm Notes: svn path=/head/; revision=96422
* Use __FBSDIDDavid E. O'Brien2002-05-061-2/+3
| | | | Notes: svn path=/head/; revision=96129
* We typically don't add trailing /'s.David E. O'Brien2002-05-061-1/+1
| | | | Notes: svn path=/head/; revision=96128
* Add code to emulate arithmetic, comparison and conversion operationsJake Burkholder2002-04-282-1/+136
| | | | | | | | | | | | | | on long double, which are not implemented in hardware on any UltraSPARC chip that I know of. This just calls into the existing floating point emulator, which is still needed to emulate other floating point operations in certain conditions. Without this gcc has to generate the quad floating point instructions directly, which sometimes causes internal compiler errors. Reviewed by: tmm Notes: svn path=/head/; revision=95604
* Emulate ldq and stq (load/store long double) instructions. GCC has startedJake Burkholder2002-04-277-93/+36
| | | | | | | | | | | | using these to load long doubles, but they aren't implemented in hardware on (at least) UltraSPARC I and II machines. Emulate popc in the user trap handler as well. Re-arrange slightly to make support functions more accessible. Reviewed by: tmm Notes: svn path=/head/; revision=95587
* Rename some fields in struct frame to be compatible with NetBSD/OpenBSD,Jake Burkholder2002-04-091-1/+1
| | | | | | | | | | | | | | and add some compatibility defines. Add fields for ins and locals to struct reg also for the same reason; these aren't filled in yet because getting at those registers sucks and I'd rather not save them in the trapframe just for this. Reorder struct reg to be ABI compatible as well. Add needed include of machine/emul.h. This gets pmdb (poor man's debugger) from OpenBSD mostly compiling but it doesn't work yet :( Notes: svn path=/head/; revision=94254
* Fix the style of the SCM ID's.David E. O'Brien2002-03-223-6/+5
| | | | | | | I believe have made all of libc .h's as consistent as possible. Notes: svn path=/head/; revision=92991
* Fix the style of the SCM ID's.David E. O'Brien2002-03-229-28/+37
| | | | | | | I believe have made all of libc .c's as consistent as possible. Notes: svn path=/head/; revision=92986
* SCM ID tweak.David E. O'Brien2002-03-222-2/+0
| | | | Notes: svn path=/head/; revision=92942
* Remove __P() usage.David E. O'Brien2002-03-212-24/+24
| | | | Notes: svn path=/head/; revision=92905
* Remove 'register' keyword.David E. O'Brien2002-03-218-66/+66
| | | | Notes: svn path=/head/; revision=92889
* Fix some bugs that would prevent %fsr to be set correctly, and addThomas Moestl2002-03-114-8/+25
| | | | | | | | | | | | support for fcmp and fcmpe instructions with a condition code specification other than %fcc0. This (primarily the first part) seems to fix a lot of problems that people were seeing, e.g. perl and gawk failures. Reported and analyzed by: wollman Notes: svn path=/head/; revision=92055
* Add userland floating point emulator code for sparc64. This is a portThomas Moestl2002-02-2315-0/+3516
of the (never committed) in-kernel version (with some optimizations and cleanups), which in turn was ported from NetBSD. Notes: svn path=/head/; revision=91174