Not sure how to fix R-bitops for ARM

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I'm pretty sure the reason R-bitops doesn't work (and doesn't pass the
testsuite) on ARM is because of how the masking is done in this function:

SEXP bitFlip(SEXP a, SEXP bitWidth ) {
        int i, n, *xbitWidth;
        unsigned int  mask ;
        unsigned int tmp ;
        double *xa, *xaflip ;
        SEXP aflip ;

        PROTECT (a = AS_NUMERIC(a) ) ;
        PROTECT (bitWidth = AS_INTEGER(bitWidth) ) ;

        n=LENGTH(a) ;
        PROTECT (aflip = NEW_NUMERIC(n) ) ;

        xa=NUMERIC_POINTER(a) ;
        xaflip=NUMERIC_POINTER(aflip) ;
        xbitWidth=INTEGER_POINTER(bitWidth)  ;

        mask = ( unsigned int ) -1 >> (32 - *xbitWidth)  ;


        for (i=0; i<n; i++ ) {
                if ( !R_FINITE(xa[i]) || logb(xa[i])>31 )
                        xaflip[i]=NA_REAL ;
                else {
                      	tmp=(unsigned int) xa[i] ;
                        xaflip[i]=(double) ( ~tmp & mask ) ;
                }
        }
	UNPROTECT(3) ;
        return (aflip) ;
}

https://bugzilla.redhat.com/show_bug.cgi?id=964422

I'd appreciate some help here.

~tom

==
Fedora Project
_______________________________________________
arm mailing list
arm@xxxxxxxxxxxxxxxxxxxxxxx
https://admin.fedoraproject.org/mailman/listinfo/arm




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux ARM (Vger)]     [Linux ARM]     [ARM Kernel]     [Fedora User Discussion]     [Older Fedora Users Discussion]     [Fedora Advisory Board]     [Fedora Security]     [Fedora Maintainers]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Mentors]     [Fedora Package Announce]     [Fedora Package Review]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Coolkey]     [Yum Users]     [Tux]     [Yosemite News]     [Linux Apps]     [KDE Users]     [Fedora Tools]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]

Powered by Linux