*
* $Id$
*
* $Log$
* Revision 1.1  1996/02/15 17:54:58  mclareni
* Initial revision
*
*
#include "kerngent/pilot.h"
      SUBROUTINE TMBYT

#include "kerngent/mkcde.inc"


      JINIT (JZ) = 7*JZ + 5
      NBITM2 = IQBITW - 2

C-------           TEST   MSBIT0 - MSBIT1 - MSBIT

      CALL NEWGUY ('MSBIT0 - MSBIT1 - MSBIT.','TMBYT   ')

        DO 14  J=1,IQBITW

      JPREA = JINIT(J)
      JPREN = -JPREA

      IA(J+100) = MSBIT0 (JPREA,J)
      IA(J+200) = MSBIT0 (JPREN,J)
      IA(J+300) = MSBIT1 (JPREA,J)
      IA(J+400) = MSBIT1 (JPREN,J)
      IA(J+500) = MSBIT (J+1,JPREA,J)
      IA(J+600) = MSBIT (J+2,JPREN,J)

      IB(J+100) = JPREA
      IB(J+200) = JPREN
      IB(J+300) = JPREA
      IB(J+400) = JPREN
      IB(J+500) = JPREA
      IB(J+600) = JPREN

      CALL SBIT0 (IB(J+100),J)
      CALL SBIT0 (IB(J+200),J)

      CALL SBIT1 (IB(J+300),J)
      CALL SBIT1 (IB(J+400),J)

      CALL SBIT (J+1,IB(J+500),J)
      CALL SBIT (J+2,IB(J+600),J)
   14 CONTINUE

      CALL MVERII (1,IA(101),IB(101),IQBITW)
      CALL MVERII (2,IA(201),IB(201),IQBITW)
      CALL MVERII (3,IA(301),IB(301),IQBITW)
      CALL MVERII (4,IA(401),IB(401),IQBITW)
      CALL MVERII (5,IA(501),IB(501),IQBITW)
      CALL MVERII (6,IA(601),IB(601),IQBITW)

C-------           TEST   MSBYT - MCBYT

      CALL NEWGUY ('MSBYT - MCBYT.','TMBYT   ')

        DO 24  NBITS=1,NBITM2
      NDO = IQBITW + 1 - NBITS

        DO 23  J=1,NDO
      JPREA = JINIT(J)
      JPREN = -JPREA
      JVALA = J - 1
      JVALN = -JVALA

      IB(J+100) = JPREA
      IB(J+200) = JPREN
      IB(J+300) = JPREA
      IB(J+400) = JPREN
      IB(J+500) = JPREA
      IB(J+600) = JPREN
      IB(J+700) = JPREA
      IB(J+800) = JPREN

      CALL SBYT (JVALA,IB(J+100), J,NBITS)
      CALL SBYT (JVALA,IB(J+200), J,NBITS)
      CALL SBYT (JVALN,IB(J+300), J,NBITS)
      CALL SBYT (JVALN,IB(J+400), J,NBITS)

      CALL CBYT (IB(J+200),J, IB(J+500), J,NBITS)
      CALL CBYT (IB(J+100),J, IB(J+600), J,NBITS)
      CALL CBYT (IB(J+400),J, IB(J+700), J,NBITS)
      CALL CBYT (IB(J+300),J, IB(J+800), J,NBITS)

      IA(J+100) = MSBYT (JVALA,JPREA, J,NBITS)
      IA(J+200) = MSBYT (JVALA,JPREN, J,NBITS)
      IA(J+300) = MSBYT (JVALN,JPREA, J,NBITS)
      IA(J+400) = MSBYT (JVALN,JPREN, J,NBITS)

      IA(J+500) = MCBYT (IB(J+200),J, JPREA, J,NBITS)
      IA(J+600) = MCBYT (IB(J+100),J, JPREN, J,NBITS)
      IA(J+700) = MCBYT (IB(J+400),J, JPREA, J,NBITS)
      IA(J+800) = MCBYT (IB(J+300),J, JPREN, J,NBITS)
   23 CONTINUE

      CALL MVERII (10*NBITS+1,IA(101),IB(101),NDO)
      CALL MVERII (10*NBITS+2,IA(201),IB(201),NDO)
      CALL MVERII (10*NBITS+3,IA(301),IB(301),NDO)
      CALL MVERII (10*NBITS+4,IA(401),IB(401),NDO)
      CALL MVERII (10*NBITS+5,IA(501),IB(501),NDO)
      CALL MVERII (10*NBITS+6,IA(601),IB(601),NDO)
      CALL MVERII (10*NBITS+7,IA(701),IB(701),NDO)
      CALL MVERII (10*NBITS+8,IA(801),IB(801),NDO)
      CALL PRTEST
   24 CONTINUE

C-------           TEST   MBYTOR - MBYTET

      CALL NEWGUY ('MBYTOR - MBYTET.','TMBYT   ')

        DO 34  NBITS=1,NBITM2,3
      NDO = IQBITW + 1 - NBITS

        DO 33  J=1,NDO
      JPREA = JINIT(J)
      JPREN = -JPREA
      JVALA = J - 1
      JVALN = -JVALA

      IA(J+100) = MBYTOR (JVALA,JPREA, J,NBITS)
      IA(J+200) = MBYTOR (JVALA,JPREN, J,NBITS)
      IA(J+300) = MBYTOR (JVALN,JPREA, J,NBITS)
      IA(J+400) = MBYTOR (JVALN,JPREN, J,NBITS)

      IA(J+500) = MBYTET (JVALA,JPREA, J,NBITS)
      IA(J+600) = MBYTET (JVALA,JPREN, J,NBITS)
      IA(J+700) = MBYTET (JVALN,JPREA, J,NBITS)
      IA(J+800) = MBYTET (JVALN,JPREN, J,NBITS)

      IB(J+100) = JPREA
      IB(J+200) = JPREN
      IB(J+300) = JPREA
      IB(J+400) = JPREN
      IB(J+500) = JPREA
      IB(J+600) = JPREN
      IB(J+700) = JPREA
      IB(J+800) = JPREN

      CALL SBYTOR (JVALA,IB(J+100), J,NBITS)
      CALL SBYTOR (JVALA,IB(J+200), J,NBITS)
      CALL SBYTOR (JVALN,IB(J+300), J,NBITS)
      CALL SBYTOR (JVALN,IB(J+400), J,NBITS)

      CALL SBYT (JBYTET (JVALA,IB(J+500),J,NBITS), IB(J+500),J,NBITS)
      CALL SBYT (JBYTET (JVALA,IB(J+600),J,NBITS), IB(J+600),J,NBITS)
      CALL SBYT (JBYTET(JVALN,IB(J+700),J,NBITS), IB(J+700),J,NBITS)
      CALL SBYT (JBYTET(JVALN,IB(J+800),J,NBITS), IB(J+800),J,NBITS)
   33 CONTINUE

      CALL MVERII (10*NBITS+1,IA(101),IB(101),NDO)
      CALL MVERII (10*NBITS+2,IA(201),IB(201),NDO)
      CALL MVERII (10*NBITS+3,IA(301),IB(301),NDO)
      CALL MVERII (10*NBITS+4,IA(401),IB(401),NDO)
      CALL MVERII (10*NBITS+5,IA(501),IB(501),NDO)
      CALL MVERII (10*NBITS+6,IA(601),IB(601),NDO)
      CALL MVERII (10*NBITS+7,IA(701),IB(701),NDO)
      CALL MVERII (10*NBITS+8,IA(801),IB(801),NDO)
      CALL PRTEST
   34 CONTINUE

C--      TIMING

      IF (ITIMES.EQ.0)       RETURN
      NTIMES = ITIMES * 10000

      CALL TIMED (TIMERD)
         DO 61 JN=1,ITIMES
        DO 61 JM=1,400
        DO 61 JL=1,25
      IA(JL+JM) = MSBIT0 (JL,JL+4)
   61 CONTINUE
      CALL TIME77 (NTIMES,'MSBIT0',0,' ')

      CALL TIMED (TIMERD)
         DO 62 JN=1,ITIMES
        DO 62 JM=1,400
        DO 62 JL=1,25
      IA(JL+JM) = MSBIT1 (JL,JL+4)
   62 CONTINUE
      CALL TIME77 (NTIMES,'MSBIT1',0,' ')

      CALL TIMED (TIMERD)
         DO 63 JN=1,ITIMES
        DO 63 JM=1,400
        DO 63 JL=1,25
      IA(JL+JM) = MSBIT (JL+7,JL,JL+4)
   63 CONTINUE
      CALL TIME77 (NTIMES,'MSBIT ',0,' ')

      CALL TIMED (TIMERD)
         DO 64 JN=1,ITIMES
        DO 64 JM=1,400
        DO 64 JL=1,25
      IA(JL+JM) = MSBYT (JL,IA(JL+JM+1),JL+2,26-JL)
   64 CONTINUE
      CALL TIME77 (NTIMES,'MSBYT ',0,' ')

      CALL TIMED (TIMERD)
         DO 65 JN=1,ITIMES
        DO 65 JM=1,400
        DO 65 JL=1,25
      IA(JL+JM) = MCBYT (JL,JL+4,IA(JL+JM+1),JL+2,26-JL)
   65 CONTINUE
      CALL TIME77 (NTIMES,'MCBYT ',0,' ')

      CALL TIMED (TIMERD)
         DO 66 JN=1,ITIMES
        DO 66 JM=1,400
        DO 66 JL=1,25
      IA(JL+JM) = MBYTOR (JL,IA(JL+JM+1),JL+2,26-JL)
   66 CONTINUE
      CALL TIME77 (NTIMES,'MBYTOR',0,' ')

      CALL TIMED (TIMERD)
         DO 67 JN=1,ITIMES
        DO 67 JM=1,400
        DO 67 JL=1,25
      IA(JL+JM) = MBYTET (JL,IA(JL+JM+1),JL+2,26-JL)
   67 CONTINUE
      CALL TIME77 (NTIMES,'MBYTET',0,' ')
      RETURN
      END
