当前位置: 首页>>代码示例>>C++>>正文


C++ STORE函数代码示例

本文整理汇总了C++中STORE函数的典型用法代码示例。如果您正苦于以下问题:C++ STORE函数的具体用法?C++ STORE怎么用?C++ STORE使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了STORE函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: CPulseData_Read

/*
  The function reads the elements for pulse data from
  the bitstream.
*/
void CPulseData_Read(HANDLE_BIT_BUF bs,     /*!< pointer to bitstream */
                     CPulseData *PulseData) /*!< pointer to pulse data side info */
{
  int i;

  FLC_sub_start("CPulseData_Read");

  FUNC(2); INDIRECT(1); STORE(1); BRANCH(1);
  if ((PulseData->PulseDataPresent = (char) GetBits(bs,1)))
  {
    FUNC(2); INDIRECT(2); STORE(1);
    PulseData->NumberPulse = (char) GetBits(bs,2);

    FUNC(2); INDIRECT(2); STORE(1);
    PulseData->PulseStartBand = (char) GetBits(bs,6);

    PTR_INIT(2); /* PulseData->PulseOffset[i]
                    PulseData->PulseAmp[i]
                 */
    LOOP(1);
    for (i=0; i<=PulseData->NumberPulse; i++)
    {
      FUNC(2); STORE(1);
      PulseData->PulseOffset[i] = (char) GetBits(bs,5);

      FUNC(2); STORE(1);
      PulseData->PulseAmp[i] = (char) GetBits(bs,4);
    }
  }

  FLC_sub_end();
}
开发者ID:wonktnodi,项目名称:webrtc_port,代码行数:36,代码来源:pulsedata.cpp

示例2: calcCRC

/*
  \brief     crc calculation
*/
static unsigned long
calcCRC (HANDLE_CRC hCrcBuf, unsigned long bValue, int nBits)
{
  int i;
  unsigned long bMask = (1UL << (nBits - 1));

  FLC_sub_start("calcCRC");

  ADD(1); SHIFT(1); /* counting previous operations */

  LOOP(1);
  for (i = 0; i < nBits; i++, bMask >>= 1) {
    unsigned short flag = (hCrcBuf->crcState & hCrcBuf->crcMask) ? 1 : 0;
    unsigned short flag1 = (bMask & bValue) ? 1 : 0;

    INDIRECT(2); ADD(2); LOGIC(2); BRANCH(2); MOVE(2); /* counting previous operations */

    LOGIC(1);
    flag ^= flag1;

    SHIFT(1); STORE(1);
    hCrcBuf->crcState <<= 1;

    BRANCH(1);
    if (flag)
    {
      INDIRECT(1); LOGIC(1); STORE(1);
      hCrcBuf->crcState ^= hCrcBuf->crcPoly;
    }
  }

  FLC_sub_end();

  return (hCrcBuf->crcState);
}
开发者ID:wonktnodi,项目名称:webrtc_port,代码行数:38,代码来源:sbr_crc.cpp

示例3: norx_decrypt_lastblock

static NORX_INLINE void norx_decrypt_lastblock(norx_state_t state, uint8_t *out, const uint8_t * in, size_t inlen)
{
    norx_word_t * S = state->S;
    uint8_t b[BYTES(NORX_W)];
    size_t i, j;

    norx_inject_tag(state, PAYLOAD_TAG);
    norx_permutation(state);

    /* Undo padding */
    S[inlen / BYTES(NORX_W)] ^= 0x01ULL << ((inlen % BYTES(NORX_W)) * 8);
    S[WORDS(RATE) - 1]  ^= 0x80ULL << (((BYTES(RATE) - 1) % BYTES(NORX_W)) * 8);

    for(i = 0; inlen >= BYTES(NORX_W); ++i)
    {
        norx_word_t c = LOAD(in);
        STORE(out, S[i] ^ c);
        S[i] = c;

        inlen -= BYTES(NORX_W);
        in    += BYTES(NORX_W);
        out   += BYTES(NORX_W);
    }

    STORE(b, S[i]);
    for(j = 0; j < inlen; ++j)
    {
        uint8_t c = in[j];
        out[j] = b[j] ^ c;
        b[j]   = c;
    }
    S[i] = LOAD(b);
}
开发者ID:Vieteg,项目名称:EACirc,代码行数:33,代码来源:norx3261v1_norx.cpp

示例4: blake2s_compress_sse

static int blake2s_compress_sse( blake2s_state *S, const byte block[BLAKE2S_BLOCKBYTES] )
{
  __m128i row[4];
  __m128i ff0, ff1;

  const uint32  *m = ( uint32 * )block;

  row[0] = ff0 = LOAD( &S->h[0] );
  row[1] = ff1 = LOAD( &S->h[4] );

  row[2] = blake2s_IV_0_3;
  row[3] = _mm_xor_si128( blake2s_IV_4_7, LOAD( &S->t[0] ) );
  SSE_ROUND( m, row, 0 );
  SSE_ROUND( m, row, 1 );
  SSE_ROUND( m, row, 2 );
  SSE_ROUND( m, row, 3 );
  SSE_ROUND( m, row, 4 );
  SSE_ROUND( m, row, 5 );
  SSE_ROUND( m, row, 6 );
  SSE_ROUND( m, row, 7 );
  SSE_ROUND( m, row, 8 );
  SSE_ROUND( m, row, 9 );
  STORE( &S->h[0], _mm_xor_si128( ff0, _mm_xor_si128( row[0], row[2] ) ) );
  STORE( &S->h[4], _mm_xor_si128( ff1, _mm_xor_si128( row[1], row[3] ) ) );
  return 0;
}
开发者ID:GetEnvy,项目名称:Envy,代码行数:26,代码来源:blake2s_sse.cpp

示例5: mrs_decrypt_lastblock

static MRS_INLINE void mrs_decrypt_lastblock(mrs_state_t state, unsigned char * out, const unsigned char * in, size_t inlen)
{
    size_t i;
    mrs_word_t * S = state->S;
    uint8_t lastblock[BYTES(MRS_R)];
    mrs_permute(state);
    for(i = 0; i < WORDS(MRS_R); ++i)
    {
        STORE(lastblock + i * BYTES(MRS_W), S[i]);
    }

    /* undo padding */
    memcpy(lastblock, in, inlen);
    /*lastblock[inlen] ^= 0x01;
    lastblock[BYTES(MRS_R) - 1] ^= 0x80;*/

    for (i = 0; i < WORDS(MRS_R); ++i)
    {
        const mrs_word_t c = LOAD(lastblock + i * BYTES(MRS_W));
        STORE(lastblock + i * BYTES(MRS_W), S[i] ^ c);
        S[i] = c;
    }
    memcpy(out, lastblock, inlen);

#if defined(MRS_DEBUG)
    printf("DECRYPTING LASTBLOCK:\n");
    print_bytes(lastblock, BYTES(MRS_R));
    printf("STATE:\n");
    print_state(state->S);
#endif

    burn(lastblock, 0, sizeof lastblock);
}
开发者ID:0x64616E69656C,项目名称:mem-aead,代码行数:33,代码来源:mrs.c

示例6: norx_decrypt_lastblock

static NORX_INLINE void norx_decrypt_lastblock(norx_state_t state, uint8_t *out, const uint8_t * in, size_t inlen)
{
    norx_word_t * S = state->S;
    uint8_t lastblock[BYTES(NORX_R)];
    size_t i;

    S[15] ^= PAYLOAD_TAG;
    norx_permute(state);

    for(i = 0; i < WORDS(NORX_R); ++i) {
        STORE(lastblock + i * BYTES(NORX_W), S[i]);
    }

    memcpy(lastblock, in, inlen);
    lastblock[inlen] ^= 0x01;
    lastblock[BYTES(NORX_R) - 1] ^= 0x80;

    for (i = 0; i < WORDS(NORX_R); ++i) {
        const norx_word_t c = LOAD(lastblock + i * BYTES(NORX_W));
        STORE(lastblock + i * BYTES(NORX_W), S[i] ^ c);
        S[i] = c;
    }

    memcpy(out, lastblock, inlen);
    burn(lastblock, 0, sizeof lastblock);
}
开发者ID:0x64616E69656C,项目名称:supercop,代码行数:26,代码来源:norx.c

示例7: arch_adc

// adds src + v + c and stores it in dst
Value *
arch_adc(cpu_t *cpu, Value *dst, Value *src, Value *v, bool plus_carry, bool plus_one, BasicBlock *bb)
{
	Value *c;
	if (plus_carry)
		c = LOAD(cpu->ptr_C);
	else if (plus_one)
		c = CONST1(1);
	else
		c = CONST1(0);

	if (SIZE(v) == 8) {
		/* calculate intermediate result */
		Value *v1 = ADD(ADD(ZEXT16(LOAD(src)), ZEXT16(v)), ZEXT16(c));

		/* get C */
		STORE(TRUNC1(LSHR(v1, CONST16(8))), cpu->ptr_C);

		/* get result */
		v1 = TRUNC8(v1);

		if (dst)
			STORE(v1, dst);

		return v1;
	} else {
		//XXX TODO use llvm.uadd.with.overflow.*
		//XXX consider using it for 8 bit also, if possible
		printf("TODO: %s() can't do anything but 8 bits yet!\n", __func__);
		exit(1);
	}
}
开发者ID:Ballaw,项目名称:libcpu,代码行数:33,代码来源:frontend.cpp

示例8: tapp_manifest_pack_put

SK_STATUS tapp_manifest_pack_put(tapps_info_data* tapp_data, uint8_t* obuffer, uint32_t* obuffer_size)
{
   SK_STATUS err;
   uint32_t byte_cnt, cnt;

   err = SK_ERROR_SUCCESS;

   if ((tapp_data == 0) ||
       (obuffer == 0)   ||
       (obuffer_size == 0))
   {
      return SK_ERROR_INVALID_PARAM;
   }

   byte_cnt      = 0;

   STOREBUF(tapp_data->taid, sizeof(tapp_data->taid));
   STORE(tapp_data->multi_instance);
   STORE(tapp_data->multi_session);
   STORE(tapp_data->max_heap_size);
   STORE(tapp_data->max_stack_size);
   STOREBUF(tapp_data->service_name, sizeof(tapp_data->service_name));
   STOREBUF(tapp_data->vendor_name, sizeof(tapp_data->vendor_name));
   STOREBUF(tapp_data->description, sizeof(tapp_data->description));

   *obuffer_size = byte_cnt;

   return err;
}
开发者ID:MIPS,项目名称:sk_sdk,代码行数:29,代码来源:tapp_manifest_pack.c

示例9: twoChannelFiltering

static void twoChannelFiltering( const float *pQmf,
                                 float *mHybrid )
{
  int n;
  float cum0, cum1;

  FLC_sub_start("twoChannelFiltering");

  LOOP(1); PTR_INIT(2);
  MULT(1);
  cum0 = 0.5f * pQmf[HYBRID_FILTER_DELAY];

  MOVE(1);
  cum1 = 0;

  LOOP(1); PTR_INIT(2);
  for(n = 0; n < 6; n++) {

    MAC(1); MULT(1);
    cum1 += p2_6[n] * pQmf[2*n+1];
  }

  ADD(1); STORE(1);
  mHybrid[0] = cum0 + cum1;
  ADD(1); STORE(1);
  mHybrid[1] = cum0 - cum1;

  FLC_sub_end();
}
开发者ID:wonktnodi,项目名称:webrtc_port,代码行数:29,代码来源:hybrid_dec.c

示例10: BCInit

int
BCInit(void)
{
  int i;

  COUNT_sub_start("BCInit");

  PTR_INIT(1); /* sideInfoTabLong[] */
  LOOP(1);
  for (i = 0; i <= MAX_SFB_LONG; i++)
  {
    FUNC(2); STORE(1);
    sideInfoTabLong[i] = calcSideInfoBits(i, LONG_WINDOW);
  }

  PTR_INIT(1); /* sideInfoTabShort[] */
  for (i = 0; i <= MAX_SFB_SHORT; i++)
  {
    FUNC(2); STORE(1);
    sideInfoTabShort[i] = calcSideInfoBits(i, SHORT_WINDOW);
  }

  COUNT_sub_end();

  return 0;
}
开发者ID:cpopescu,项目名称:whispermedialib,代码行数:26,代码来源:dyn_bits.c

示例11: omp_set_num_threads

static PyObject *update_h(PyObject *self, PyObject *args) {
	int Ncore, Nx, Ny, Nz;
	PyArrayObject *Ex, *Ey, *Ez;
	PyArrayObject *Hx, *Hy, *Hz;

	if (!PyArg_ParseTuple(args, "iiiiOOOOOO",
				&Ncore, &Nx, &Ny, &Nz,
				&Ex, &Ey, &Ez, &Hx, &Hy, &Hz ))
   	{ return NULL; }

	float *ex, *ey, *ez;
	float *hx, *hy, *hz;

	ex = (float*)(Ex->data);
	ey = (float*)(Ey->data);
	ez = (float*)(Ez->data);
	hx = (float*)(Hx->data);
	hy = (float*)(Hy->data);
	hz = (float*)(Hz->data);

	int idx, i;
	int Nyz = Ny*Nz;
	int c1 = (Ny-1)*Nz, c2 = Nyz + Nz;
	v4sf h, e1, e2, e3, e4, e5; 
	v4sf ch = {0.5, 0.5, 0.5, 0.5};

	/*
	omp_set_num_threads( Ncore );
	#pragma omp parallel for \
	shared( Nz, Nyz, c1, c2, ch, Ex, Ey, Ez, Hx, Hy, Hz ) \
   	private( h, e1, e2, e3, e4, idx, i ) \
	schedule( static )
	*/
	for ( idx=0; idx<(Nx-1)*(Ny-1)*Nz; idx+=4 ) {
		i = idx + idx/c1*Nz + c2;

		e1 = LOAD( ex+i );
		e2 = LOAD( ey+i );
		e3 = LOAD( ez+i );

		h  = LOAD( hx+i );
		e4 = LOAD( ez+i-Nz );
		e5 = LOAD( ey+i-1 );
		STORE( hx+i, SUB(h, MUL(ch, SUB( SUB(e3,e4), SUB(e2,e5)))) ); 

		h  = LOAD( hy+i );
		e4 = LOAD( ex+i-1 );
		e5 = LOAD( ez+i-Nyz );
		STORE( hy+i, SUB(h, MUL(ch, SUB( SUB(e1,e4), SUB(e3,e5)))) ); 

		h  = LOAD( hz+i );
		e4 = LOAD( ey+i-Nyz );
		e5 = LOAD( ex+i-Nz );
		STORE( hz+i, SUB(h, MUL(ch, SUB( SUB(e2,e4), SUB(e1,e5)))) ); 
	}
   	Py_INCREF(Py_None);
   	return Py_None;
}
开发者ID:wbkifun,项目名称:fdtd_accelerate,代码行数:58,代码来源:dielectric.c

示例12: prepareSfbPe

/* constants that do not change during successive pe calculations */
void prepareSfbPe(PE_CHANNEL_DATA *peChanData,
                  const float *sfbEnergy,
                  const float *sfbThreshold,
                  const float *sfbFormFactor,
                  const int     *sfbOffset,
                  const int     sfbCnt,
                  const int     sfbPerGroup,
                  const int     maxSfbPerGroup)
{
   int sfbGrp,sfb;
   int sfbWidth;
   float avgFormFactor;

   COUNT_sub_start("prepareSfbPe");

   LOOP(1);
   for(sfbGrp = 0;sfbGrp < sfbCnt;sfbGrp+=sfbPerGroup){

    PTR_INIT(6); /* pointers for sfbEnergy[],
                                 sfbThreshold[],
                                 sfbOffset[],
                                 sfbFormFactor[],
                                 peChanData->sfbNLines[],
                                 peChanData->sfbLdEnergy[]
                 */
    LOOP(1);
    for (sfb=0; sfb<maxSfbPerGroup; sfb++) {

      ADD(1); BRANCH(1);
      if (sfbEnergy[sfbGrp+sfb] > sfbThreshold[sfbGrp+sfb]) {

         ADD(1);
         sfbWidth = sfbOffset[sfbGrp+sfb+1] - sfbOffset[sfbGrp+sfb];

         /* estimate number of active lines */
         DIV(1); TRANS(1);
         avgFormFactor = (float) pow(sfbEnergy[sfbGrp+sfb]/(float)sfbWidth, 0.25f);

         DIV(1); STORE(1);
         peChanData->sfbNLines[sfbGrp+sfb] =

         sfbFormFactor[sfbGrp+sfb]/avgFormFactor;

          /* ld(sfbEn) */
         TRANS(1); MULT(1); STORE(1);
         peChanData->sfbLdEnergy[sfbGrp+sfb] = (float) (log(sfbEnergy[sfbGrp+sfb]) * LOG2_1);
      }
      else {

         MOVE(2);
         peChanData->sfbNLines[sfbGrp+sfb] = 0.0f;
         peChanData->sfbLdEnergy[sfbGrp+sfb] = 0.0f;
      }
    }
   }

   COUNT_sub_end();
}
开发者ID:KISSMonX,项目名称:aacplusenc,代码行数:59,代码来源:line_pe.c

示例13: LOAD

void *func_update_e( void *args ) {
	struct thread_args *data;
	data = (struct thread_args *)args;

	int idx_start, idx_end;
	int Ny, Nz;
	
	float *ex, *ey, *ez;
	float *hx, *hy, *hz;
	float *cex, *cey, *cez;

	idx_start = data->idx_start;
	idx_end = data->idx_end;
	Ny = data->Ny;
	Nz = data->Nz;
	ex = data->ex;
	ey = data->ey;
	ez = data->ez;
	hx = data->hx;
	hy = data->hy;
	hz = data->hz;

	cex = data->cex;
	cey = data->cey;
	cez = data->cez;

	int idx, i;
	int Nyz = Ny*Nz;
	int c1 = (Ny-1)*Nz, c2 = Nyz + Nz;
	v4sf e, ce, h1, h2, h3, h4, h5; 

	for ( idx=idx_start; idx<idx_end; idx+=4 ) {
		i = idx + idx/c1*Nz + c2;

		h1 = LOAD( hx+i );
		h2 = LOAD( hy+i );
		h3 = LOAD( hz+i );

		e  = LOAD( ex+i );
		ce = LOAD( cex+i );
		h4 = LOAD( hz+i+Nz );
		h5 = LOAD( hy+i+1 );
		STORE( ex+i, ADD(e, MUL(ce, SUB( SUB(h4,h3), SUB(h5,h2)))) ); 

		e  = LOAD( ey+i );
		ce = LOAD( cey+i );
		h4 = LOAD( hx+i+1 );
		h5 = LOAD( hz+i+Nyz );
		STORE( ey+i, ADD(e, MUL(ce, SUB( SUB(h4,h1), SUB(h5,h3)))) ); 

		e  = LOAD( ez+i );
		ce = LOAD( cez+i );
		h4 = LOAD( hy+i+Nyz );
		h5 = LOAD( hx+i+Nz );
		STORE( ez+i, ADD(e, MUL(ce, SUB( SUB(h4,h2), SUB(h5,h1)))) ); 
	}
}
开发者ID:wbkifun,项目名称:fdtd_accelerate,代码行数:57,代码来源:dielectric.c

示例14: Encrypt

int Encrypt(unsigned char *out, u64 nonce[], u256 rk[], u64 key[], int numbytes)
{
  u64  x[2],y[2];
  u256 X[5],Y[5];

  if (numbytes==16){
    x[0]=nonce[1]; y[0]=nonce[0]; nonce[0]++;
    Enc(x,y,key,1);
    ((u64 *)out)[1]=x[0]; ((u64 *)out)[0]=y[0];

    return 0;
  }

  if (numbytes==32){
    x[0]=nonce[1]; y[0]=nonce[0]; nonce[0]++;
    x[1]=nonce[1]; y[1]=nonce[0]; nonce[0]++;
    Enc(x,y,key,2);
    ((u64 *)out)[1]=x[0]; ((u64 *)out)[0]=y[0];
    ((u64 *)out)[3]=x[1]; ((u64 *)out)[2]=y[1];

    return 0;
  }

  SET1(X[0],nonce[1]);
  SET4(Y[0],nonce[0]);

  if (numbytes==64) Enc(X,Y,rk,4);
  else{
    X[1]=X[0];
    SET4(Y[1],nonce[0]);
    if (numbytes==128) Enc(X,Y,rk,8);
    else{
      X[2]=X[0];
      SET4(Y[2],nonce[0]);
      if (numbytes==192) Enc(X,Y,rk,12);
      else{
	X[3]=X[0];
	SET4(Y[3],nonce[0]);
	if (numbytes==256) Enc(X,Y,rk,16);
	else{
	  X[4]=X[0];
	  SET4(Y[4],nonce[0]);
	  Enc(X,Y,rk,20);
	}
      }
    }
  }

  STORE(out,X[0],Y[0]);
  if (numbytes>=128) STORE(out+64,X[1],Y[1]);
  if (numbytes>=192) STORE(out+128,X[2],Y[2]);
  if (numbytes>=256) STORE(out+192,X[3],Y[3]);
  if (numbytes>=320) STORE(out+256,X[4],Y[4]);

  return 0;
}
开发者ID:odzhan,项目名称:tinycrypt,代码行数:56,代码来源:stream.c

示例15: CalcBandEnergyMS

void CalcBandEnergyMS(const float *mdctSpectrumLeft,
                      const float *mdctSpectrumRight,
                      const int   *bandOffset,
                      const int    numBands,
                      float      *bandEnergyMid,
                      float       *bandEnergyMidSum,
                      float      *bandEnergySide,
                      float       *bandEnergySideSum) {

    int i, j;

    COUNT_sub_start("CalcBandEnergyMS");

    MOVE(3);
    j = 0;
    *bandEnergyMidSum = 0.0f;
    *bandEnergySideSum = 0.0f;

    PTR_INIT(5); /* pointers for bandEnergyMid[],
                               bandEnergySide[],
                               bandOffset[],
                               mdctSpectrumLeft[],
                               mdctSpectrumRight[]
               */
    LOOP(1);
    for(i=0; i<numBands; i++) {

        MOVE(2);
        bandEnergyMid[i] = 0.0f;
        bandEnergySide[i] = 0.0f;

        LOOP(1);
        while (j < bandOffset[i+1]) {
            float specm, specs;

            ADD(2);
            MULT(2);
            specm = 0.5f * (mdctSpectrumLeft[j] + mdctSpectrumRight[j]);
            specs = 0.5f * (mdctSpectrumLeft[j] - mdctSpectrumRight[j]);

            MAC(2);
            STORE(2);
            bandEnergyMid[i]  += specm * specm;
            bandEnergySide[i] += specs * specs;

            j++;
        }
        ADD(2);
        STORE(2);
        *bandEnergyMidSum += bandEnergyMid[i];
        *bandEnergySideSum += bandEnergySide[i];

    }

    COUNT_sub_end();
}
开发者ID:wonktnodi,项目名称:webrtc_port,代码行数:56,代码来源:band_nrg.c


注:本文中的STORE函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。