Lines Matching +full:left +full:- +full:shift
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>
10 PA header file -- do not include this header file for non-PA builds.
13 /* 32-bit word grabbing functions */
50 #define Sgl_leftshiftby1_withextent(left,right,result) \ argument
51 Shiftdouble(Sall(left),Extall(right),31,Sall(result))
53 #define Sgl_rightshiftby1_withextent(left,right,dst) \ argument
54 Shiftdouble(Sall(left),Extall(right),1,Extall(right))
65 #define Sgl_decrement(sgl_value) Sall(sgl_value) -= 1
156 (SGL_INFINITY_EXPONENT << (32-(1+SGL_EXP_LENGTH))))
158 Sall(sgl_value) = (SGL_INFINITY_EXPONENT << (32-(1+SGL_EXP_LENGTH)))
160 Sall(sgl_value) = (SGL_INFINITY_EXPONENT << (32-(1+SGL_EXP_LENGTH))) \
163 Sall(sgl_value) = (SGL_INFINITY_EXPONENT << (32-(1+SGL_EXP_LENGTH))) | \
180 #define ovfl -
186 Sall(sgl_value) = ((SGL_EMAX+SGL_BIAS) << (32-(1+SGL_EXP_LENGTH))) \
187 | ((1<<(32-(1+SGL_EXP_LENGTH))) - 1 )
189 Sall(sgl_value) = ((SGL_EMAX+SGL_BIAS) << (32-(1+SGL_EXP_LENGTH))) \
190 | ((1<<(32-(1+SGL_EXP_LENGTH))) - 1 ) \
195 ((1<<SGL_EXP_LENGTH) | SGL_INFINITY_EXPONENT) << (32-(1+SGL_EXP_LENGTH))
198 (((SGL_EMAX+SGL_BIAS) << (32-(1+SGL_EXP_LENGTH))) \
199 | ((1 << (32-(1+SGL_EXP_LENGTH))) - 1 ))
202 (((SGL_EMAX+SGL_BIAS) << (32-(1+SGL_EXP_LENGTH))) \
203 | ((1 << (32-(1+SGL_EXP_LENGTH))) - 1 ))
206 #define Sgl_right_align(srcdst,shift,extent) \ argument
207 /* sgl_floating_point srcdst; int shift; extension extent */ \
208 if (shift < 32) { \
209 Extall(extent) = Sall(srcdst) << (32-(shift)); \
210 Sall(srcdst) >>= shift; \
220 /* The left argument is never smaller than the right argument */
222 Sall(sgl_result) = Sall(sgl_left) - Sall(sgl_right)
224 /* Subtract right augmented with extension from left augmented with zeros and
226 #define Sgl_subtract_withextension(left,right,extent,result) \ argument
227 /* sgl_floating_point left,right,result; extension extent */ \
228 Sgl_subtract(left,right,result); \
229 if((Extall(extent) = 0-Extall(extent))) \
230 Sall(result) = Sall(result)-1
235 #define Sgl_xortointp1(left,right,result) \ argument
236 result = Sall(left) XOR Sall(right);
238 #define Sgl_xorfromintp1(left,right,result) \ argument
239 Sall(result) = left XOR Sall(right)
243 Sall(dest) = ((SGL_EMAX+SGL_BIAS)+1)<< (32-(1+SGL_EXP_LENGTH)) \
244 | (1<<(32-(1+SGL_EXP_LENGTH+2)))
246 Sall(dest) = ((SGL_EMAX+SGL_BIAS)+1)<< (32-(1+SGL_EXP_LENGTH)) \
247 | (1<<(32-(1+SGL_EXP_LENGTH+1)))
252 exponent -= 8; \
256 exponent -= 4; \
260 exponent -= 1; \
291 if (exponent >= (1 - SGL_P)) { \
292 guard = (Sall(opnd) >> -exponent) & 1; \
295 Sall(opnd) >>= (1-exponent); \
335 #define Sglext_right_align(srcdstA,srcdstB,shift) \ argument
337 shiftamt = shift % 32; \
339 switch (shift/32) { \
341 sticky = Sextallp2(srcdstB) << 32 - (shiftamt); \
348 sticky = (Sextallp1(srcdstA) << 32 - (shiftamt)) | \
361 /* The left argument is never smaller than the right argument */
363 if( Sextallp2(rightb) > Sextallp2(leftb) ) Sextallp1(lefta)--; \
364 Sextallp2(resultb) = Sextallp2(leftb) - Sextallp2(rightb); \
365 Sextallp1(resulta) = Sextallp1(lefta) - Sextallp1(righta)
406 #define Sglext_xortointp1(left,right,result) Sgl_xortointp1(left,right,result) argument
407 #define Sglext_xorfromintp1(left,right,result) \ argument
408 Sgl_xorfromintp1(left,right,result)
447 if (exponent >= (1-DBL_P)) { \
448 if (exponent >= -31) { \
449 if (exponent > -31) { \
451 Variable_shift_double(opndp1,opndp2,1-exponent,opndp2); \
452 Sextallp1(opndp1) >>= 1-exponent; \
463 Sextallp2(opndp2) = Sextallp1(opndp1) >> -31-exponent; \