Esempio n. 1
0
static void dc_callvm_argInt_x86_win32_fast_gnu(DCCallVM* in_self, DCint x)
{
  DCCallVM_x86* self = (DCCallVM_x86*) in_self;
  if (self->mIntRegs < 2) {
    *( (int*) dcVecAt(&self->mVecHead, sizeof(DCint) * self->mIntRegs ) ) = x;
    ++( self->mIntRegs );
  } else
    dcVecAppend(&self->mVecHead, &x, sizeof(DCint) );
}
static void a_int(DCCallVM* in_self, DCint x)
{
  DCCallVM_arm32_armhf* p = (DCCallVM_arm32_armhf*)in_self;
  if (p->i < 16) {
    * (DCint*) dcVecAt(&p->mVecHead, p->i) = x;
    p->i += 4;
  } else {
    dcVecAppend(&p->mVecHead, &x, sizeof(DCint));
  }
}
static void dc_callvm_argLongLong_sparc64(DCCallVM* in_self, DClonglong x)
{
  DCCallVM_sparc64* self = (DCCallVM_sparc64*)in_self;
  if (self->mIntRegs < IREGS) {
    * ( (DClonglong*) ( dcVecAt(&self->mVecHead, (self->mIntRegs++)*8) ) ) = x;
  } else {
    dcVecAppend(&self->mVecHead, &x, sizeof(DClonglong));
  }
  if (self->mFloatRegs < FREGS) self->mFloatRegs++;
}
static void dc_callvm_argDouble_sparc64(DCCallVM* in_self, DCdouble x)
{
  DCCallVM_sparc64* self = (DCCallVM_sparc64*)in_self;
  if (self->mFloatRegs < FREGS) {
    * ((double*)dcVecAt(&self->mVecHead,(IREGS+(self->mFloatRegs++))*8)) = x;
  }
  if (self->mIntRegs < IREGS) {
    self->mIntRegs++;
  } else {
    dcVecAppend(&self->mVecHead, &x, sizeof(DCdouble));
  }
}
static void a_longlong(DCCallVM* in_self, DClonglong x)
{
  DCCallVM_arm32_armhf* p = (DCCallVM_arm32_armhf*)in_self;

  p->i = (p->i+4) & -8;
  if (p->i < 16) {
    * (DClonglong*) dcVecAt(&p->mVecHead, p->i) = x;
    p->i += 8;
  } else {
    /* 64 bit values need to be aligned on 8 byte boundaries */
    dcVecSkip(&p->mVecHead, dcVecSize(&p->mVecHead) & 4);
    dcVecAppend(&p->mVecHead, &x, sizeof(DClonglong));
  }
}
static void dc_callvm_argFloat_sparc64(DCCallVM* in_self, DCfloat x)
{
  DCCallVM_sparc64* self = (DCCallVM_sparc64*)in_self;
  if (self->mFloatRegs < FREGS) {
    self->mUseSingleFlags |= 1<<self->mFloatRegs;
    * ((float*)dcVecAt(&self->mVecHead,(IREGS+FREGS)*8 + (self->mFloatRegs++)*4)) = x;
  } 
  
  if (self->mIntRegs < IREGS) {
    self->mIntRegs++;
  } else {
    union {
      DCdouble d;
      DClonglong l;
      DCfloat f[2];
    } u;
    u.f[1] = x;
    dcVecAppend(&self->mVecHead, &u.l, sizeof(DClonglong));
  }
}