Lines Matching +full:- +full:- +full:-
5 * IEC/IEEE Floating-point Arithmetic Package. Those parts of the code (and
9 * the SoftFloat-2a license
13 * taken to be licensed under the Softfloat-2a license unless specifically
19 This C source fragment is part of the SoftFloat IEC/IEEE Floating-point
25 National Science Foundation under grant MIP-9311980. The original version
26 of this code was written as part of a project to build a fixed-point vector
80 #include "fpu/softfloat-types.h"
81 #include "qemu/host-utils.h"
84 * shl_double: double-word merging left shift
85 * @l: left or most-significant word
86 * @r: right or least-significant word
97 return c ? (l << c) | (r >> (64 - c)) : l; in shl_double()
102 * shr_double: double-word merging right shift
103 * @l: left or most-significant word
104 * @r: right or least-significant word
115 return c ? (r >> c) | (l << (64 - c)) : r; in shr_double()
119 /*----------------------------------------------------------------------------
126 *----------------------------------------------------------------------------*/
136 z = ( a>>count ) | ( ( a<<( ( - count ) & 31 ) ) != 0 ); in shift32RightJamming()
145 /*----------------------------------------------------------------------------
152 *----------------------------------------------------------------------------*/
162 z = ( a>>count ) | ( ( a<<( ( - count ) & 63 ) ) != 0 ); in shift64RightJamming()
171 /*----------------------------------------------------------------------------
172 | Shifts the 128-bit value formed by concatenating `a0' and `a1' right by 64
175 | bits shifted off form a second 64-bit result as follows: The _last_ bit
176 | shifted off is the most-significant bit of the extra result, and the other
181 | fixed-point value with binary point between `a0' and `a1'. This fixed-point
186 *----------------------------------------------------------------------------*/
193 int8_t negCount = ( - count ) & 63; in shift64ExtraRightJamming()
217 /*----------------------------------------------------------------------------
218 | Shifts the 128-bit value formed by concatenating `a0' and `a1' right by the
221 | than 128, the result will be 0. The result is broken into two 64-bit pieces
223 *----------------------------------------------------------------------------*/
230 int8_t negCount = ( - count ) & 63; in shift128Right()
249 /*----------------------------------------------------------------------------
250 | Shifts the 128-bit value formed by concatenating `a0' and `a1' right by the
256 | nonzero. The result is broken into two 64-bit pieces which are stored at
258 *----------------------------------------------------------------------------*/
265 int8_t negCount = ( - count ) & 63; in shift128RightJamming()
292 /*----------------------------------------------------------------------------
293 | Shifts the 192-bit value formed by concatenating `a0', `a1', and `a2' right
295 | at most 128 nonzero bits; these are broken into two 64-bit pieces which are
297 | off form a third 64-bit result as follows: The _last_ bit shifted off is
298 | the most-significant bit of the extra result, and the other 63 bits of the
303 | to form a fixed-point value with binary point between `a1' and `a2'. This
304 | fixed-point value is shifted right by the number of bits given in `count',
309 *----------------------------------------------------------------------------*/
323 int8_t negCount = ( - count ) & 63; in shift128ExtraRightJamming()
362 /*----------------------------------------------------------------------------
363 | Shifts the 128-bit value formed by concatenating `a0' and `a1' left by the
365 | of `count' must be less than 64. The result is broken into two 64-bit
367 *----------------------------------------------------------------------------*/
373 *z0Ptr = count == 0 ? a0 : (a0 << count) | (a1 >> (-count & 63)); in shortShift128Left()
376 /*----------------------------------------------------------------------------
377 | Shifts the 128-bit value formed by concatenating `a0' and `a1' left by the
379 | of `count' may be greater than 64. The result is broken into two 64-bit
381 *----------------------------------------------------------------------------*/
388 *z0Ptr = count == 0 ? a0 : (a0 << count) | (a1 >> (-count & 63)); in shift128Left()
391 *z0Ptr = a1 << (count - 64); in shift128Left()
395 /*----------------------------------------------------------------------------
396 | Shifts the 192-bit value formed by concatenating `a0', `a1', and `a2' left
399 | 64-bit pieces which are stored at the locations pointed to by `z0Ptr',
401 *----------------------------------------------------------------------------*/
421 negCount = ( ( - count ) & 63 ); in shortShift192Left()
431 /*----------------------------------------------------------------------------
432 | Adds the 128-bit value formed by concatenating `a0' and `a1' to the 128-bit
434 | any carry out is lost. The result is broken into two 64-bit pieces which
436 *----------------------------------------------------------------------------*/
446 /*----------------------------------------------------------------------------
447 | Adds the 192-bit value formed by concatenating `a0', `a1', and `a2' to the
448 | 192-bit value formed by concatenating `b0', `b1', and `b2'. Addition is
450 | 64-bit pieces which are stored at the locations pointed to by `z0Ptr',
452 *----------------------------------------------------------------------------*/
464 /*----------------------------------------------------------------------------
465 | Subtracts the 128-bit value formed by concatenating `b0' and `b1' from the
466 | 128-bit value formed by concatenating `a0' and `a1'. Subtraction is modulo
468 | 64-bit pieces which are stored at the locations pointed to by `z0Ptr' and
470 *----------------------------------------------------------------------------*/
480 /*----------------------------------------------------------------------------
481 | Subtracts the 192-bit value formed by concatenating `b0', `b1', and `b2'
482 | from the 192-bit value formed by concatenating `a0', `a1', and `a2'.
484 | result is broken into three 64-bit pieces which are stored at the locations
486 *----------------------------------------------------------------------------*/
498 /*----------------------------------------------------------------------------
499 | Multiplies `a' by `b' to obtain a 128-bit product. The product is broken
500 | into two 64-bit pieces which are stored at the locations pointed to by
502 *----------------------------------------------------------------------------*/
510 /*----------------------------------------------------------------------------
511 | Multiplies the 128-bit value formed by concatenating `a0' and `a1' by
512 | `b' to obtain a 192-bit product. The product is broken into three 64-bit
515 *----------------------------------------------------------------------------*/
528 /*----------------------------------------------------------------------------
529 | Multiplies the 128-bit value formed by concatenating `a0' and `a1' to the
530 | 128-bit value formed by concatenating `b0' and `b1' to obtain a 256-bit
531 | product. The product is broken into four 64-bit pieces which are stored at
533 *----------------------------------------------------------------------------*/
552 /*----------------------------------------------------------------------------
553 | Returns an approximation to the 64-bit integer quotient obtained by dividing
554 | `b' into the 128-bit value formed by concatenating `a0' and `a1'. The
557 | If the exact quotient q is larger than 64 bits, the maximum positive 64-bit
559 *----------------------------------------------------------------------------*/
573 z -= UINT64_C(0x100000000); in estimateDiv128To64()
583 /*----------------------------------------------------------------------------
584 | Returns an approximation to the square root of the 32-bit significand given
589 | case, the approximation returned lies strictly within +/-2 of the exact
591 *----------------------------------------------------------------------------*/
608 z = 0x4000 + ( a>>17 ) - sqrtOddAdjustments[ (int)index ]; in estimateSqrt32()
613 z = 0x8000 + ( a>>17 ) - sqrtEvenAdjustments[ (int)index ]; in estimateSqrt32()
622 /*----------------------------------------------------------------------------
623 | Returns 1 if the 128-bit value formed by concatenating `a0' and `a1'
624 | is equal to the 128-bit value formed by concatenating `b0' and `b1'.
626 *----------------------------------------------------------------------------*/
633 /*----------------------------------------------------------------------------
634 | Returns 1 if the 128-bit value formed by concatenating `a0' and `a1' is less
635 | than or equal to the 128-bit value formed by concatenating `b0' and `b1'.
637 *----------------------------------------------------------------------------*/
644 /*----------------------------------------------------------------------------
645 | Returns 1 if the 128-bit value formed by concatenating `a0' and `a1' is less
646 | than the 128-bit value formed by concatenating `b0' and `b1'. Otherwise,
648 *----------------------------------------------------------------------------*/
655 /*----------------------------------------------------------------------------
656 | Returns 1 if the 128-bit value formed by concatenating `a0' and `a1' is
657 | not equal to the 128-bit value formed by concatenating `b0' and `b1'.
659 *----------------------------------------------------------------------------*/
667 * Similarly, comparisons of 192-bit values.