Skip to content

Commit 30373c2

Browse files
committed
0x007FFFFFL -> MANTBITS_SP32, remove L suffix
1 parent 30c5e3c commit 30373c2

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

libclc/clc/lib/generic/math/clc_remquo.inc

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -40,20 +40,20 @@ internal_remquo(float x, float y, float *r, __CLC_ADDRESS_SPACE uint *q) {
4040
exp_x = (int)((tmp_x & (0x7F800000)) >> 23) - 127;
4141
exp_y = (int)((tmp_y & (0x7F800000)) >> 23) - 127;
4242
// Test for NaNs, Infs, and Zeros
43-
if ((exp_x == (0x00000080L)) || (exp_y == (0x00000080L)) ||
44-
(tmp_x == (0x00000000L)) || (tmp_y == (0x00000000L)))
43+
if ((exp_x == 0x00000080) || (exp_y == 0x00000080) || (tmp_x == 0) ||
44+
(tmp_y == 0))
4545
special_op++;
4646
// Get significands
47-
signif_x = (tmp_x & (0x007FFFFFL));
48-
signif_y = (tmp_y & (0x007FFFFFL));
47+
signif_x = (tmp_x & MANTBITS_SP32);
48+
signif_y = (tmp_y & MANTBITS_SP32);
4949
// Process NaNs, Infs, and Zeros
5050
if (special_op) {
5151
(*q) = 0;
5252
// x is NaN
53-
if ((signif_x != (0x00000000L)) && (exp_x == (0x00000080L)))
53+
if ((signif_x != 0) && (exp_x == 0x00000080))
5454
result = x * 1.7f;
5555
// y is NaN
56-
else if ((signif_y != (0x00000000L)) && (exp_y == (0x00000080L)))
56+
else if ((signif_y != 0) && (exp_y == 0x00000080))
5757
result = y * 1.7f;
5858
// y is zero
5959
else if (abs_y == zero) {
@@ -64,7 +64,7 @@ internal_remquo(float x, float y, float *r, __CLC_ADDRESS_SPACE uint *q) {
6464
else if (abs_x == zero)
6565
result = x;
6666
// x is Inf
67-
else if ((signif_x == (0x00000000L)) && (exp_x == (0x00000080L)))
67+
else if ((signif_x == 0) && (exp_x == 0x00000080))
6868
result = zero / zero;
6969
// y is Inf
7070
else
@@ -95,17 +95,17 @@ internal_remquo(float x, float y, float *r, __CLC_ADDRESS_SPACE uint *q) {
9595
return nRet;
9696
}
9797
// Check for denormal x and y, adjust and normalize
98-
if ((exp_x == -127) && (signif_x != (0x00000000L))) {
98+
if ((exp_x == -127) && (signif_x != 0)) {
9999
exp_x = -126;
100-
while (signif_x <= (0x007FFFFFL)) {
100+
while (signif_x <= MANTBITS_SP32) {
101101
exp_x--;
102102
signif_x <<= 1;
103103
};
104104
} else
105105
signif_x = (signif_x | (0x00800000L));
106-
if ((exp_y == -127) && (signif_y != (0x00000000L))) {
106+
if ((exp_y == -127) && (signif_y != 0)) {
107107
exp_y = -126;
108-
while (signif_y <= (0x007FFFFFL)) {
108+
while (signif_y <= MANTBITS_SP32) {
109109
exp_y--;
110110
signif_y <<= 1;
111111
};
@@ -127,7 +127,7 @@ internal_remquo(float x, float y, float *r, __CLC_ADDRESS_SPACE uint *q) {
127127
rem_bit <<= 1;
128128
}
129129
// Zero remquo ... return immediately with sign of x
130-
if (rem_bit == (0x00000000L)) {
130+
if (rem_bit == 0) {
131131
(*q) = ((uint)(0x7FFFFFFFL & quo_bit)) * sign;
132132
(*r) = (zero * x);
133133
return nRet;
@@ -137,14 +137,14 @@ internal_remquo(float x, float y, float *r, __CLC_ADDRESS_SPACE uint *q) {
137137
// Set exponent base, unbiased
138138
j = exp_y;
139139
// Calculate normalization shift
140-
while (rem_bit <= (0x007FFFFFL)) {
140+
while (rem_bit <= MANTBITS_SP32) {
141141
j--;
142142
rem_bit <<= 1;
143143
};
144144
// Prepare normal results
145145
if (j >= -126) {
146146
// Remove explicit 1
147-
rem_bit &= (0x007FFFFFL);
147+
rem_bit &= MANTBITS_SP32;
148148
// Set final exponent ... add exponent bias
149149
j = j + 127;
150150
}

0 commit comments

Comments
 (0)