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