Deleted Added
sdiff udiff text old ( 7386:23065556d48e ) new ( 7388:293878a9d220 )
full compact
1/*
2 * Copyright (c) 2010 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

--- 295 unchanged lines hidden (view full) ---

304 feraiseexcept(FeUnderflow);
305 }
306 __asm__ __volatile__("" :: "m" (temp));
307 }
308 return mid;
309}
310
311static inline uint64_t
312vfpFpSToFixed(float val, bool isSigned, bool half, uint8_t imm)
313{
314 fesetround(FeRoundZero);
315 val = val * powf(2.0, imm);
316 __asm__ __volatile__("" : "=m" (val) : "m" (val));
317 feclearexcept(FeAllExceptions);
318 __asm__ __volatile__("" : "=m" (val) : "m" (val));
319 float origVal = val;
320 val = rintf(val);
321 int fpType = std::fpclassify(val);
322 if (fpType == FP_SUBNORMAL || fpType == FP_NAN) {
323 if (fpType == FP_NAN) {
324 feraiseexcept(FeInvalid);

--- 80 unchanged lines hidden (view full) ---

405 float scale = powf(2.0, imm);
406 __asm__ __volatile__("" : "=m" (scale) : "m" (scale));
407 feclearexcept(FeAllExceptions);
408 __asm__ __volatile__("" : "=m" (scale) : "m" (scale));
409 return fixDivDest(fpscr, val / scale, (float)val, scale);
410}
411
412static inline uint64_t
413vfpFpDToFixed(double val, bool isSigned, bool half, uint8_t imm)
414{
415 fesetround(FeRoundNearest);
416 val = val * pow(2.0, imm);
417 __asm__ __volatile__("" : "=m" (val) : "m" (val));
418 fesetround(FeRoundZero);
419 feclearexcept(FeAllExceptions);
420 __asm__ __volatile__("" : "=m" (val) : "m" (val));
421 double origVal = val;
422 val = rint(val);
423 int fpType = std::fpclassify(val);
424 if (fpType == FP_SUBNORMAL || fpType == FP_NAN) {
425 if (fpType == FP_NAN) {
426 feraiseexcept(FeInvalid);

--- 246 unchanged lines hidden ---