Example #1
0
void
 softfloat_shiftRightJamM(
     uint_fast8_t size_words,
     const uint32_t *aPtr,
     uint32_t count,
     uint32_t *zPtr
 )
{
    uint32_t wordJam, wordCount, *ptr;
    uint_fast8_t i, innerCount;

    wordJam = 0;
    wordCount = count>>5;
    if ( wordCount ) {
        if ( size_words < wordCount ) wordCount = size_words;
        ptr = (uint32_t *) (aPtr + indexMultiwordLo( size_words, wordCount ));
        i = wordCount;
        do {
            wordJam = *ptr++;
            if ( wordJam ) break;
            --i;
        } while ( i );
        ptr = zPtr;
    }
    if ( wordCount < size_words ) {
        aPtr += indexMultiwordHiBut( size_words, wordCount );
        innerCount = count & 31;
        if ( innerCount ) {
            softfloat_shortShiftRightJamM(
                size_words - wordCount,
                aPtr,
                innerCount,
                zPtr + indexMultiwordLoBut( size_words, wordCount )
            );
            if ( ! wordCount ) goto wordJam;
        } else {
            aPtr += indexWordLo( size_words - wordCount );
            ptr = zPtr + indexWordLo( size_words );
            for ( i = size_words - wordCount; i; --i ) {
                *ptr = *aPtr;
                aPtr += wordIncr;
                ptr += wordIncr;
            }
        }
        ptr = zPtr + indexMultiwordHi( size_words, wordCount );
    }
    do {
        *ptr++ = 0;
        --wordCount;
    } while ( wordCount );
 wordJam:
    if ( wordJam ) zPtr[indexWordLo( size_words )] |= 1;

}
Example #2
0
void
softfloat_shiftRightJam256M(
    const uint64_t *aPtr, uint_fast32_t count, uint64_t *zPtr )
{
    uint64_t wordJam;
    uint_fast32_t wordCount;
    uint64_t *ptr;
    uint_fast8_t i, innerCount;

    wordJam = 0;
    wordCount = count>>6;
    if ( wordCount ) {
        if ( 4 < wordCount ) wordCount = 4;
        ptr = (uint64_t *) (aPtr + indexMultiwordLo( 4, wordCount ));
        i = wordCount;
        do {
            wordJam = *ptr++;
            if ( wordJam ) break;
            --i;
        } while ( i );
        ptr = zPtr;
    }
    if ( wordCount < 4 ) {
        aPtr += indexMultiwordHiBut( 4, wordCount );
        innerCount = count & 63;
        if ( innerCount ) {
            softfloat_shortShiftRightJamM(
                4 - wordCount,
                aPtr,
                innerCount,
                zPtr + indexMultiwordLoBut( 4, wordCount )
            );
            if ( ! wordCount ) goto wordJam;
        } else {
            aPtr += indexWordLo( 4 - wordCount );
            ptr = zPtr + indexWordLo( 4 );
            for ( i = 4 - wordCount; i; --i ) {
                *ptr = *aPtr;
                aPtr += wordIncr;
                ptr += wordIncr;
            }
        }
        ptr = zPtr + indexMultiwordHi( 4, wordCount );
    }
    do {
        *ptr++ = 0;
        --wordCount;
    } while ( wordCount );
wordJam:
    if ( wordJam ) zPtr[indexWordLo( 4 )] |= 1;

}
Example #3
0
void
 softfloat_shiftLeftM(
     uint_fast8_t size_words,
     const uint32_t *aPtr,
     uint32_t dist,
     uint32_t *zPtr
 )
{
    uint32_t wordDist;
    uint_fast8_t innerDist;
    uint32_t *destPtr;
    uint_fast8_t i;

    wordDist = dist>>5;
    if ( wordDist < size_words ) {
        aPtr += indexMultiwordLoBut( size_words, wordDist );
        innerDist = dist & 31;
        if ( innerDist ) {
            softfloat_shortShiftLeftM(
                size_words - wordDist,
                aPtr,
                innerDist,
                zPtr + indexMultiwordHiBut( size_words, wordDist )
            );
            if ( ! wordDist ) return;
        } else {
            aPtr += indexWordHi( size_words - wordDist );
            destPtr = zPtr + indexWordHi( size_words );
            for ( i = size_words - wordDist; i; --i ) {
                *destPtr = *aPtr;
                aPtr -= wordIncr;
                destPtr -= wordIncr;
            }
        }
        zPtr += indexMultiwordLo( size_words, wordDist );
    } else {
        wordDist = size_words;
    }
    do {
        *zPtr++ = 0;
        --wordDist;
    } while ( wordDist );

}