Changes in uspace/lib/softfloat/mul.c [c0c38c7c:2416085] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/softfloat/mul.c
rc0c38c7c r2416085 34 34 */ 35 35 36 #include "sftypes.h" 36 37 #include "mul.h" 37 38 #include "comparison.h" … … 61 62 return result; 62 63 } 63 64 64 if (is_float32_signan(b)) { /* TODO: fix SigNaN */ 65 65 result.parts.fraction = b.parts.fraction; … … 67 67 return result; 68 68 } 69 70 69 /* set NaN as result */ 71 70 result.bin = FLOAT32_NAN; … … 79 78 return result; 80 79 } 81 82 80 result.parts.fraction = a.parts.fraction; 83 81 result.parts.exp = a.parts.exp; … … 91 89 return result; 92 90 } 93 94 91 result.parts.fraction = b.parts.fraction; 95 92 result.parts.exp = b.parts.exp; … … 109 106 } 110 107 111 if (exp < 0) { 108 if (exp < 0) { 112 109 /* FIXME: underflow */ 113 110 /* return signed zero */ … … 167 164 /* denormalized number */ 168 165 frac1 >>= 1; /* denormalize */ 169 170 166 while ((frac1 > 0) && (exp < 0)) { 171 167 frac1 >>= 1; 172 168 ++exp; 173 169 } 174 175 170 if (frac1 == 0) { 176 171 /* FIXME : underflow */ … … 180 175 } 181 176 } 182 183 177 result.parts.exp = exp; 184 178 result.parts.fraction = frac1 & ((1 << FLOAT32_FRACTION_SIZE) - 1); … … 386 380 } 387 381 388 #ifdef float32_t389 390 float32_t __mulsf3(float32_t a, float32_t b)391 {392 float32_u ua;393 ua.val = a;394 395 float32_u ub;396 ub.val = b;397 398 float32_u res;399 res.data = mul_float32(ua.data, ub.data);400 401 return res.val;402 }403 404 float32_t __aeabi_fmul(float32_t a, float32_t b)405 {406 float32_u ua;407 ua.val = a;408 409 float32_u ub;410 ub.val = b;411 412 float32_u res;413 res.data = mul_float32(ua.data, ub.data);414 415 return res.val;416 }417 418 #endif419 420 #ifdef float64_t421 422 float64_t __muldf3(float64_t a, float64_t b)423 {424 float64_u ua;425 ua.val = a;426 427 float64_u ub;428 ub.val = b;429 430 float64_u res;431 res.data = mul_float64(ua.data, ub.data);432 433 return res.val;434 }435 436 float64_t __aeabi_dmul(float64_t a, float64_t b)437 {438 float64_u ua;439 ua.val = a;440 441 float64_u ub;442 ub.val = b;443 444 float64_u res;445 res.data = mul_float64(ua.data, ub.data);446 447 return res.val;448 }449 450 #endif451 452 #ifdef float128_t453 454 float128_t __multf3(float128_t a, float128_t b)455 {456 float128_u ua;457 ua.val = a;458 459 float128_u ub;460 ub.val = b;461 462 float128_u res;463 res.data = mul_float128(ua.data, ub.data);464 465 return res.val;466 }467 468 void _Qp_mul(float128_t *c, float128_t *a, float128_t *b)469 {470 *c = __multf3(*a, *b);471 }472 473 #endif474 475 382 /** @} 476 383 */
Note:
See TracChangeset
for help on using the changeset viewer.