Example #1
0
void Agc_check_heap(const char *phase)
{
  SIZE b_free = 0, b_grabbed = 0, s_grabbed = 0;
  ELPTR elp;
  PTR elend;
  SEGCTLPTR segctlp;
  

  for ( segctlp = Agc_segctl_list; segctlp != NIL; segctlp = segctlp->next )
  {
    s_grabbed++;
    b_grabbed += SEGSIZE( segctlp );

    ASSERT( SEGELSIZE( segctlp ) > 0 && (char *)SEGEND( segctlp ) > (char *)SEGSTART( segctlp ),Agc_collect,HEAP segments corrupt at start of gc);

    for ( elp = DECODEPTR(segctlp->free) , elend = (char *)SEGSTART( segctlp ) - 1; elp != NIL; elp = DECODEPTR(elp->next) )
    {
      ASSERT((PTR)elp >= (PTR)SEGSTART(segctlp) && (PTR)elp < (PTR)SEGEND(segctlp)
	     ,phase,elp not within segment);
      ASSERT((PTR)ELEND(elp,segctlp) <= (PTR)SEGEND(segctlp)
	     ,phase,elp end not within segment);
      ASSERT(((char *)(PTR)elp-(char *)(PTR)SEGSTART(segctlp)) % SEGELSIZE(segctlp) == 0
	     ,phase,elp not properly aligned);
      ASSERT( elp->next == CODEDNIL || DECODEPTR(elp->next) > ELEND(elp,segctlp)
	     ,phase,old free list elements overlap);
#ifdef A_GC_WORD_ALIGNED
      ASSERT( WORDALIGNED(elp)
	     ,phase,elp not word aligned);
#endif

      if ( ! ( elp->elements > 0 && (PTR)elp > elend && (elend = (PTR)ELEND( elp, segctlp )) <= (PTR)SEGEND( segctlp ) ) )
      {
	/* Free list has been corrupted. */
	/* Most likely this is because of a user scope/bound error, or CTRANS bug; though possibly a collector bug. */
	GC_ERROR(HEAP free list corrupt);
      }

      b_free += ELBYTESIZE( elp, segctlp );
    }

  }

  ASSERT(Agc_s_grabbed == s_grabbed,phase,count of grabbed segments incorrect);
  ASSERT(Agc_b_grabbed == b_grabbed,phase,count of bytes grabbed incorrect);
  ASSERT(Agc_b_allocated == b_grabbed - b_free,phase,count of bytes allocated incorrect);

}
Example #2
0
void Agc_trace(
  SEGCTLPTR *heap_segments
)
{
  AREA    heap;
  AREA    area;			/* The current area being traced */
  TRACINGSTACK tstack;		/* Stack of areas to be traced */

  SEGCTLPTR segctlp;
  SEGCTLPTR *segctlpp;
  SIZE temp;

#ifndef	A_FUNNY_STEPAREAPTR	/* cop-out for weird architectures */
  {
    
	/* Check that STEPAREAPTR works correctly on this machine for this nastily aligned structure */
	/* If C compiler does tight packing, this could be a problem for the garbage collector */

	ASSERT_DECL( struct { PTR p1; char c; PTR p2; } *ass_struct = NIL )
	ASSERT_INIT( ( area.addr = (PTR)&ass_struct->c , area.size = sizeof(*ass_struct) ) );
	ASSERT_INIT( STEPAREA( area ) );
	ASSERT(area.addr == (PTR)&ass_struct->p2,Agc_collect,STEPAREA misbehaving);
  }
#endif

  heap.addr = SEGSTART( *heap_segments ); heap.size = 0 ;/* inital values to be improved in loop*/

  REPORT1(3, "%s\n", "Started trace... setting up bitmaps...");

  for ( segctlp = *heap_segments; segctlp != NIL; segctlp = segctlp->next )
  {
    REPORT6(6,"Agc_collect{mark}: segctlp=0x%p, elsize=%d, start=0x%p, end=0x%p, size=%d,els=%d\n",
	    (void *)segctlp,SEGELSIZE(segctlp),(void *)SEGSTART(segctlp),(void *)SEGEND(segctlp),SEGSIZE(segctlp),SEGELS(segctlp));

    if ( ! ( SEGELSIZE( segctlp ) > 0 && (char *)SEGEND( segctlp ) > (char *)SEGSTART( segctlp ) ) )
    {
      /* Segment control information has been corrupted. */
      /* Most likely this is because of a user scope/bound error, or CTRANS bug; though possibly a collector bug. */
      GC_ERROR(HEAP segments corrupt);
    }

    if ( (char *)SEGSTART( segctlp ) < (char *)(heap.addr) )
    {
      heap.size += (SIZE)((char *)(heap.addr) - (char *)SEGSTART( segctlp ));
      heap.addr = SEGSTART( segctlp );
    }
    
    if ( SEGEND( segctlp ) > (PTR)((char *)(heap.addr)+heap.size) )
      heap.size = (SIZE)((char *)SEGEND( segctlp ) - (char*)(heap.addr));

    GRAB_BITMAP( segctlp->bitmap, SEGELS( segctlp ) + 3 );
    SETMARK( segctlp->bitmap, SEGELS( segctlp ) + 0 );
    ASSERT(!TSTMARK(segctlp->bitmap,SEGELS(segctlp)+1),Agc_collect,bitmap trailer set at grab);
    SETMARK( segctlp->bitmap, SEGELS( segctlp ) + 2 );
    /* create an artificial endpoint which can be scanned to */
    REPORT2(6,"Agc_collect:\t\tbitmap, ptr=0x%p, size=%d\n", (void *)(segctlp->bitmap), SEGELS( segctlp ));
  }

  REPORT2(5,"Agc_collect: heap address=0x%p, heap size=%d\n",(void *)heap.addr,heap.size);

  INIT_STACK(tstack);
  ASSERT_INIT(PUSH(tstack,(PTR)Agc_collect,-42)); /* Assertion mark */
  PUSH(tstack, NIL, 0);				  /* identifies exhausted stack */

  REPORT1(3, "%s\n", "Initialising stack scan...");

  INIT_AREA(area);   /* set area to first area to search - could also PUSH
                        any additional areas (or use NEXT_AREA) */

  do
  {
    for ( ; !NILAREA(area); /* POP() at end of loop as it may contain statements */ )
    {

      REPORT3(6,"Agc_collect: AREA scan, ptr=0x%p -> 0x%p, size=%d\n",
	      (void *)area.addr,(void *)((char *)area.addr+area.size),area.size);

      ASSERT(area.size >= 0 && area.size < 100*1024*1024 /* 100Mb */,Agc_collect,area size not sensible);

      for ( ; area.size >= sizeof(PTR); STEPAREA(area) )
      {
	SIZE	els, el_in_seg;

	PTR p = * (PTR *) area.addr; /* View word as a pointer */

	REPORT3(9,"Agc_collect: AREA scan step, ptr=0x%p, size=%d, p=0x%p\n",
		(void *)area.addr,area.size,(void *)p);

	/* Continue loop if 'p' is unlikely to be a heap pointer.			*/
	/* Keeping the loop small may help some machines with small instruction caches.	*/

	if ( !VALIDPTR( p ) || !PTRINAREA(p,heap) ) continue;

	/* p is very likely to be a heap pointer */

	for ( segctlpp = heap_segments; (segctlp = *segctlpp) != NIL; segctlpp = &((segctlp)->next ))
	{
	  if ( (char *)p >= (char *)SEGSTART(segctlp) && (char *)p < (char *)SEGEND(segctlp) )
	  {
	    /* Segment for heap pointer */

	    goto found_segment;
	  }
	}

	/* Not a valid heap pointer */

	continue;		/* back to STEPAREA loop */

      found_segment:

	REPORT3(6,"Agc_collect, found_segment: ptr=0x%p, segctlp=0x%p, elsize=%d\n",
		(void *)p,(void *)segctlp,SEGELSIZE(segctlp));

	/*
	 **  	Move segment to front of segment list, to effect a 'cacheing' as in allocation.
	 **	We believe that there is locality in types of heap pointers,
	 **	(consider lists and trees) so it is likely that next
	 **	lookup will immediately succeed.
	 **	However a fast search startegy might be better ???
	 **
	 **	Note that typical programs only have a small number of segs,
	 **	many of which are infrequently used.
	 **		Multics Algol68 compiler uses 12 segs;
	 **		ELLA uses ??? segs.
	 */

	*segctlpp = segctlp->next;
	segctlp->next = *heap_segments;
	*heap_segments = segctlp;


#ifdef  MUST_POINT_TO_WORD
	/*
	 * Ignore pointers that are not word aligned,
	 * unless in a segment of objects of size that is not a multiple of word.
	 */

	if ( (SEGELSIZE(segctlp) & (WORDSIZE-1)) == 0 && (((CODEDPTR)(p) & (WORDSIZE-1)) != 0) )
	  continue;		/* p not to word aligned object, forget it */
#endif

#ifdef  MUST_POINT_TO_LWORD
	/*
	 * Ignore pointers that are not long word aligned,
	 * unless in a segment of objects of size that is not a multiple of long word.
	 */

	if ( (SEGELSIZE(segctlp) & (sizeof(long)-1)) == 0 && (((CODEDPTR)(p) & (sizeof(long)-1)) != 0) )
	  continue;		/* p not to long aligned object, forget it */
#endif


	IDENTIFY_ALIGN_EL( p, el_in_seg, segctlp );


#ifdef  MUST_POINT_TO_START
	/* Ignore pointers that point within objects	*/
	/* This could be implemented more efficiently	*/

	if ( p != * (PTR *) area.addr )
	  continue;		/* p not to start of element, forget it */
#endif

#ifdef	NO_GCMARK
	els = 1;
#else
	ANAL_DESC( els, p, area );
#endif

	REPORT3(6,"Agc_collect, aligned and analysed ptr: ptr=0x%p, element in seg=%d, elements=%d\n",
		(void *)p,el_in_seg,els);

#ifdef A_GC_HALFWORD_ALIGNED
      /* Interpret this as half word aligned (2byte) DJS 8/12/94 */
	/* +++ !!! ???
	 ** Crappy quick fix to keep elements word aligned for the Apollo
	 ** (also done for Sun/68000, though it has not been proved that this is necessary).
	 ** Apollo does not permit word objects to be aligned at any byte boundry,
	 ** even though 68020/68030 does.  This must be because C compiler generates
	 ** strange code, or page faults for words that straddle page boundries are
	 ** handled badly.
	 */

	if ( SEGELSIZE(segctlp) == 1 )
	{
	  if ( (long)p & 1 )
	  {
	    p--;
	    el_in_seg--;
	    els++;
	  }

	  if ( els & 1 )
	  {
	    els++;
	  }

	  if ( els <= 1 || els > SEGELS(segctlp) || p+(els*SEGELSIZE(segctlp)) > SEGEND(segctlp) )
	  {
	    els = 2;
	  }

	  REPORT3(6,"Agc_collect, adjusted to: ptr=0x%x, element in seg=%d, elements=%d\n",
		  p,el_in_seg,els);

	  goto els_sensible;
	}
#endif


#ifdef A_GC_WORD_ALIGNED

	/* +++ !!! ???
	 ** Crappy quick fix to keep elements word aligned.
	 */

	if ( SEGELSIZE(segctlp) == 1 )
	{
	  if ( !WORDALIGNED(p) )
	  {
	    int	offset = (int)((CODEDPTR)p & (WORDSIZE-1));
	    p = (char *)p - offset;
	    el_in_seg -= offset;
	    els += offset;
	  }

	  if ( !WORDALIGNED(els) )
	  {
	    els = (SIZE)ALIGN_NEXT(els,WORDSIZE);
	  }

	  if ( (els < WORDSIZE) || (els > SEGELS(segctlp)) || ((char *)p+(els*SEGELSIZE(segctlp)) > (char *)SEGEND(segctlp) ))
	  {
	    els = WORDSIZE;
	  }

	  REPORT3(6,"Agc_collect, adjusted to: ptr=0x%p, element in seg=%d, elements=%d\n",
		  (void *)p,el_in_seg,els);

	  goto els_sensible;
	}
#endif

	/* 'els' may be a very silly number, check it is reasonable	*/
	/* before doing arithmetic that may overflow.			*/

	if ( els <= 1 || els > SEGELS(segctlp) || (char *)p+(els*SEGELSIZE(segctlp)) > (char *)SEGEND(segctlp) )
	{
	  /* els = 1; assumed in case array descriptor mis analysed, the ptr is still valid */

	  if ( !TSTMARK( segctlp->bitmap, el_in_seg ) )
	  {
	    SETMARK( segctlp->bitmap, el_in_seg );

	    if ( SEGELSIZE(segctlp) >= PTRSIZE )
	    {
	      /* need only scan elements that are large enough to hold pointer */
	      PUSH( tstack, p, SEGELSIZE(segctlp) );

	      REPORT2(6,"Agc_collect: PUSH( ptr=0x%p, size=%d )\n",
		      (void *)p,SEGELSIZE(segctlp));
	    }
	  }
	}
	else
	{
	els_sensible:
	  CALCTSTMARKS( segctlp->bitmap, el_in_seg, els, temp );
	  if ( !RESTSTMARKS( segctlp->bitmap, el_in_seg, els, temp ) )
	  {
	    /*
	     ** At least one element in area has not been marked before.
	     **
	     ** We could just mark and push unmarked areas,
	     ** but this complicates logic for a fairly rare eventuality,
	     ** mainly caused by the trimming of heap rows.
	     */

	    SETMARKS( segctlp->bitmap, el_in_seg, els );

	    if ( SEGELSIZE(segctlp) >= PTRSIZE )
	    {
	      /* need only scan elements that are large enough to hold pointer */
	      PUSH( tstack, p, els*SEGELSIZE(segctlp) );

	      REPORT2(6,"Agc_collect: PUSH( ptr=0x%p, size=%d )\n",
		      (void *)p,els*SEGELSIZE(segctlp));
	    }
	  }
	}
      }
      area = POP(tstack);
    }
    /* Stack is exhausted, replace end marker */

    PUSH(tstack, NIL, 0);	/* identifies exhausted stack */

    NEXT_AREA(area);

    REPORT2(6,"Agc_collect: NEXT_AREA, ptr=0x%p, size=%d\n",(void *)area.addr,area.size);
  }
  while( area.addr != NIL );

  area = POP(tstack);		/* pop of (NIL, 0) to leave stack empty and tidy before calling FREE_STACK() */

  ASSERT_INIT( area=POP(tstack) );
  ASSERT(area.addr == (PTR)Agc_collect && area.size == -42,Agc_collect,tracing stack misuse);

  FREE_STACK(tstack);
  REPORT1(3, "%s\n", "End of trace");
}
Example #3
0
/*
 * FUNCTION: _Validus_Process()
 *
 * SYNOPSIS: Processes a 192-octet block of data, appending
 * the results to the Validus state.
 *
 * ARGUMENTS: Pointer to the Validus state, and the block to be
 * processed
 *
 * NOTES: This function is used internally; you should never
 * call this function directly
 */
void _Validus_Process(validus_t *pstate, const validus_word_t *blk32) {

  validus_word_t a = pstate->f0;
  validus_word_t b = pstate->f1;
  validus_word_t c = pstate->f2;
  validus_word_t d = pstate->f3;
  validus_word_t e = pstate->f4;
  validus_word_t f = pstate->f5;

#ifdef VALIDUS_ENDIAN_BIG
{
  validus_int_t n;
  validus_word_t stk[48];

  for(n = 47; n >= 0; n--) { OCTETSWAP(stk[n], ((validus_octet_t *)&blk32[n])); }

  blk32 = stk;
}
#else
{  
  if (0 == WORDALIGNED(blk32)) {

    validus_word_t stk[48];
    memcpy(stk, blk32, 192);
    blk32 = stk;

  }
}
#endif

  VC_0(d, c, b, a, f, e,  2,  3, blk32[47], VALIDUS_0);
  VC_0(c, b, a, f, e, d,  7,  6, blk32[46], VALIDUS_1);
  VC_0(b, a, f, e, d, c, 10,  9, blk32[45], VALIDUS_2);
  VC_0(a, f, e, d, c, b, 15, 12, blk32[44], VALIDUS_3);
  VC_0(f, e, d, c, b, a, 20, 21, blk32[43], VALIDUS_4);
  VC_0(e, d, c, b, a, f, 25, 24, blk32[42], VALIDUS_5);
  VC_0(d, c, b, a, f, e,  2,  3, blk32[41], VALIDUS_6);
  VC_0(c, b, a, f, e, d,  7,  6, blk32[40], VALIDUS_7);
  VC_0(b, a, f, e, d, c, 10,  9, blk32[39], VALIDUS_8);
  VC_0(a, f, e, d, c, b, 15, 12, blk32[38], VALIDUS_9);
  VC_0(f, e, d, c, b, a, 20, 21, blk32[37], VALIDUS_10);
  VC_0(e, d, c, b, a, f, 25, 24, blk32[36], VALIDUS_11);
  VC_0(d, c, b, a, f, e,  2,  3, blk32[35], VALIDUS_12);
  VC_0(c, b, a, f, e, d,  7,  6, blk32[34], VALIDUS_13);
  VC_0(b, a, f, e, d, c, 10,  9, blk32[33], VALIDUS_14);
  VC_0(a, f, e, d, c, b, 15, 12, blk32[32], VALIDUS_15);
  VC_0(f, e, d, c, b, a, 20, 21, blk32[31], VALIDUS_16);
  VC_0(e, d, c, b, a, f, 25, 24, blk32[30], VALIDUS_17);
  VC_0(d, c, b, a, f, e,  2,  3, blk32[29], VALIDUS_18);
  VC_0(c, b, a, f, e, d,  7,  6, blk32[28], VALIDUS_19);
  VC_0(b, a, f, e, d, c, 10,  9, blk32[27], VALIDUS_20);
  VC_0(a, f, e, d, c, b, 15, 12, blk32[26], VALIDUS_21);
  VC_0(f, e, d, c, b, a, 20, 21, blk32[25], VALIDUS_22);
  VC_0(e, d, c, b, a, f, 25, 24, blk32[24], VALIDUS_23);
  VC_0(d, c, b, a, f, e,  2,  3, blk32[ 0], VALIDUS_24);
  VC_0(c, b, a, f, e, d,  7,  6, blk32[ 1], VALIDUS_25);
  VC_0(b, a, f, e, d, c, 10,  9, blk32[ 2], VALIDUS_26);
  VC_0(a, f, e, d, c, b, 15, 12, blk32[ 3], VALIDUS_27);
  VC_0(f, e, d, c, b, a, 20, 21, blk32[ 4], VALIDUS_28);
  VC_0(e, d, c, b, a, f, 25, 24, blk32[ 5], VALIDUS_29);
  VC_0(d, c, b, a, f, e,  2,  3, blk32[ 6], VALIDUS_30);
  VC_0(c, b, a, f, e, d,  7,  6, blk32[ 7], VALIDUS_31);
  VC_0(b, a, f, e, d, c, 10,  9, blk32[ 8], VALIDUS_32);
  VC_0(a, f, e, d, c, b, 15, 12, blk32[ 9], VALIDUS_33);
  VC_0(f, e, d, c, b, a, 20, 21, blk32[10], VALIDUS_34);
  VC_0(e, d, c, b, a, f, 25, 24, blk32[11], VALIDUS_35);
  VC_0(d, c, b, a, f, e,  2,  3, blk32[12], VALIDUS_36);
  VC_0(c, b, a, f, e, d,  7,  6, blk32[13], VALIDUS_37);
  VC_0(b, a, f, e, d, c, 10,  9, blk32[14], VALIDUS_38);
  VC_0(a, f, e, d, c, b, 15, 12, blk32[15], VALIDUS_39);
  VC_0(f, e, d, c, b, a, 20, 21, blk32[16], VALIDUS_40);
  VC_0(e, d, c, b, a, f, 25, 24, blk32[17], VALIDUS_41);
  VC_0(d, c, b, a, f, e,  2,  3, blk32[18], VALIDUS_42);
  VC_0(c, b, a, f, e, d,  7,  6, blk32[19], VALIDUS_43);
  VC_0(b, a, f, e, d, c, 10,  9, blk32[20], VALIDUS_44);
  VC_0(a, f, e, d, c, b, 15, 12, blk32[21], VALIDUS_45);
  VC_0(f, e, d, c, b, a, 20, 21, blk32[22], VALIDUS_46);
  VC_0(e, d, c, b, a, f, 25, 24, blk32[23], VALIDUS_47);

  VC_1(d, c, b, a, f, e,  5,  4, blk32[22], VALIDUS_48);
  VC_1(c, b, a, f, e, d, 13, 14, blk32[20], VALIDUS_49);
  VC_1(b, a, f, e, d, c, 17, 16, blk32[18], VALIDUS_50);
  VC_1(a, f, e, d, c, b, 22, 19, blk32[23], VALIDUS_51);
  VC_1(f, e, d, c, b, a, 26, 23, blk32[21], VALIDUS_52);
  VC_1(e, d, c, b, a, f, 28, 29, blk32[19], VALIDUS_53);
  VC_1(d, c, b, a, f, e,  5,  4, blk32[16], VALIDUS_54);
  VC_1(c, b, a, f, e, d, 13, 14, blk32[14], VALIDUS_55);
  VC_1(b, a, f, e, d, c, 17, 16, blk32[12], VALIDUS_56);
  VC_1(a, f, e, d, c, b, 22, 19, blk32[17], VALIDUS_57);
  VC_1(f, e, d, c, b, a, 26, 23, blk32[15], VALIDUS_58);
  VC_1(e, d, c, b, a, f, 28, 29, blk32[13], VALIDUS_59);
  VC_1(d, c, b, a, f, e,  5,  4, blk32[10], VALIDUS_60);
  VC_1(c, b, a, f, e, d, 13, 14, blk32[ 8], VALIDUS_61);
  VC_1(b, a, f, e, d, c, 17, 16, blk32[ 6], VALIDUS_62);
  VC_1(a, f, e, d, c, b, 22, 19, blk32[11], VALIDUS_63);
  VC_1(f, e, d, c, b, a, 26, 23, blk32[ 9], VALIDUS_64);
  VC_1(e, d, c, b, a, f, 28, 29, blk32[ 7], VALIDUS_65);
  VC_1(d, c, b, a, f, e,  5,  4, blk32[ 4], VALIDUS_66);
  VC_1(c, b, a, f, e, d, 13, 14, blk32[ 2], VALIDUS_67);
  VC_1(b, a, f, e, d, c, 17, 16, blk32[ 0], VALIDUS_68);
  VC_1(a, f, e, d, c, b, 22, 19, blk32[ 5], VALIDUS_69);
  VC_1(f, e, d, c, b, a, 26, 23, blk32[ 3], VALIDUS_70);
  VC_1(e, d, c, b, a, f, 28, 29, blk32[ 1], VALIDUS_71);
  VC_1(d, c, b, a, f, e,  5,  4, blk32[25], VALIDUS_72);
  VC_1(c, b, a, f, e, d, 13, 14, blk32[27], VALIDUS_73);
  VC_1(b, a, f, e, d, c, 17, 16, blk32[29], VALIDUS_74);
  VC_1(a, f, e, d, c, b, 22, 19, blk32[24], VALIDUS_75);
  VC_1(f, e, d, c, b, a, 26, 23, blk32[26], VALIDUS_76);
  VC_1(e, d, c, b, a, f, 28, 29, blk32[28], VALIDUS_77);
  VC_1(d, c, b, a, f, e,  5,  4, blk32[31], VALIDUS_78);
  VC_1(c, b, a, f, e, d, 13, 14, blk32[33], VALIDUS_79);
  VC_1(b, a, f, e, d, c, 17, 16, blk32[35], VALIDUS_80);
  VC_1(a, f, e, d, c, b, 22, 19, blk32[30], VALIDUS_81);
  VC_1(f, e, d, c, b, a, 26, 23, blk32[32], VALIDUS_82);
  VC_1(e, d, c, b, a, f, 28, 29, blk32[34], VALIDUS_83);
  VC_1(d, c, b, a, f, e,  5,  4, blk32[37], VALIDUS_84);
  VC_1(c, b, a, f, e, d, 13, 14, blk32[39], VALIDUS_85);
  VC_1(b, a, f, e, d, c, 17, 16, blk32[41], VALIDUS_86);
  VC_1(a, f, e, d, c, b, 22, 19, blk32[36], VALIDUS_87);
  VC_1(f, e, d, c, b, a, 26, 23, blk32[38], VALIDUS_88);
  VC_1(e, d, c, b, a, f, 28, 29, blk32[40], VALIDUS_89);
  VC_1(d, c, b, a, f, e,  5,  4, blk32[43], VALIDUS_90);
  VC_1(c, b, a, f, e, d, 13, 14, blk32[45], VALIDUS_91);
  VC_1(b, a, f, e, d, c, 17, 16, blk32[47], VALIDUS_92);
  VC_1(a, f, e, d, c, b, 22, 19, blk32[42], VALIDUS_93);
  VC_1(f, e, d, c, b, a, 26, 23, blk32[44], VALIDUS_94);
  VC_1(e, d, c, b, a, f, 28, 29, blk32[46], VALIDUS_95);

  VC_2(d, c, b, a, f, e,  3,  2, blk32[ 1], VALIDUS_96);
  VC_2(c, b, a, f, e, d,  6,  7, blk32[ 0], VALIDUS_97);
  VC_2(b, a, f, e, d, c,  9, 10, blk32[ 3], VALIDUS_98);
  VC_2(a, f, e, d, c, b, 12, 15, blk32[ 2], VALIDUS_99);
  VC_2(f, e, d, c, b, a, 21, 20, blk32[ 5], VALIDUS_100);
  VC_2(e, d, c, b, a, f, 24, 25, blk32[ 4], VALIDUS_101);
  VC_2(d, c, b, a, f, e,  3,  2, blk32[ 7], VALIDUS_102);
  VC_2(c, b, a, f, e, d,  6,  7, blk32[ 6], VALIDUS_103);
  VC_2(b, a, f, e, d, c,  9, 10, blk32[ 9], VALIDUS_104);
  VC_2(a, f, e, d, c, b, 12, 15, blk32[ 8], VALIDUS_105);
  VC_2(f, e, d, c, b, a, 21, 20, blk32[11], VALIDUS_106);
  VC_2(e, d, c, b, a, f, 24, 25, blk32[10], VALIDUS_107);
  VC_2(d, c, b, a, f, e,  3,  2, blk32[13], VALIDUS_108);
  VC_2(c, b, a, f, e, d,  6,  7, blk32[12], VALIDUS_109);
  VC_2(b, a, f, e, d, c,  9, 10, blk32[15], VALIDUS_110);
  VC_2(a, f, e, d, c, b, 12, 15, blk32[14], VALIDUS_111);
  VC_2(f, e, d, c, b, a, 21, 20, blk32[17], VALIDUS_112);
  VC_2(e, d, c, b, a, f, 24, 25, blk32[16], VALIDUS_113);
  VC_2(d, c, b, a, f, e,  3,  2, blk32[19], VALIDUS_114);
  VC_2(c, b, a, f, e, d,  6,  7, blk32[18], VALIDUS_115);
  VC_2(b, a, f, e, d, c,  9, 10, blk32[21], VALIDUS_116);
  VC_2(a, f, e, d, c, b, 12, 15, blk32[20], VALIDUS_117);
  VC_2(f, e, d, c, b, a, 21, 20, blk32[23], VALIDUS_118);
  VC_2(e, d, c, b, a, f, 24, 25, blk32[22], VALIDUS_119);
  VC_2(d, c, b, a, f, e,  3,  2, blk32[46], VALIDUS_120);
  VC_2(c, b, a, f, e, d,  6,  7, blk32[47], VALIDUS_121);
  VC_2(b, a, f, e, d, c,  9, 10, blk32[44], VALIDUS_122);
  VC_2(a, f, e, d, c, b, 12, 15, blk32[45], VALIDUS_123);
  VC_2(f, e, d, c, b, a, 21, 20, blk32[42], VALIDUS_124);
  VC_2(e, d, c, b, a, f, 24, 25, blk32[43], VALIDUS_125);
  VC_2(d, c, b, a, f, e,  3,  2, blk32[40], VALIDUS_126);
  VC_2(c, b, a, f, e, d,  6,  7, blk32[41], VALIDUS_127);
  VC_2(b, a, f, e, d, c,  9, 10, blk32[38], VALIDUS_128);
  VC_2(a, f, e, d, c, b, 12, 15, blk32[39], VALIDUS_129);
  VC_2(f, e, d, c, b, a, 21, 20, blk32[36], VALIDUS_130);
  VC_2(e, d, c, b, a, f, 24, 25, blk32[37], VALIDUS_131);
  VC_2(d, c, b, a, f, e,  3,  2, blk32[34], VALIDUS_132);
  VC_2(c, b, a, f, e, d,  6,  7, blk32[35], VALIDUS_133);
  VC_2(b, a, f, e, d, c,  9, 10, blk32[32], VALIDUS_134);
  VC_2(a, f, e, d, c, b, 12, 15, blk32[33], VALIDUS_135);
  VC_2(f, e, d, c, b, a, 21, 20, blk32[30], VALIDUS_136);
  VC_2(e, d, c, b, a, f, 24, 25, blk32[31], VALIDUS_137);
  VC_2(d, c, b, a, f, e,  3,  2, blk32[28], VALIDUS_138);
  VC_2(c, b, a, f, e, d,  6,  7, blk32[29], VALIDUS_139);
  VC_2(b, a, f, e, d, c,  9, 10, blk32[26], VALIDUS_140);
  VC_2(a, f, e, d, c, b, 12, 15, blk32[27], VALIDUS_141);
  VC_2(f, e, d, c, b, a, 21, 20, blk32[24], VALIDUS_142);
  VC_2(e, d, c, b, a, f, 24, 25, blk32[25], VALIDUS_143);

  VC_3(d, c, b, a, f, e,  4,  5, blk32[24], VALIDUS_144);
  VC_3(c, b, a, f, e, d, 14, 13, blk32[26], VALIDUS_145);
  VC_3(b, a, f, e, d, c, 16, 17, blk32[28], VALIDUS_146);
  VC_3(a, f, e, d, c, b, 19, 22, blk32[25], VALIDUS_147);
  VC_3(f, e, d, c, b, a, 23, 26, blk32[27], VALIDUS_148);
  VC_3(e, d, c, b, a, f, 29, 28, blk32[29], VALIDUS_149);
  VC_3(d, c, b, a, f, e,  4,  5, blk32[30], VALIDUS_150);
  VC_3(c, b, a, f, e, d, 14, 13, blk32[32], VALIDUS_151);
  VC_3(b, a, f, e, d, c, 16, 17, blk32[34], VALIDUS_152);
  VC_3(a, f, e, d, c, b, 19, 22, blk32[31], VALIDUS_153);
  VC_3(f, e, d, c, b, a, 23, 26, blk32[33], VALIDUS_154);
  VC_3(e, d, c, b, a, f, 29, 28, blk32[35], VALIDUS_155);
  VC_3(d, c, b, a, f, e,  4,  5, blk32[36], VALIDUS_156);
  VC_3(c, b, a, f, e, d, 14, 13, blk32[38], VALIDUS_157);
  VC_3(b, a, f, e, d, c, 16, 17, blk32[40], VALIDUS_158);
  VC_3(a, f, e, d, c, b, 19, 22, blk32[37], VALIDUS_159);
  VC_3(f, e, d, c, b, a, 23, 26, blk32[39], VALIDUS_160);
  VC_3(e, d, c, b, a, f, 29, 28, blk32[41], VALIDUS_161);
  VC_3(d, c, b, a, f, e,  4,  5, blk32[42], VALIDUS_162);
  VC_3(c, b, a, f, e, d, 14, 13, blk32[44], VALIDUS_163);
  VC_3(b, a, f, e, d, c, 16, 17, blk32[46], VALIDUS_164);
  VC_3(a, f, e, d, c, b, 19, 22, blk32[43], VALIDUS_165);
  VC_3(f, e, d, c, b, a, 23, 26, blk32[45], VALIDUS_166);
  VC_3(e, d, c, b, a, f, 29, 28, blk32[47], VALIDUS_167);
  VC_3(d, c, b, a, f, e,  4,  5, blk32[23], VALIDUS_168);
  VC_3(c, b, a, f, e, d, 14, 13, blk32[21], VALIDUS_169);
  VC_3(b, a, f, e, d, c, 16, 17, blk32[19], VALIDUS_170);
  VC_3(a, f, e, d, c, b, 19, 22, blk32[22], VALIDUS_171);
  VC_3(f, e, d, c, b, a, 23, 26, blk32[20], VALIDUS_172);
  VC_3(e, d, c, b, a, f, 29, 28, blk32[18], VALIDUS_173);
  VC_3(d, c, b, a, f, e,  4,  5, blk32[17], VALIDUS_174);
  VC_3(c, b, a, f, e, d, 14, 13, blk32[15], VALIDUS_175);
  VC_3(b, a, f, e, d, c, 16, 17, blk32[13], VALIDUS_176);
  VC_3(a, f, e, d, c, b, 19, 22, blk32[16], VALIDUS_177);
  VC_3(f, e, d, c, b, a, 23, 26, blk32[14], VALIDUS_178);
  VC_3(e, d, c, b, a, f, 29, 28, blk32[12], VALIDUS_179);
  VC_3(d, c, b, a, f, e,  4,  5, blk32[11], VALIDUS_180);
  VC_3(c, b, a, f, e, d, 14, 13, blk32[ 9], VALIDUS_181);
  VC_3(b, a, f, e, d, c, 16, 17, blk32[ 7], VALIDUS_182);
  VC_3(a, f, e, d, c, b, 19, 22, blk32[10], VALIDUS_183);
  VC_3(f, e, d, c, b, a, 23, 26, blk32[ 8], VALIDUS_184);
  VC_3(e, d, c, b, a, f, 29, 28, blk32[ 6], VALIDUS_185);
  VC_3(d, c, b, a, f, e,  4,  5, blk32[ 5], VALIDUS_186);
  VC_3(c, b, a, f, e, d, 14, 13, blk32[ 3], VALIDUS_187);
  VC_3(b, a, f, e, d, c, 16, 17, blk32[ 1], VALIDUS_188);
  VC_3(a, f, e, d, c, b, 19, 22, blk32[ 4], VALIDUS_189);
  VC_3(f, e, d, c, b, a, 23, 26, blk32[ 2], VALIDUS_190);
  VC_3(e, d, c, b, a, f, 29, 28, blk32[ 0], VALIDUS_191);

  pstate->f0 += a;
  pstate->f1 += b;
  pstate->f2 += c;
  pstate->f3 += d;
  pstate->f4 += e;
  pstate->f5 += f;
}