OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [tags/] [nog_patch_47/] [or1ksim/] [testbench/] [mycompress.c] - Blame information for rev 224

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 224 markom
#include <stdarg.h>
2
#include "support.h"
3
 
4
#define BYTES_TO_COMPRESS 1000
5
 
6
/*
7
 * Compress - data compression program
8
 */
9
#define min(a,b)        ((a>b) ? b : a)
10
 
11
/*
12
 * machine variants which require cc -Dmachine:  pdp11, z8000, pcxt
13
 */
14
 
15
/*
16
 * Set USERMEM to the maximum amount of physical user memory available
17
 * in bytes.  USERMEM is used to determine the maximum BITS that can be used
18
 * for compression.
19
 *
20
 * SACREDMEM is the amount of physical memory saved for others; compress
21
 * will hog the rest.
22
 */
23
#ifndef SACREDMEM
24
#define SACREDMEM       0
25
#endif
26
 
27
/* #ifndef USERMEM */
28
#define USERMEM         60000   /* default user memory */
29
/* #endif */
30
 
31
#ifdef interdata                /* (Perkin-Elmer) */
32
#define SIGNED_COMPARE_SLOW     /* signed compare is slower than unsigned */
33
#endif
34
 
35
#ifdef USERMEM
36
# if USERMEM >= (433484+SACREDMEM)
37
#  define PBITS 16
38
# else
39
#  if USERMEM >= (229600+SACREDMEM)
40
#   define PBITS        15
41
#  else
42
#   if USERMEM >= (127536+SACREDMEM)
43
#    define PBITS       14
44
#   else
45
#    if USERMEM >= (73464+SACREDMEM)
46
#     define PBITS      13
47
#    else
48
#     define PBITS      12
49
#    endif
50
#   endif
51
#  endif
52
# endif
53
# undef USERMEM
54
#endif /* USERMEM */
55
 
56
#ifdef PBITS            /* Preferred BITS for this memory size */
57
# ifndef BITS
58
#  define BITS PBITS
59
# endif /* BITS */
60
#endif /* PBITS */
61
 
62
#if BITS == 16
63
# define HSIZE  69001           /* 95% occupancy */
64
#endif
65
#if BITS == 15
66
# define HSIZE  35023           /* 94% occupancy */
67
#endif
68
#if BITS == 14
69
# define HSIZE  18013           /* 91% occupancy */
70
#endif
71
#if BITS == 13
72
# define HSIZE  9001            /* 91% occupancy */
73
#endif
74
#if BITS <= 12
75
# define HSIZE  5003            /* 80% occupancy */
76
#endif
77
 
78
/*
79
 * a code_int must be able to hold 2**BITS values of type int, and also -1
80
 */
81
#if BITS > 15
82
typedef long int        code_int;
83
#else
84
typedef int             code_int;
85
#endif
86
 
87
#ifdef SIGNED_COMPARE_SLOW
88
typedef unsigned long int count_int;
89
typedef unsigned short int count_short;
90
#else
91
typedef long int          count_int;
92
#endif
93
 
94
#ifdef NO_UCHAR
95
 typedef char   char_type;
96
#else
97
 typedef        unsigned char   char_type;
98
#endif /* UCHAR */
99
char_type magic_header[] = { "\037\235" };      /* 1F 9D */
100
 
101
/* Defines for third byte of header */
102
#define BIT_MASK        0x1f
103
#define BLOCK_MASK      0x80
104
/* Masks 0x40 and 0x20 are free.  I think 0x20 should mean that there is
105
   a fourth header byte (for expansion).
106
*/
107
#define INIT_BITS 9                     /* initial number of bits/code */
108
 
109
/*
110
 * compress.c - File compression ala IEEE Computer, June 1984.
111
 *
112
 * Authors:     Spencer W. Thomas       (decvax!harpo!utah-cs!utah-gr!thomas)
113
 *              Jim McKie               (decvax!mcvax!jim)
114
 *              Steve Davies            (decvax!vax135!petsd!peora!srd)
115
 *              Ken Turkowski           (decvax!decwrl!turtlevax!ken)
116
 *              James A. Woods          (decvax!ihnp4!ames!jaw)
117
 *              Joe Orost               (decvax!vax135!petsd!joe)
118
 *
119
 */
120
 
121
#if i386
122
#include <stdio.h>
123
#include <stdio.h>
124
#include <ctype.h>
125
#include <signal.h>
126
#include <sys/types.h>
127
#include <sys/stat.h>
128
#endif
129
 
130
#define ARGVAL() (*++(*argv) || (--argc && *++argv))
131
 
132
int n_bits;                             /* number of bits/code */
133
int maxbits = BITS;                     /* user settable max # bits/code */
134
code_int maxcode;                       /* maximum code, given n_bits */
135
code_int maxmaxcode = 1L << BITS;       /* should NEVER generate this code */
136
#ifdef COMPATIBLE               /* But wrong! */
137
# define MAXCODE(n_bits)        (1L << (n_bits) - 1)
138
#else
139
# define MAXCODE(n_bits)        ((1L << (n_bits)) - 1)
140
#endif /* COMPATIBLE */
141
 
142
# ifdef sel
143
/* support gould base register problems */
144
/*NOBASE*/
145
count_int htab [HSIZE];
146
unsigned short codetab [HSIZE];
147
/*NOBASE*/
148
# else /* !gould */
149
count_int htab [HSIZE];
150
unsigned short codetab [HSIZE];
151
# endif /* !gould */
152
#define htabof(i)       htab[i]
153
#define codetabof(i)    codetab[i]
154
code_int hsize = HSIZE;                 /* for dynamic table sizing */
155
count_int fsize;
156
 
157
/*
158
 * To save much memory, we overlay the table used by compress() with those
159
 * used by decompress().  The tab_prefix table is the same size and type
160
 * as the codetab.  The tab_suffix table needs 2**BITS characters.  We
161
 * get this from the beginning of htab.  The output stack uses the rest
162
 * of htab, and contains characters.  There is plenty of room for any
163
 * possible stack (stack used to be 8000 characters).
164
 */
165
 
166
#define tab_prefixof(i) codetabof(i)
167
#ifdef XENIX_16
168
# define tab_suffixof(i)        ((char_type *)htab[(i)>>15])[(i) & 0x7fff]
169
# define de_stack               ((char_type *)(htab2))
170
#else   /* Normal machine */
171
# define tab_suffixof(i)        ((char_type *)(htab))[i]
172
# define de_stack               ((char_type *)&tab_suffixof(1<<BITS))
173
#endif  /* XENIX_16 */
174
 
175
code_int free_ent = 0;                   /* first unused entry */
176
int exit_stat = 0;
177
 
178
code_int getcode();
179
 
180
int nomagic = 0; /* Use a 3-byte magic number header, unless old file */
181
int zcat_flg = 0;        /* Write output on stdout, suppress messages */
182
int quiet = 1;          /* don't tell me about compression */
183
 
184
/*
185
 * block compression parameters -- after all codes are used up,
186
 * and compression rate changes, start over.
187
 */
188
int block_compress = BLOCK_MASK;
189
int clear_flg = 0;
190
long int ratio = 0;
191
#define CHECK_GAP 10000 /* ratio check interval */
192
count_int checkpoint = CHECK_GAP;
193
/*
194
 * the next two codes should not be changed lightly, as they must not
195
 * lie within the contiguous general code space.
196
 */
197
#define FIRST   257     /* first free entry */
198
#define CLEAR   256     /* table clear output code */
199
 
200
int force = 0;
201
char ofname [100];
202
int (*bgnd_flag)();
203
 
204
/* reset code table */
205
void cl_hash(register count_int hsize);
206
/* table clear for block compress */
207
void cl_block ();
208
void output(code_int  code);
209
 
210
 
211
int do_decomp = 0;
212
 
213
static int offset;
214
long int in_count = 1;                  /* length of input */
215
long int bytes_out;                     /* length of compressed output */
216
long int out_count = 0;                  /* # of codes output (for debugging) */
217
 
218
/*
219
 * compress stdin to stdout
220
 *
221
 * Algorithm:  use open addressing double hashing (no chaining) on the
222
 * prefix code / next character combination.  We do a variant of Knuth's
223
 * algorithm D (vol. 3, sec. 6.4) along with G. Knott's relatively-prime
224
 * secondary probe.  Here, the modular division first probe is gives way
225
 * to a faster exclusive-or manipulation.  Also do block compression with
226
 * an adaptive reset, whereby the code table is cleared when the compression
227
 * ratio decreases, but after the table fills.  The variable-length output
228
 * codes are re-sized at this point, and a special CLEAR code is generated
229
 * for the decompressor.  Late addition:  construct the table according to
230
 * file size for noticeable speed improvement on small files.  Please direct
231
 * questions about this implementation to ames!jaw.
232
 */
233
 
234
int main() {
235
    register long fcode;
236
    register code_int i = 0;
237
    register int c;
238
    register code_int ent;
239
#ifdef XENIX_16
240
    register code_int disp;
241
#else   /* Normal machine */
242
    register int disp;
243
#endif
244
    register code_int hsize_reg;
245
    register int hshift;
246
 
247
#ifndef COMPATIBLE
248
    if (nomagic == 0) {
249
        /* putchar(magic_header[0]); putchar(magic_header[1]);
250
        putchar((char)(maxbits | block_compress)); */
251
    }
252
#endif /* COMPATIBLE */
253
 
254
    offset = 0;
255
    bytes_out = 3;              /* includes 3-byte header mojo */
256
    out_count = 0;
257
    clear_flg = 0;
258
    ratio = 0;
259
    in_count = 1;
260
    printf("main: bytes_out %d... hsize %d\n", (int)bytes_out, (int)hsize);
261
 
262
    checkpoint = CHECK_GAP;
263
    maxcode = MAXCODE(n_bits = INIT_BITS);
264
    free_ent = ((block_compress) ? FIRST : 256 );
265
 
266
 
267
    ent = '\0'; /* getchar (); */
268
 
269
    hshift = 0;
270
    for ( fcode = (long) hsize;  fcode < 65536L; fcode *= 2L )
271
        hshift++;
272
    hshift = 8 - hshift;                /* set hash code range bound */
273
    printf("main: hshift %d...\n", hshift);
274
 
275
    hsize_reg = hsize;
276
    cl_hash( (count_int) hsize_reg);            /* clear hash table */
277
 
278
/*#ifdef SIGNED_COMPARE_SLOW
279
    while ( (c = getchar()) != (unsigned) EOF ) {
280
#else
281
    while ( (c = getchar()) != EOF ) {
282
#endif*/
283
    printf("main: bytes_out %d...\n", (int)bytes_out);
284
    printf("main: hsize_reg %d...\n", (int)hsize_reg);
285
    printf("main: before compress %d...\n", (int)in_count);
286
    while (in_count < BYTES_TO_COMPRESS) {
287
        c = in_count % 255;
288
 
289
        printf("main: compressing %d...\n", (int)in_count);
290
        in_count++;
291
        fcode = (long) (((long) c << maxbits) + ent);
292
        i = (((long)c << hshift) ^ ent);        /* xor hashing */
293
 
294
        if ( htabof (i) == fcode ) {
295
            ent = codetabof (i);
296
            continue;
297
        } else if ( (long)htabof (i) < 0 )       /* empty slot */
298
            goto nomatch;
299
 
300
        disp = hsize_reg - i;           /* secondary hash (after G. Knott) */
301
        if ( i == 0 )
302
            disp = 1;
303
probe:
304
        if ( (i -= disp) < 0 )
305
            i += hsize_reg;
306
 
307
        if ( htabof (i) == fcode ) {
308
            ent = codetabof (i);
309
            continue;
310
        }
311
        if ( (long)htabof (i) > 0 )
312
            goto probe;
313
nomatch:
314
        output ( (code_int) ent );
315
        out_count++;
316
        ent = c;
317
#ifdef SIGNED_COMPARE_SLOW
318
        if ( (unsigned) free_ent < (unsigned) maxmaxcode) {
319
#else
320
        if ( free_ent < maxmaxcode ) {
321
#endif
322
            codetabof (i) = free_ent++; /* code -> hashtable */
323
            htabof (i) = fcode;
324
        }
325
        else if ( (count_int)in_count >= checkpoint && block_compress )
326
            cl_block ();
327
    }
328
    /*
329
     * Put out the final code.
330
     */
331
    printf("main: output...\n");
332
    output( (code_int)ent );
333
    out_count++;
334
    output( (code_int)-1 );
335
 
336
    if(bytes_out > in_count)    /* exit(2) if no savings */
337
        exit_stat = 2;
338
    printf("main: end...\n");
339
    report (0xdeaddead);
340
    return 0;
341
}
342
 
343
/*****************************************************************
344
 * TAG( output )
345
 *
346
 * Output the given code.
347
 * Inputs:
348
 *      code:   A n_bits-bit integer.  If == -1, then EOF.  This assumes
349
 *              that n_bits =< (long)wordsize - 1.
350
 * Outputs:
351
 *      Outputs code to the file.
352
 * Assumptions:
353
 *      Chars are 8 bits long.
354
 * Algorithm:
355
 *      Maintain a BITS character long buffer (so that 8 codes will
356
 * fit in it exactly).  Use the VAX insv instruction to insert each
357
 * code in turn.  When the buffer fills up empty it and start over.
358
 */
359
 
360
static char buf[BITS];
361
 
362
#ifndef vax
363
char_type lmask[9] = {0xff, 0xfe, 0xfc, 0xf8, 0xf0, 0xe0, 0xc0, 0x80, 0x00};
364
char_type rmask[9] = {0x00, 0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3f, 0x7f, 0xff};
365
#endif /* vax */
366
 
367
void output( code )
368
code_int  code;
369
{
370
 
371
    /*
372
     * On the VAX, it is important to have the register declarations
373
     * in exactly the order given, or the asm will break.
374
     */
375
    register int r_off = offset, bits= n_bits;
376
    register char * bp = buf;
377
 
378
    if ( code >= 0 ) {
379
#ifdef vax
380
        /* VAX DEPENDENT!! Implementation on other machines is below.
381
         *
382
         * Translation: Insert BITS bits from the argument starting at
383
         * offset bits from the beginning of buf.
384
         */
385
        0;       /* Work around for pcc -O bug with asm and if stmt */
386
        asm( "insv      4(ap),r11,r10,(r9)" );
387
#else /* not a vax */
388
/*
389
 * byte/bit numbering on the VAX is simulated by the following code
390
 */
391
        /*
392
         * Get to the first byte.
393
         */
394
        bp += (r_off >> 3);
395
        r_off &= 7;
396
        /*
397
         * Since code is always >= 8 bits, only need to mask the first
398
         * hunk on the left.
399
         */
400
        *bp = (*bp & rmask[r_off]) | ((code << r_off) & lmask[r_off]);
401
        bp++;
402
        bits -= (8 - r_off);
403
        code >>= 8 - r_off;
404
        /* Get any 8 bit parts in the middle (<=1 for up to 16 bits). */
405
        if ( bits >= 8 ) {
406
            *bp++ = code;
407
            code >>= 8;
408
            bits -= 8;
409
        }
410
        /* Last bits. */
411
        if(bits)
412
            *bp = code;
413
#endif /* vax */
414
        offset += n_bits;
415
        if ( offset == (n_bits << 3) ) {
416
            bp = buf;
417
            bits = n_bits;
418
            bytes_out += bits;
419
        /*    do
420
                putchar(*bp++); */
421
            while(--bits);
422
            offset = 0;
423
        }
424
 
425
        /*
426
         * If the next entry is going to be too big for the code size,
427
         * then increase it, if possible.
428
         */
429
        if ( free_ent > maxcode || (clear_flg > 0))
430
        {
431
            /*
432
             * Write the whole buffer, because the input side won't
433
             * discover the size increase until after it has read it.
434
             */
435
            if ( offset > 0 ) {
436
                /* if( fwrite( buf, 1, n_bits, stdout ) != n_bits)
437
                        writeerr(); */
438
                bytes_out += n_bits;
439
            }
440
            offset = 0;
441
 
442
            if ( clear_flg ) {
443
                maxcode = MAXCODE (n_bits = INIT_BITS);
444
                clear_flg = 0;
445
            }
446
            else {
447
                n_bits++;
448
                if ( n_bits == maxbits )
449
                    maxcode = maxmaxcode;
450
                else
451
                    maxcode = MAXCODE(n_bits);
452
            }
453
        }
454
    } else {
455
        /*
456
         * At EOF, write the rest of the buffer.
457
         */
458
        /* if ( offset > 0 )
459
            fwrite( buf, 1, (offset + 7) / 8, stdout ); */
460
        bytes_out += (offset + 7) / 8;
461
        offset = 0;
462
        /* fflush( stdout ); */
463
        /* if( ferror( stdout ) )
464
                writeerr(); */
465
    }
466
}
467
 
468
/*
469
 * Decompress stdin to stdout.  This routine adapts to the codes in the
470
 * file building the "string" table on-the-fly; requiring no table to
471
 * be stored in the compressed file.  The tables used herein are shared
472
 * with those of the compress() routine.  See the definitions above.
473
 */
474
 
475
void decompress() {
476
    register char_type *stackp;
477
    register int finchar;
478
    register code_int code, oldcode, incode;
479
 
480
    /*
481
     * As above, initialize the first 256 entries in the table.
482
     */
483
    maxcode = MAXCODE(n_bits = INIT_BITS);
484
    for ( code = 255; code >= 0; code-- ) {
485
        tab_prefixof(code) = 0;
486
        tab_suffixof(code) = (char_type)code;
487
    }
488
    free_ent = ((block_compress) ? FIRST : 256 );
489
 
490
    finchar = oldcode = getcode();
491
    if(oldcode == -1)   /* EOF already? */
492
        return;                 /* Get out of here */
493
 /*   putchar( (char)finchar ); */      /* first code must be 8 bits = char */
494
   /* if(ferror(stdout))
495
        writeerr(); */
496
    stackp = de_stack;
497
 
498
    while ( (code = getcode()) > -1 ) {
499
 
500
        if ( (code == CLEAR) && block_compress ) {
501
            for ( code = 255; code >= 0; code-- )
502
                tab_prefixof(code) = 0;
503
            clear_flg = 1;
504
            free_ent = FIRST - 1;
505
            if ( (code = getcode ()) == -1 )    /* O, untimely death! */
506
                break;
507
        }
508
        incode = code;
509
        /*
510
         * Special case for KwKwK string.
511
         */
512
        if ( code >= free_ent ) {
513
            *stackp++ = finchar;
514
            code = oldcode;
515
        }
516
 
517
        /*
518
         * Generate output characters in reverse order
519
         */
520
#ifdef SIGNED_COMPARE_SLOW
521
        while ( ((unsigned long)code) >= ((unsigned long)256) ) {
522
#else
523
        while ( code >= 256 ) {
524
#endif
525
            *stackp++ = tab_suffixof(code);
526
            code = tab_prefixof(code);
527
        }
528
        *stackp++ = finchar = tab_suffixof(code);
529
 
530
        /*
531
         * And put them out in forward order
532
         */
533
        /* do
534
            putchar ( *--stackp );
535
        while ( stackp > de_stack );*/
536
 
537
        /*
538
         * Generate the new entry.
539
         */
540
        if ( (code=free_ent) < maxmaxcode ) {
541
            tab_prefixof(code) = (unsigned short)oldcode;
542
            tab_suffixof(code) = finchar;
543
            free_ent = code+1;
544
        }
545
        /*
546
         * Remember previous code.
547
         */
548
        oldcode = incode;
549
    }
550
  /*  fflush( stdout ); */
551
   /* if(ferror(stdout))
552
        writeerr(); */
553
}
554
 
555
/*****************************************************************
556
 * TAG( getcode )
557
 *
558
 * Read one code from the standard input.  If EOF, return -1.
559
 * Inputs:
560
 *      stdin
561
 * Outputs:
562
 *      code or -1 is returned.
563
 */
564
 
565
code_int
566
getcode() {
567
    /*
568
     * On the VAX, it is important to have the register declarations
569
     * in exactly the order given, or the asm will break.
570
     */
571
    register code_int code;
572
    static int offset = 0, size = 0;
573
    static char_type buf[BITS];
574
    register int r_off, bits;
575
    register char_type *bp = buf;
576
 
577
    if ( clear_flg > 0 || offset >= size || free_ent > maxcode ) {
578
        /*
579
         * If the next entry will be too big for the current code
580
         * size, then we must increase the size.  This implies reading
581
         * a new buffer full, too.
582
         */
583
        if ( free_ent > maxcode ) {
584
            n_bits++;
585
            if ( n_bits == maxbits )
586
                maxcode = maxmaxcode;   /* won't get any bigger now */
587
            else
588
                maxcode = MAXCODE(n_bits);
589
        }
590
        if ( clear_flg > 0) {
591
            maxcode = MAXCODE (n_bits = INIT_BITS);
592
            clear_flg = 0;
593
        }
594
        /* size = fread( buf, 1, n_bits, stdin ); */
595
        if ( size <= 0 )
596
            return -1;                  /* end of file */
597
        offset = 0;
598
        /* Round size down to integral number of codes */
599
        size = (size << 3) - (n_bits - 1);
600
    }
601
    r_off = offset;
602
    bits = n_bits;
603
#ifdef vax
604
    asm( "extzv   r10,r9,(r8),r11" );
605
#else /* not a vax */
606
        /*
607
         * Get to the first byte.
608
         */
609
        bp += (r_off >> 3);
610
        r_off &= 7;
611
        /* Get first part (low order bits) */
612
#ifdef NO_UCHAR
613
        code = ((*bp++ >> r_off) & rmask[8 - r_off]) & 0xff;
614
#else
615
        code = (*bp++ >> r_off);
616
#endif /* NO_UCHAR */
617
        bits -= (8 - r_off);
618
        r_off = 8 - r_off;              /* now, offset into code word */
619
        /* Get any 8 bit parts in the middle (<=1 for up to 16 bits). */
620
        if ( bits >= 8 ) {
621
#ifdef NO_UCHAR
622
            code |= (*bp++ & 0xff) << r_off;
623
#else
624
            code |= *bp++ << r_off;
625
#endif /* NO_UCHAR */
626
            r_off += 8;
627
            bits -= 8;
628
        }
629
        /* high order bits. */
630
        code |= (*bp & rmask[bits]) << r_off;
631
#endif /* vax */
632
    offset += n_bits;
633
 
634
    return code;
635
}
636
 
637
char *
638
rindex(s, c)            /* For those who don't have it in libc.a */
639
register char *s, c;
640
{
641
        char *p;
642
        for (p = NULL; *s; s++)
643
            if (*s == c)
644
                p = s;
645
        return(p);
646
}
647
 
648
/*
649
writeerr()
650
{
651
    perror ( ofname );
652
    unlink ( ofname );
653
    exit ( 1 );
654
}
655
*/
656
void cl_block ()                /* table clear for block compress */
657
{
658
    register long int rat;
659
 
660
    checkpoint = in_count + CHECK_GAP;
661
 
662
    if(in_count > 0x007fffff) { /* shift will overflow */
663
        rat = bytes_out >> 8;
664
        if(rat == 0) {           /* Don't divide by zero */
665
            rat = 0x7fffffff;
666
        } else {
667
            rat = in_count / rat;
668
        }
669
    } else {
670
        rat = (in_count << 8) / bytes_out;      /* 8 fractional bits */
671
    }
672
    if ( rat > ratio ) {
673
        ratio = rat;
674
    } else {
675
        ratio = 0;
676
        cl_hash ( (count_int) hsize );
677
        free_ent = FIRST;
678
        clear_flg = 1;
679
        output ( (code_int) CLEAR );
680
    }
681
}
682
 
683
void cl_hash(hsize)             /* reset code table */
684
        register count_int hsize;
685
{
686
#ifndef XENIX_16        /* Normal machine */
687
        register count_int *htab_p = htab+hsize;
688
#else
689
        register j;
690
        register long k = hsize;
691
        register count_int *htab_p;
692
#endif
693
        register long i;
694
        register long m1 = -1;
695
 
696
#ifdef XENIX_16
697
    for(j=0; j<=8 && k>=0; j++,k-=8192) {
698
        i = 8192;
699
        if(k < 8192) {
700
                i = k;
701
        }
702
        htab_p = &(htab[j][i]);
703
        i -= 16;
704
        if(i > 0) {
705
#else
706
        i = hsize - 16;
707
#endif
708
        do {                            /* might use Sys V memset(3) here */
709
                *(htab_p-16) = m1;
710
                *(htab_p-15) = m1;
711
                *(htab_p-14) = m1;
712
                *(htab_p-13) = m1;
713
                *(htab_p-12) = m1;
714
                *(htab_p-11) = m1;
715
                *(htab_p-10) = m1;
716
                *(htab_p-9) = m1;
717
                *(htab_p-8) = m1;
718
                *(htab_p-7) = m1;
719
                *(htab_p-6) = m1;
720
                *(htab_p-5) = m1;
721
                *(htab_p-4) = m1;
722
                *(htab_p-3) = m1;
723
                *(htab_p-2) = m1;
724
                *(htab_p-1) = m1;
725
                htab_p -= 16;
726
        } while ((i -= 16) >= 0);
727
#ifdef XENIX_16
728
        }
729
    }
730
#endif
731
        for ( i += 16; i > 0; i-- )
732
                *--htab_p = m1;
733
}
734
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.