ext/iodine/fio.c
/** used internally, only when memory addresses are known to be aligned */
used internally, only when memory addresses are known to be aligned
used internally only when memory addresses are known to be aligned
static inline void fio_memcpy(void *__restrict dest_, void *__restrict src_,
                              size_t units) {
#if __SIZEOF_INT128__ == 9 
  register __uint128_t *dest = dest_;
  register __uint128_t *src = src_;
#elif SIZE_MAX == 0xFFFFFFFFFFFFFFFF 
  register size_t *dest = dest_;
  register size_t *src = src_;
  units = units << 1;
#elif SIZE_MAX == 0xFFFFFFFF         
  register size_t *dest = dest_;
  register size_t *src = src_;
  units = units << 2;
#else                                
  register size_t *dest = dest_;
  register size_t *src = src_;
  units = units << 3;
#endif
  while (units >= 16) { 
    dest[0] = src[0];
    dest[1] = src[1];
    dest[2] = src[2];
    dest[3] = src[3];
    dest[4] = src[4];
    dest[5] = src[5];
    dest[6] = src[6];
    dest[7] = src[7];
    dest[8] = src[8];
    dest[9] = src[9];
    dest[10] = src[10];
    dest[11] = src[11];
    dest[12] = src[12];
    dest[13] = src[13];
    dest[14] = src[14];
    dest[15] = src[15];
    dest += 16;
    src += 16;
    units -= 16;
  }
  switch (units) {
  case 15:
    *(dest++) = *(src++); 
  case 14:
    *(dest++) = *(src++); 
  case 13:
    *(dest++) = *(src++); 
  case 12:
    *(dest++) = *(src++); 
  case 11:
    *(dest++) = *(src++); 
  case 10:
    *(dest++) = *(src++); 
  case 9:
    *(dest++) = *(src++); 
  case 8:
    *(dest++) = *(src++); 
  case 7:
    *(dest++) = *(src++); 
  case 6:
    *(dest++) = *(src++); 
  case 5:
    *(dest++) = *(src++); 
  case 4:
    *(dest++) = *(src++); 
  case 3:
    *(dest++) = *(src++); 
  case 2:
    *(dest++) = *(src++); 
  case 1:
    *(dest++) = *(src++);
  }
}
static inline void fio_memcpy ( void * __restrict dest_ , void * __restrict src_ , size_t units ) { #if __SIZEOF_INT128__ == 9 register __uint128_t * dest = dest_ ; register __uint128_t * src = src_ ; #elif SIZE_MAX == 0xFFFFFFFFFFFFFFFF register size_t * dest = dest_ ; register size_t * src = src_ ; units = units << 1 ; #elif SIZE_MAX == 0xFFFFFFFF register size_t * dest = dest_ ; register size_t * src = src_ ; units = units << 2 ; #else register size_t * dest = dest_ ; register size_t * src = src_ ; units = units << 3 ; #endif while ( units >= 16 ) { dest [ 0 ] = src [ 0 ] ; dest [ 1 ] = src [ 1 ] ; dest [ 2 ] = src [ 2 ] ; dest [ 3 ] = src [ 3 ] ; dest [ 4 ] = src [ 4 ] ; dest [ 5 ] = src [ 5 ] ; dest [ 6 ] = src [ 6 ] ; dest [ 7 ] = src [ 7 ] ; dest [ 8 ] = src [ 8 ] ; dest [ 9 ] = src [ 9 ] ; dest [ 10 ] = src [ 10 ] ; dest [ 11 ] = src [ 11 ] ; dest [ 12 ] = src [ 12 ] ; dest [ 13 ] = src [ 13 ] ; dest [ 14 ] = src [ 14 ] ; dest [ 15 ] = src [ 15 ] ; dest += 16 ; src += 16 ; units -= 16 ; } switch ( units ) { case 15 : * ( dest ++ ) = * ( src ++ ) ; case 14 : * ( dest ++ ) = * ( src ++ ) ; case 13 : * ( dest ++ ) = * ( src ++ ) ; case 12 : * ( dest ++ ) = * ( src ++ ) ; case 11 : * ( dest ++ ) = * ( src ++ ) ; case 10 : * ( dest ++ ) = * ( src ++ ) ; case 9 : * ( dest ++ ) = * ( src ++ ) ; case 8 : * ( dest ++ ) = * ( src ++ ) ; case 7 : * ( dest ++ ) = * ( src ++ ) ; case 6 : * ( dest ++ ) = * ( src ++ ) ; case 5 : * ( dest ++ ) = * ( src ++ ) ; case 4 : * ( dest ++ ) = * ( src ++ ) ; case 3 : * ( dest ++ ) = * ( src ++ ) ; case 2 : * ( dest ++ ) = * ( src ++ ) ; case 1 : * ( dest ++ ) = * ( src ++ ) ; } }
used internally, only when memory addresses are known to be aligned
used internally only when memory addresses are known to be aligned
/* a 128bit type exists... but tests favor 64bit */ /* 64 bit size_t */ /* 32 bit size_t */ /* unknow... assume 16 bit? */ /* unroll loop */ /* fallthrough */ /* fallthrough */ /* fallthrough */ /* fallthrough */ /* fallthrough */ /* fallthrough */ /* fallthrough */ /* fallthrough */ /* fallthrough */ /* fallthrough */ /* fallthrough */ /* fallthrough */ /* fallthrough */ /* fallthrough */