Lines Matching +full:left +full:- +full:right

1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Linux/PA-RISC Project (http://www.parisc-linux.org/)
5 * Floating-point emulation code
6 * Copyright (C) 2001 Hewlett-Packard (Paul Bame) <bame@debian.org>
42 register unsigned int left, right, result, extent; in sgl_fsub() local
50 left = *leftptr; in sgl_fsub()
51 right = *rightptr; in sgl_fsub()
55 Sgl_xortointp1(left,right,/*to*/save); in sgl_fsub()
60 if ((result_exponent = Sgl_exponent(left)) == SGL_INFINITY_EXPONENT) in sgl_fsub()
62 if (Sgl_iszero_mantissa(left)) in sgl_fsub()
64 if (Sgl_isnotnan(right)) in sgl_fsub()
66 if (Sgl_isinfinity(right) && save==0) in sgl_fsub()
80 *dstptr = left; in sgl_fsub()
89 if (Sgl_isone_signaling(left)) in sgl_fsub()
95 Sgl_set_quiet(left); in sgl_fsub()
100 else if (Sgl_is_signalingnan(right)) in sgl_fsub()
106 Sgl_set_quiet(right); in sgl_fsub()
107 *dstptr = right; in sgl_fsub()
113 *dstptr = left; in sgl_fsub()
116 } /* End left NaN or Infinity processing */ in sgl_fsub()
120 if (Sgl_isinfinity_exponent(right)) in sgl_fsub()
122 if (Sgl_iszero_mantissa(right)) in sgl_fsub()
125 Sgl_invert_sign(right); in sgl_fsub()
126 *dstptr = right; in sgl_fsub()
132 if (Sgl_isone_signaling(right)) in sgl_fsub()
138 Sgl_set_quiet(right); in sgl_fsub()
143 *dstptr = right; in sgl_fsub()
145 } /* End right NaN or Infinity processing */ in sgl_fsub()
150 Sgl_copytoint_exponentmantissa(left,signless_upper_left); in sgl_fsub()
151 Sgl_copytoint_exponentmantissa(right,signless_upper_right); in sgl_fsub()
156 /* Set the left operand to the larger one by XOR swap * in sgl_fsub()
158 Sgl_xorfromintp1(save,right,/*to*/right); in sgl_fsub()
159 Sgl_xorfromintp1(save,left,/*to*/left); in sgl_fsub()
160 result_exponent = Sgl_exponent(left); in sgl_fsub()
161 Sgl_invert_sign(left); in sgl_fsub()
163 /* Invariant: left is not smaller than right. */ in sgl_fsub()
165 if((right_exponent = Sgl_exponent(right)) == 0) in sgl_fsub()
168 if(Sgl_iszero_mantissa(right)) in sgl_fsub()
170 /* right is zero */ in sgl_fsub()
171 if(Sgl_iszero_exponentmantissa(left)) in sgl_fsub()
174 Sgl_invert_sign(right); in sgl_fsub()
177 Sgl_or_signs(left,/*with*/right); in sgl_fsub()
181 Sgl_and_signs(left,/*with*/right); in sgl_fsub()
186 /* Left is not a zero and must be the result. Trapped in sgl_fsub()
187 * underflows are signaled if left is denormalized. Result in sgl_fsub()
192 sign_save = Sgl_signextendedsign(left); in sgl_fsub()
193 Sgl_leftshiftby1(left); in sgl_fsub()
194 Sgl_normalize(left,result_exponent); in sgl_fsub()
195 Sgl_set_sign(left,/*using*/sign_save); in sgl_fsub()
196 Sgl_setwrapped_exponent(left,result_exponent,unfl); in sgl_fsub()
197 *dstptr = left; in sgl_fsub()
202 *dstptr = left; in sgl_fsub()
207 Sgl_clear_sign(right); /* Exponent is already cleared */ in sgl_fsub()
215 Sgl_subtract(left,/*minus*/right,/*into*/result); in sgl_fsub()
232 Sgl_addition(left,right,/*into*/result); in sgl_fsub()
259 Sgl_clear_signexponent_set_hidden(right); in sgl_fsub()
261 Sgl_clear_exponent_set_hidden(left); in sgl_fsub()
262 diff_exponent = result_exponent - right_exponent; in sgl_fsub()
275 /* Align right operand by shifting to right */ in sgl_fsub()
276 Sgl_right_align(/*operand*/right,/*shifted by*/diff_exponent, in sgl_fsub()
287 Sgl_subtract_withextension(left,/*minus*/right,/*with*/extent,/*into*/result); in sgl_fsub()
292 * and extension left until the hidden bit becomes one. Not in sgl_fsub()
298 * shift is needed, then all bits to the right of the guard in sgl_fsub()
308 /* Must have been "x-x" or "x+(-x)". */ in sgl_fsub()
314 result_exponent--; in sgl_fsub()
320 /* Denormalized, exponent should be zero. Left operand * in sgl_fsub()
333 /* Check for denormalized, exponent should be zero. Left * in sgl_fsub()
344 * one position right and still not found a one so the remainder in sgl_fsub()
350 if((result_exponent -= 8) <= 0 && !underflowtrap) in sgl_fsub()
358 if((result_exponent -= 4) <= 0 && !underflowtrap) in sgl_fsub()
378 result_exponent -= 3; in sgl_fsub()
385 result_exponent -= 2; in sgl_fsub()
394 result_exponent -= 1; in sgl_fsub()
418 Sgl_right_align(result,/*by*/(1-result_exponent),extent); in sgl_fsub()
429 Sgl_addition(left,right,/*to*/result); in sgl_fsub()