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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [or1ksim/] [testbench/] [mycompress.c] - Blame information for rev 1767

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 956 simons
 
261 1024 simons
    printf("main: bytes_out %d... hsize %d\n", (int)bytes_out, (int)hsize);
262 224 markom
 
263
    checkpoint = CHECK_GAP;
264
    maxcode = MAXCODE(n_bits = INIT_BITS);
265
    free_ent = ((block_compress) ? FIRST : 256 );
266
 
267
 
268
    ent = '\0'; /* getchar (); */
269
 
270
    hshift = 0;
271
    for ( fcode = (long) hsize;  fcode < 65536L; fcode *= 2L )
272
        hshift++;
273
    hshift = 8 - hshift;                /* set hash code range bound */
274 1024 simons
    printf("main: hshift %d...\n", hshift);
275 224 markom
 
276
    hsize_reg = hsize;
277
    cl_hash( (count_int) hsize_reg);            /* clear hash table */
278
 
279
/*#ifdef SIGNED_COMPARE_SLOW
280
    while ( (c = getchar()) != (unsigned) EOF ) {
281
#else
282
    while ( (c = getchar()) != EOF ) {
283
#endif*/
284 1024 simons
    printf("main: bytes_out %d...\n", (int)bytes_out);
285
    printf("main: hsize_reg %d...\n", (int)hsize_reg);
286
    printf("main: before compress %d...\n", (int)in_count);
287 224 markom
    while (in_count < BYTES_TO_COMPRESS) {
288
        c = in_count % 255;
289
 
290 1024 simons
        printf("main: compressing %d...\n", (int)in_count);
291 224 markom
        in_count++;
292
        fcode = (long) (((long) c << maxbits) + ent);
293
        i = (((long)c << hshift) ^ ent);        /* xor hashing */
294
 
295
        if ( htabof (i) == fcode ) {
296
            ent = codetabof (i);
297
            continue;
298
        } else if ( (long)htabof (i) < 0 )       /* empty slot */
299
            goto nomatch;
300
 
301
        disp = hsize_reg - i;           /* secondary hash (after G. Knott) */
302
        if ( i == 0 )
303
            disp = 1;
304
probe:
305
        if ( (i -= disp) < 0 )
306
            i += hsize_reg;
307
 
308
        if ( htabof (i) == fcode ) {
309
            ent = codetabof (i);
310
            continue;
311
        }
312
        if ( (long)htabof (i) > 0 )
313
            goto probe;
314
nomatch:
315
        output ( (code_int) ent );
316
        out_count++;
317
        ent = c;
318
#ifdef SIGNED_COMPARE_SLOW
319
        if ( (unsigned) free_ent < (unsigned) maxmaxcode) {
320
#else
321
        if ( free_ent < maxmaxcode ) {
322
#endif
323
            codetabof (i) = free_ent++; /* code -> hashtable */
324
            htabof (i) = fcode;
325
        }
326
        else if ( (count_int)in_count >= checkpoint && block_compress )
327
            cl_block ();
328
    }
329
    /*
330
     * Put out the final code.
331
     */
332 1024 simons
    printf("main: output...\n");
333 224 markom
    output( (code_int)ent );
334
    out_count++;
335
    output( (code_int)-1 );
336
 
337
    if(bytes_out > in_count)    /* exit(2) if no savings */
338
        exit_stat = 2;
339 1024 simons
    printf("main: end...\n");
340 224 markom
    report (0xdeaddead);
341
    return 0;
342
}
343
 
344
/*****************************************************************
345
 * TAG( output )
346
 *
347
 * Output the given code.
348
 * Inputs:
349
 *      code:   A n_bits-bit integer.  If == -1, then EOF.  This assumes
350
 *              that n_bits =< (long)wordsize - 1.
351
 * Outputs:
352
 *      Outputs code to the file.
353
 * Assumptions:
354
 *      Chars are 8 bits long.
355
 * Algorithm:
356
 *      Maintain a BITS character long buffer (so that 8 codes will
357
 * fit in it exactly).  Use the VAX insv instruction to insert each
358
 * code in turn.  When the buffer fills up empty it and start over.
359
 */
360
 
361
static char buf[BITS];
362
 
363
#ifndef vax
364
char_type lmask[9] = {0xff, 0xfe, 0xfc, 0xf8, 0xf0, 0xe0, 0xc0, 0x80, 0x00};
365
char_type rmask[9] = {0x00, 0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3f, 0x7f, 0xff};
366
#endif /* vax */
367
 
368
void output( code )
369
code_int  code;
370
{
371
 
372
    /*
373
     * On the VAX, it is important to have the register declarations
374
     * in exactly the order given, or the asm will break.
375
     */
376
    register int r_off = offset, bits= n_bits;
377
    register char * bp = buf;
378
 
379
    if ( code >= 0 ) {
380
#ifdef vax
381
        /* VAX DEPENDENT!! Implementation on other machines is below.
382
         *
383
         * Translation: Insert BITS bits from the argument starting at
384
         * offset bits from the beginning of buf.
385
         */
386
        0;       /* Work around for pcc -O bug with asm and if stmt */
387
        asm( "insv      4(ap),r11,r10,(r9)" );
388
#else /* not a vax */
389
/*
390
 * byte/bit numbering on the VAX is simulated by the following code
391
 */
392
        /*
393
         * Get to the first byte.
394
         */
395
        bp += (r_off >> 3);
396
        r_off &= 7;
397
        /*
398
         * Since code is always >= 8 bits, only need to mask the first
399
         * hunk on the left.
400
         */
401
        *bp = (*bp & rmask[r_off]) | ((code << r_off) & lmask[r_off]);
402
        bp++;
403
        bits -= (8 - r_off);
404
        code >>= 8 - r_off;
405
        /* Get any 8 bit parts in the middle (<=1 for up to 16 bits). */
406
        if ( bits >= 8 ) {
407
            *bp++ = code;
408
            code >>= 8;
409
            bits -= 8;
410
        }
411
        /* Last bits. */
412
        if(bits)
413
            *bp = code;
414
#endif /* vax */
415
        offset += n_bits;
416
        if ( offset == (n_bits << 3) ) {
417
            bp = buf;
418
            bits = n_bits;
419
            bytes_out += bits;
420
        /*    do
421
                putchar(*bp++); */
422
            while(--bits);
423
            offset = 0;
424
        }
425
 
426
        /*
427
         * If the next entry is going to be too big for the code size,
428
         * then increase it, if possible.
429
         */
430
        if ( free_ent > maxcode || (clear_flg > 0))
431
        {
432
            /*
433
             * Write the whole buffer, because the input side won't
434
             * discover the size increase until after it has read it.
435
             */
436
            if ( offset > 0 ) {
437
                /* if( fwrite( buf, 1, n_bits, stdout ) != n_bits)
438
                        writeerr(); */
439
                bytes_out += n_bits;
440
            }
441
            offset = 0;
442
 
443
            if ( clear_flg ) {
444
                maxcode = MAXCODE (n_bits = INIT_BITS);
445
                clear_flg = 0;
446
            }
447
            else {
448
                n_bits++;
449
                if ( n_bits == maxbits )
450
                    maxcode = maxmaxcode;
451
                else
452
                    maxcode = MAXCODE(n_bits);
453
            }
454
        }
455
    } else {
456
        /*
457
         * At EOF, write the rest of the buffer.
458
         */
459
        /* if ( offset > 0 )
460
            fwrite( buf, 1, (offset + 7) / 8, stdout ); */
461
        bytes_out += (offset + 7) / 8;
462
        offset = 0;
463
        /* fflush( stdout ); */
464
        /* if( ferror( stdout ) )
465
                writeerr(); */
466
    }
467
}
468
 
469
/*
470
 * Decompress stdin to stdout.  This routine adapts to the codes in the
471
 * file building the "string" table on-the-fly; requiring no table to
472
 * be stored in the compressed file.  The tables used herein are shared
473
 * with those of the compress() routine.  See the definitions above.
474
 */
475
 
476
void decompress() {
477
    register char_type *stackp;
478
    register int finchar;
479
    register code_int code, oldcode, incode;
480
 
481
    /*
482
     * As above, initialize the first 256 entries in the table.
483
     */
484
    maxcode = MAXCODE(n_bits = INIT_BITS);
485
    for ( code = 255; code >= 0; code-- ) {
486
        tab_prefixof(code) = 0;
487
        tab_suffixof(code) = (char_type)code;
488
    }
489
    free_ent = ((block_compress) ? FIRST : 256 );
490
 
491
    finchar = oldcode = getcode();
492
    if(oldcode == -1)   /* EOF already? */
493
        return;                 /* Get out of here */
494
 /*   putchar( (char)finchar ); */      /* first code must be 8 bits = char */
495
   /* if(ferror(stdout))
496
        writeerr(); */
497
    stackp = de_stack;
498
 
499
    while ( (code = getcode()) > -1 ) {
500
 
501
        if ( (code == CLEAR) && block_compress ) {
502
            for ( code = 255; code >= 0; code-- )
503
                tab_prefixof(code) = 0;
504
            clear_flg = 1;
505
            free_ent = FIRST - 1;
506
            if ( (code = getcode ()) == -1 )    /* O, untimely death! */
507
                break;
508
        }
509
        incode = code;
510
        /*
511
         * Special case for KwKwK string.
512
         */
513
        if ( code >= free_ent ) {
514
            *stackp++ = finchar;
515
            code = oldcode;
516
        }
517
 
518
        /*
519
         * Generate output characters in reverse order
520
         */
521
#ifdef SIGNED_COMPARE_SLOW
522
        while ( ((unsigned long)code) >= ((unsigned long)256) ) {
523
#else
524
        while ( code >= 256 ) {
525
#endif
526
            *stackp++ = tab_suffixof(code);
527
            code = tab_prefixof(code);
528
        }
529
        *stackp++ = finchar = tab_suffixof(code);
530
 
531
        /*
532
         * And put them out in forward order
533
         */
534
        /* do
535
            putchar ( *--stackp );
536
        while ( stackp > de_stack );*/
537
 
538
        /*
539
         * Generate the new entry.
540
         */
541
        if ( (code=free_ent) < maxmaxcode ) {
542
            tab_prefixof(code) = (unsigned short)oldcode;
543
            tab_suffixof(code) = finchar;
544
            free_ent = code+1;
545
        }
546
        /*
547
         * Remember previous code.
548
         */
549
        oldcode = incode;
550
    }
551
  /*  fflush( stdout ); */
552
   /* if(ferror(stdout))
553
        writeerr(); */
554
}
555
 
556
/*****************************************************************
557
 * TAG( getcode )
558
 *
559
 * Read one code from the standard input.  If EOF, return -1.
560
 * Inputs:
561
 *      stdin
562
 * Outputs:
563
 *      code or -1 is returned.
564
 */
565
 
566
code_int
567
getcode() {
568
    /*
569
     * On the VAX, it is important to have the register declarations
570
     * in exactly the order given, or the asm will break.
571
     */
572
    register code_int code;
573
    static int offset = 0, size = 0;
574
    static char_type buf[BITS];
575
    register int r_off, bits;
576
    register char_type *bp = buf;
577
 
578
    if ( clear_flg > 0 || offset >= size || free_ent > maxcode ) {
579
        /*
580
         * If the next entry will be too big for the current code
581
         * size, then we must increase the size.  This implies reading
582
         * a new buffer full, too.
583
         */
584
        if ( free_ent > maxcode ) {
585
            n_bits++;
586
            if ( n_bits == maxbits )
587
                maxcode = maxmaxcode;   /* won't get any bigger now */
588
            else
589
                maxcode = MAXCODE(n_bits);
590
        }
591
        if ( clear_flg > 0) {
592
            maxcode = MAXCODE (n_bits = INIT_BITS);
593
            clear_flg = 0;
594
        }
595
        /* size = fread( buf, 1, n_bits, stdin ); */
596
        if ( size <= 0 )
597
            return -1;                  /* end of file */
598
        offset = 0;
599
        /* Round size down to integral number of codes */
600
        size = (size << 3) - (n_bits - 1);
601
    }
602
    r_off = offset;
603
    bits = n_bits;
604
#ifdef vax
605
    asm( "extzv   r10,r9,(r8),r11" );
606
#else /* not a vax */
607
        /*
608
         * Get to the first byte.
609
         */
610
        bp += (r_off >> 3);
611
        r_off &= 7;
612
        /* Get first part (low order bits) */
613
#ifdef NO_UCHAR
614
        code = ((*bp++ >> r_off) & rmask[8 - r_off]) & 0xff;
615
#else
616
        code = (*bp++ >> r_off);
617
#endif /* NO_UCHAR */
618
        bits -= (8 - r_off);
619
        r_off = 8 - r_off;              /* now, offset into code word */
620
        /* Get any 8 bit parts in the middle (<=1 for up to 16 bits). */
621
        if ( bits >= 8 ) {
622
#ifdef NO_UCHAR
623
            code |= (*bp++ & 0xff) << r_off;
624
#else
625
            code |= *bp++ << r_off;
626
#endif /* NO_UCHAR */
627
            r_off += 8;
628
            bits -= 8;
629
        }
630
        /* high order bits. */
631
        code |= (*bp & rmask[bits]) << r_off;
632
#endif /* vax */
633
    offset += n_bits;
634
 
635
    return code;
636
}
637
 
638
char *
639
rindex(s, c)            /* For those who don't have it in libc.a */
640
register char *s, c;
641
{
642
        char *p;
643
        for (p = NULL; *s; s++)
644
            if (*s == c)
645
                p = s;
646
        return(p);
647
}
648
 
649
/*
650
writeerr()
651
{
652
    perror ( ofname );
653
    unlink ( ofname );
654
    exit ( 1 );
655
}
656
*/
657
void cl_block ()                /* table clear for block compress */
658
{
659
    register long int rat;
660
 
661
    checkpoint = in_count + CHECK_GAP;
662
 
663
    if(in_count > 0x007fffff) { /* shift will overflow */
664
        rat = bytes_out >> 8;
665
        if(rat == 0) {           /* Don't divide by zero */
666
            rat = 0x7fffffff;
667
        } else {
668
            rat = in_count / rat;
669
        }
670
    } else {
671
        rat = (in_count << 8) / bytes_out;      /* 8 fractional bits */
672
    }
673
    if ( rat > ratio ) {
674
        ratio = rat;
675
    } else {
676
        ratio = 0;
677
        cl_hash ( (count_int) hsize );
678
        free_ent = FIRST;
679
        clear_flg = 1;
680
        output ( (code_int) CLEAR );
681
    }
682
}
683
 
684
void cl_hash(hsize)             /* reset code table */
685
        register count_int hsize;
686
{
687
#ifndef XENIX_16        /* Normal machine */
688
        register count_int *htab_p = htab+hsize;
689
#else
690
        register j;
691
        register long k = hsize;
692
        register count_int *htab_p;
693
#endif
694
        register long i;
695
        register long m1 = -1;
696
 
697
#ifdef XENIX_16
698
    for(j=0; j<=8 && k>=0; j++,k-=8192) {
699
        i = 8192;
700
        if(k < 8192) {
701
                i = k;
702
        }
703
        htab_p = &(htab[j][i]);
704
        i -= 16;
705
        if(i > 0) {
706
#else
707
        i = hsize - 16;
708
#endif
709
        do {                            /* might use Sys V memset(3) here */
710
                *(htab_p-16) = m1;
711
                *(htab_p-15) = m1;
712
                *(htab_p-14) = m1;
713
                *(htab_p-13) = m1;
714
                *(htab_p-12) = m1;
715
                *(htab_p-11) = m1;
716
                *(htab_p-10) = m1;
717
                *(htab_p-9) = m1;
718
                *(htab_p-8) = m1;
719
                *(htab_p-7) = m1;
720
                *(htab_p-6) = m1;
721
                *(htab_p-5) = m1;
722
                *(htab_p-4) = m1;
723
                *(htab_p-3) = m1;
724
                *(htab_p-2) = m1;
725
                *(htab_p-1) = m1;
726
                htab_p -= 16;
727
        } while ((i -= 16) >= 0);
728
#ifdef XENIX_16
729
        }
730
    }
731
#endif
732
        for ( i += 16; i > 0; i-- )
733
                *--htab_p = m1;
734
}
735
 

powered by: WebSVN 2.1.0

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