diff options
author | John Hauser <jhauser@eecs.berkeley.edu> | 2016-07-22 18:03:04 -0700 |
---|---|---|
committer | John Hauser <jhauser@eecs.berkeley.edu> | 2016-07-22 18:03:04 -0700 |
commit | cb5087cd7403acf31ac24ac4be8e019a51904895 (patch) | |
tree | 3eeb55d6ad63e33dc8e3be33614e94bbe8a8cac5 /source/s_shiftRightJamM.c | |
parent | 45fdcf1c6583e4af380b147ac568f5aa721b7ba8 (diff) | |
download | berkeley-softfloat-3-cb5087cd7403acf31ac24ac4be8e019a51904895.zip berkeley-softfloat-3-cb5087cd7403acf31ac24ac4be8e019a51904895.tar.gz berkeley-softfloat-3-cb5087cd7403acf31ac24ac4be8e019a51904895.tar.bz2 |
Release 3b. See "doc/SoftFloat-history.html".
Diffstat (limited to 'source/s_shiftRightJamM.c')
-rw-r--r-- | source/s_shiftRightJamM.c | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/source/s_shiftRightJamM.c b/source/s_shiftRightJamM.c index 94e615f..0fc7bb1 100644 --- a/source/s_shiftRightJamM.c +++ b/source/s_shiftRightJamM.c @@ -2,9 +2,9 @@ /*============================================================================ This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic -Package, Release 3a, by John R. Hauser. +Package, Release 3b, by John R. Hauser. -Copyright 2011, 2012, 2013, 2014, 2015 The Regents of the University of +Copyright 2011, 2012, 2013, 2014, 2015, 2016 The Regents of the University of California. All rights reserved. Redistribution and use in source and binary forms, with or without @@ -46,19 +46,19 @@ void softfloat_shiftRightJamM( uint_fast8_t size_words, const uint32_t *aPtr, - uint32_t count, + uint32_t dist, uint32_t *zPtr ) { - uint32_t wordJam, wordCount, *ptr; - uint_fast8_t i, innerCount; + uint32_t wordJam, wordDist, *ptr; + uint_fast8_t i, innerDist; wordJam = 0; - wordCount = count>>5; - if ( wordCount ) { - if ( size_words < wordCount ) wordCount = size_words; - ptr = (uint32_t *) (aPtr + indexMultiwordLo( size_words, wordCount )); - i = wordCount; + wordDist = dist>>5; + if ( wordDist ) { + if ( size_words < wordDist ) wordDist = size_words; + ptr = (uint32_t *) (aPtr + indexMultiwordLo( size_words, wordDist )); + i = wordDist; do { wordJam = *ptr++; if ( wordJam ) break; @@ -66,32 +66,32 @@ void } while ( i ); ptr = zPtr; } - if ( wordCount < size_words ) { - aPtr += indexMultiwordHiBut( size_words, wordCount ); - innerCount = count & 31; - if ( innerCount ) { + if ( wordDist < size_words ) { + aPtr += indexMultiwordHiBut( size_words, wordDist ); + innerDist = dist & 31; + if ( innerDist ) { softfloat_shortShiftRightJamM( - size_words - wordCount, + size_words - wordDist, aPtr, - innerCount, - zPtr + indexMultiwordLoBut( size_words, wordCount ) + innerDist, + zPtr + indexMultiwordLoBut( size_words, wordDist ) ); - if ( ! wordCount ) goto wordJam; + if ( ! wordDist ) goto wordJam; } else { - aPtr += indexWordLo( size_words - wordCount ); + aPtr += indexWordLo( size_words - wordDist ); ptr = zPtr + indexWordLo( size_words ); - for ( i = size_words - wordCount; i; --i ) { + for ( i = size_words - wordDist; i; --i ) { *ptr = *aPtr; aPtr += wordIncr; ptr += wordIncr; } } - ptr = zPtr + indexMultiwordHi( size_words, wordCount ); + ptr = zPtr + indexMultiwordHi( size_words, wordDist ); } do { *ptr++ = 0; - --wordCount; - } while ( wordCount ); + --wordDist; + } while ( wordDist ); wordJam: if ( wordJam ) zPtr[indexWordLo( size_words )] |= 1; |