liberty/support/specpriv-smtx-executive/smtx/units.cpp
/*
 * update page if the shadow bit is set
 */
update page if the shadow bit is set
update page if the shadow bit is set
static void update_page(int8_t* addr, int8_t* data, int8_t* shadow)
{
#if !(DEBUG_ON)
  for (unsigned i = 0 ; i < PAGE_SIZE ; i += 16)
  {
    uint64_t m0 = (*((uint64_t*)(&shadow[i]))) << 6;
    uint64_t m1 = (*((uint64_t*)(&shadow[i+8]))) << 6;
    uint64_t d0 = (*((uint64_t*)(&data[i])));
    uint64_t d1 = (*((uint64_t*)(&data[i+8])));
    __m128i m = _mm_set_epi32((int)(m1 >> 32), (int)m1, (int)(m0 >> 32), (int)m0);
    __m128i d = _mm_set_epi32((int)(d1 >> 32), (int)d1, (int)(d0 >> 32), (int)d0);
    _mm_maskmoveu_si128(d, m, (char*)&(addr[i]));
  }
#else
  for (unsigned i = 0 ; i < PAGE_SIZE ; i++)
  {
    if ( shadow[i] & 0x2 )
    {
      DBG("update_page [%d] %p: %x->%x\n", PREFIX(current_iter)(), &addr[i], (uint8_t)addr[i], (uint8_t)data[i]);
      addr[i] = data[i];
    }
  }
#endif
}
static void update_page ( int8_t * addr , int8_t * data , int8_t * shadow ) { #if ! ( DEBUG_ON ) for ( unsigned i = 0 ; i < PAGE_SIZE ; i += 16 ) { uint64_t m0 = ( * ( ( uint64_t * ) ( & shadow [ i ] ) ) ) << 6 ; uint64_t m1 = ( * ( ( uint64_t * ) ( & shadow [ i + 8 ] ) ) ) << 6 ; uint64_t d0 = ( * ( ( uint64_t * ) ( & data [ i ] ) ) ) ; uint64_t d1 = ( * ( ( uint64_t * ) ( & data [ i + 8 ] ) ) ) ; __m128i m = _mm_set_epi32 ( ( int ) ( m1 >> 32 ) , ( int ) m1 , ( int ) ( m0 >> 32 ) , ( int ) m0 ) ; __m128i d = _mm_set_epi32 ( ( int ) ( d1 >> 32 ) , ( int ) d1 , ( int ) ( d0 >> 32 ) , ( int ) d0 ) ; _mm_maskmoveu_si128 ( d , m , ( char * ) & ( addr [ i ] ) ) ; } #else for ( unsigned i = 0 ; i < PAGE_SIZE ; i ++ ) { if ( shadow [ i ] & 0x2 ) { DBG ( " \n " , PREFIX ( current_iter ) ( ) , & addr [ i ] , ( uint8_t ) addr [ i ] , ( uint8_t ) data [ i ] ) ; addr [ i ] = data [ i ] ; } } #endif }
update page if the shadow bit is set
update page if the shadow bit is set