aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/rs6000/ops-to-gp
blob: becb406749bcb35dce5cd0202712b643711c74ea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
#!/bin/sh
# APPLE LOCAL file AltiVec
# ops-to-gp -gcc vec.ops builtin.ops
# Creates vec.h used by rs6000.c

arg0=`basename $0`
err() {
    echo "$arg0: $*" 1>&2
    exit 2
}

if [ $# -eq 0 ] ; then
    echo "Usage: $arg0 [ -mcc | -gcc ] builtin-ops ..." 1>&2
    exit 1
fi

MCC=1
GCC=0
suffix="gp"
if [ "$1" = "-mcc" ] ; then
    shift;
elif [ "$1" = "-gcc" ] ; then
    GCC=1
    MCC=0
    suffix="h"
    shift;
fi

output=`basename $1 .ops`
gperf="gperf -G -a -o -k1-15 -p -t -D -T -N Is_Builtin_Function $output.gp";

# Lines in the ops file have the form
# @ @ betype betype-code type-spelling
# @ fetype betype [code]
# @ @ @ instruction type
# generic op1 op2 ... opn = result specific when configure [addressible
#    [instruction [const_ptr_ok [volatile_ptr_ok [transform [predicate]]]]]]

# Sort the ops file to put it in a canonical order.
sort -u $* | \

# Add specific function uid's, make generic functions from specific
# functions, validate the types used, compute default parameters, and
# compute parts of the default transform and predicate functions.
awk 'BEGIN {
	i = 0
        EQ = i++
        RESULT = i++
        SPECIFIC = i++
        WHEN = i++
        CONFIGURED = i++
        ADDRESSIBLE = i++
        INSTRUCTION = i++
        CONST_PTR_OK = i++
        VOLATILE_PTR_OK = i++
        TRANSFORM = i++
        PREDICATE = i++
        n_lines = 1;
        tree[3] = "Make_Folded_4tree";
        tree[2] = "Make_Folded_3tree";
        tree[1] = "Make_Folded_Btree";
        tree[0] = "Make_Utree";
	optimize["vec_sub"] = 1;
	optimize["vec_subs"] = 1;
	optimize["vec_xor"] = 1;
	optimize["vec_andc"] = 1;
	optimize["vec_avg"] = 2;
	optimize["vec_or"] = 2;
	optimize["vec_and"] = 2;
	optimize["vec_max"] = 2;
	optimize["vec_min"] = 2;
	optimize["vec_sld"] = 3;
	optimize["vec_splat_s8"] = 4;
	optimize["vec_splat_s16"] = 5;
	optimize["vec_splat_s32"] = 6;
	optimize["vec_splat_u8"] = 4;
	optimize["vec_splat_u16"] = 5;
	optimize["vec_splat_u32"] = 6;
	optimize["vec_cmpeq"] = 7;
	optimize["vec_lvsl"] = 8;
	optimize["vec_lvsr"] = 9;
	# These operations need additional transformation.  Key off the
	# optimize attribute to identify them.
	optimize["vec_cmplt"] = 10;
	optimize["vec_cmple"] = 10;
	optimize["vec_abs"] = 11;
	optimize["vec_abss"] = 11;
    }
    function no_type(t) {
        printf "%% Error: type %s not declared.\n", t;
        status = 1;
        exit;
    }
    # Record the type.
    $1 == "@" {
        if ($2 == "@") {
          if ($3 == "@") {
            # Definition of an instruction.
            insn_type[$4] = $5; # type
          } else {
            # Definition of a betype.
            becode[$3] = $4; # betype-code
            bespell[$3] = $5; # type-spelling
            gsub(/\=/, " ", bespell[$3]);
          }
        } else {
          # Definition of a fetype.
          print $0;
          if (!becode[$3]) no_type($3); # Must have defined the betype.
          betype[$2] = $3; # betype;
          if (NF == 3)
            code[$2] = "";      
          else
            code[$2] = $4; # code
        }
    }
    function no_equal(i,l) {
        printf "%% Syntax error %d: %s\n", i, l;
        status = 1;
        exit;
    }
    function error(f,a) {
        printf( ("%% error: " f), a);
        status = 1;
        exit;
    }
    # Ignore comment lines.
    $1 != "#" && $1 != "@" {
        # Generate the signature of the specific function, the predicate,
        # the transform, the arguments to the transform function, the
        # arguments to the predicate function, and the spelling of the
        # function type.
        signature = "";
        predicate = "";
        transform = "";
        insn_code = "";
        transform_args = "";
        predicate_args = "";
        function_type = "";
        # First, consider the parameter types.
        for (i = 2; $i != "=" && i < NF; i++) {
          if ($i != "...") {
            if (!betype[$i]) no_type($i);
            signature = (signature " " $i);
            predicate = (predicate "_" betype[$i]);
            transform = (transform code[$i]);
            transform_args = (transform_args ", ND_kid(t," i-1 ")");
            predicate_args = (predicate_args " " becode[betype[$i]]);
            if (function_type)
              function_type = (function_type ", " bespell[betype[$i]]);
            else
              function_type = bespell[betype[$i]];
          }
        }
	constraints = (transform "@");
        # Check the syntax of the ops file.
        if ($i != "=" || NF > i+PREDICATE || NF < i+CONFIGURE) no_equal(i,$0);
        if (!betype[$(i+RESULT)]) no_type($(i+RESULT));
        # Incorporate the result type.
        if (i == 2) {
          predicate = "_void";
          function_type = "void";
        }
        signature = ($(i+SPECIFIC) signature);
        predicate = sprintf("is_%s_func%s", betype[$(i+RESULT)], predicate);
        predicate_args = (becode[betype[$(i+RESULT)]] predicate_args);
        function_type = sprintf("(%s (*)(%s))", bespell[betype[$(i+RESULT)]], \
                                function_type);
        if (substr(code[$(i+RESULT)], 1, 1) == "j") {
          # Handle a jump asm.  The code is expedted to be
          # j={cc-bit-num}={cc-bit-value}[={r|d}].  The operation must have
          # one operand if the code d is used and two operands otherwise.
          # The transform function can implement the r code by reversing the
          # two operands.  In all cases, the first operand is a computed
          # constant encoding both the bit number and the test.
          n = split(code[$(i+RESULT)], jmp, "=");
          if (jmp[n] == "d" && i != 3) error("%d operands", i-2);
          if (jmp[n] != "d" && i != 4) error("%d operands", i-2);
          if (jmp[n] == "r")
            transform_args = ", ND_kid(t,2), ND_kid(t,1)";
          transform_args = sprintf("%s(OP_VCMP%s%s", tree[i-2], \
                                   toupper(jmp[3]), transform_args);
          if (jmp[n] == "r")
            transform = ("r" transform);
          insn_code = sprintf("CODE_FOR_j_%d_%s_f%s", jmp[2], jmp[3], \
                              transform);
          transform = sprintf("transform_j_%d_%s_f%s", jmp[2], jmp[3], \
                              transform);
        } else {
          transform_args = sprintf("%s(OP_%sASM%s%s", tree[i-2], \
                                   toupper(code[$(i+RESULT)]), \
				   toupper(transform), transform_args);
          insn_code = sprintf("CODE_FOR_%sf%s", code[$(i+RESULT)], transform);
          transform = sprintf("transform_%sf%s", code[$(i+RESULT)], transform);
        }       
        # Give a unique id to the signature
        if (count[signature] == 0)
          count[signature] = ++uid[$(i+SPECIFIC)];

        # Compute the default instruction name
        nf = split($(i+SPECIFIC), part, "_");
        instruction = ("MOP_" part[nf]);

	# Compute the insn_code, but use the instruction override if given.
        if (NF >= i+INSTRUCTION)
          instruction = $(i+INSTRUCTION);
        if (insn_type[instruction])
          insn_code = (insn_code "_" insn_type[instruction]);

        # Allow the user to override the addressibility, instruction,
        # const_ptr_ok, volatile_ptr_ok, transform, and predicate.
        if (NF >= i+ADDRESSIBLE)
          addressible = "";
        else
          addressible = "FALSE";

        if (NF >= i+INSTRUCTION)
          instruction = "";
        else if (substr($1, 1, 4) == "vec_")
          print "@ @3", instruction;

        if (NF >= i+CONST_PTR_OK)
          const_ptr_ok = "";
        else
          const_ptr_ok = "FALSE";

        if (NF >= i+VOLATILE_PTR_OK)
          volatile_ptr_ok = "";
        else
          volatile_ptr_ok = "FALSE";

        if (NF >= i+TRANSFORM)
          transform = "";
        else
          print "@ @1", transform, transform_args;

        if (NF >= i+PREDICATE)
          predicate = "";
        else
          print "@ @2", i-2, predicate, predicate_args, function_type;

	if (optimize[$1])
	  optimize_method = optimize[$1];
	else
	  optimize_method = "0";

        # Record the line, addressibility, instruction, transform,
        # predicate, and unique id.
        line[n_lines++] = ($0 " " addressible " " instruction " " \
                           const_ptr_ok " " volatile_ptr_ok " " transform " " \
                           predicate " " insn_code " " constraints " " \
			   optimize_method " " count[signature]);
    }
    END {
        if (status) exit;
        # generic op1 op2 ... opn = result specific when configured
        #         addressable instruction const_ptr_ok volatile_ptr_ok
        #         transform predicate insn_code constraints optimize uid
        SPECIFIC = 12
        for (i = 1; i < n_lines; i++) {
          nf = split(line[i], part);
          specific = part[nf-SPECIFIC];

          # Print the generic form.
          printf "%s", part[1];
          for (j = 2; j <= nf-SPECIFIC; j++) printf " %s", part[j];
          if (uid[specific] > 1) printf ":%d", part[nf];
          while (j < nf) printf " %s", part[j++];
          printf "\n";

          # Print the specific form.
          printf "%s", specific;
          for (j = 2; j <= nf-SPECIFIC; j++) printf " %s", part[j];
          if (uid[specific] > 1) printf ":%d", part[nf];
          while (j < nf) printf " %s", part[j++];
          printf "\n";
        }
    }' | \

# Strip out load and store qualifiers.
sed -e 's/_load_op//g' -e 's/_store_op//g' | \

# Sort the processed file and eliminate duplicates.
sort -u | \

# Append the count of each generic function to each line.
awk 'function push() {
        if (num)
          for (i = 0; i < num; i++)
            print line[i], num;
        num = 0;
    }
    $1 == "@" {
        print $0;
    }
    $1 != "@" {
        if (last != $1)
          push();
        last = $1;
        line[num++] = $0;
    }
    END {
        push();
    }' | \

# Now compute the gperf input file.
# Lines now have a fixed format
# generic op1 ... opn = result specific instruction when configured
#         addressible const_ptr_ok volatile_ptr_ok transform predicate
#         insn_code constraints optimize count
awk 'BEGIN {
	MCC = '$MCC'
	GCC = '$GCC'
        i = 0;
        COUNT = i++
	OPTIMIZE = i++
	CONSTRAINTS = i++
        INSN_CODE = i++
        PREDICATE = i++
        TRANSFORM = i++
        VOLATILE_PTR_OK = i++
        CONST_PTR_OK = i++
        INSTRUCTION = i++
        ADDRESSIBLE = i++
        CONFIGURED = i++
        WHEN = i++
        SPECIFIC = i++
        RESULT = i++
        EQ = i++
        OPN = i++
        NARGS = i++
	if (MCC) {
          print "%{";
          print "/* Command-line: '"$gperf"'  */";
	  MAXARGS = 5
	}
	if (GCC)
	  MAXARGS = 3
    }
    function write_test(tree, type, num) {
        if (type == "PTR") {
          printf "\n      && TY_kind(%s) == KIND_POINTER", tree;
        } else if (type == "I5") {
          printf "\n      && is_integer_type(%s)", tree;
          printf "\n      && Is_Const(ND_kid0(ND_kid(t,%d)), &tc)", num;
          printf "\n      && ((UINT32)Targ_To_Host(tc) + 16) < 32";
        } else if (type == "U5") {
          printf "\n      && is_integer_type(%s)", tree;
          printf "\n      && Is_Const(ND_kid0(ND_kid(t,%d)), &tc)", num;
          printf "\n      && (UINT32)Targ_To_Host(tc) < 32";
        } else if (type == "U4") {
          printf "\n      && is_integer_type(%s)", tree;
          printf "\n      && Is_Const(ND_kid0(ND_kid(t,%d)), &tc)", num;
          printf "\n      && (UINT32)Targ_To_Host(tc) < 16";
        } else if (type == "U2") {
          printf "\n      && is_integer_type(%s)", tree;
          printf "\n      && Is_Const(ND_kid0(ND_kid(t,%d)), &tc)", num;
          printf "\n      && (UINT32)Targ_To_Host(tc) < 4";
        } else if (type == "BETYPE_U4" || type == "BETYPE_I4") {
          printf "\n      && is_integer_type(%s)", tree;
        } else {
          printf "\n      && Similar_Types(%s,", tree;
          printf "\n\t\t       Be_Type_Tbl(%s), IGNORE_QUALIFIERS)", type;
        }
    }
    $1 == "@" {
      if (MCC) {
        if ($2 == "@1") {
          # Write the predicate function from the given parameters.
          # The format is:
          # @ @1 transform_ifii Make_3tree(OP_IASMII, ND_kid(t,1), ND_kid(t,2)
          print "";
          print "/*ARGSUSED*/";
          print "static void";
          print $3 "(ND *func, ND *parent, ND *t, struct builtin *self)";
          print "{";
          printf "  *t = *%s", $4;
          for (i = 5; i <= NF; i++) printf " %s", $i;
          print ",";
          if (split($3,jmp,"_") == 5 && jmp[2] == "j")
            printf "\t\t   MK_I4CONST_ND((self->data << 5) + %d));\n", \
                   jmp[3];
          else
            print "\t\t   MK_I4CONST_ND(self->data));";

          print "  Is_True(self->data > 0, (\"No implementation for %s\", self->name));";
          print "}";
        } else if ($2 == "@2") {
          # Write the transform function from the given parameters.
          # The format is:
          # @ @2 2 is_int_func_int_int BETYPE_I4 BETYPE_I4 BETYPE_I4 
          #          (int (*)(int, int))
          print "";
          print "/*ARGSUSED*/";
          print "static BOOL";
          print $4 "(ND *func, ND *parent, ND *t, struct builtin *self)";
          print "{";
          print "  TCON tc;";
          printf "  if (ND_nkids(t) == %d", $3+1;
          write_test("ST_type(ND_dec(func))", $5, "");
          for (i = 1; i <= $3; i++) {
            printf "\n      && ND_name(ND_kid(t,%d)) == TO_VAL", i;
            write_test(sprintf("The_Tree_Type(ND_kid(t,%d))", i), $(i+5), i);
          }       
          print ")";
          print "    return TRUE;";
          print "  Error_Prt_Line (ND_linenum(t), ec_builtin_function_type, self->name,";
          i = $3+6;
          printf "\t\t  \"%s", $i;
          while (++i <= NF) printf " %s", $i;
          print "\");";
          print "  return FALSE;";
          print "}";
        } else if ($2 == "@3") {
          if (once++ == 0) printf "\n#ifndef HAVE_ALTIVEC\n";
          printf "#define %s -1\n", $3;
        } else {
          if (once && twice++ == 0) printf "#endif /* HAVE_ALTIVEC */\n\n";
          printf "extern struct a_type *T_%s;\n", $2;
        }
      }
      next;
    }
    $1 == "%" {
        print $0;
        status = 1;
        exit;
    }
    {
        # Compute the signature of the generic function.
        signature=$1;
        for (i = 2; i <= NF-OPN; i++) {
          if ($i != "...")
            signature=(signature " " $i);
        }

        # Ensure that the signature is unique.
        if (signature_line[signature]) {
          print "Ambiguous signatures:";
          print $0;
          print line[signature_line[signature]];
        }
        signature_line[signature] = n_lines;

        # Require that overloaded functions have the same attributes:
        # number of arguments, when, configured, and addressible.
        if (same_arg_count[$1] && same_arg_count[$1] != NF)
          printf "%% number of arguments for %s varies: %d and %d\n", \
                 $1, NF-NARGS, same_arg_count[$1]-NARGS;
        same_arg_count[$1] = NF;

        if (same_when[$1] && same_when[$1] != $(NF-WHEN))
          printf "%% when for %s varies: %s and %s\n", \
                 $1, $(NF-WHEN), same_when[$1];
        same_when[$1] = $(NF-WHEN);

        if (same_configured[$1] && same_configured[$1] != $(NF-CONFIGURED))
          printf "%% configured for %s varies: %s and %s\n", \
                 $1, $(NF-CONFIGURED), same_configured[$1];
        same_configured[$1] = $(NF-CONFIGURED);

        if (same_addressible[$1] && same_addressible[$1] != $(NF-ADDRESSIBLE))
          printf "%% addressible for %s varies: %s and %s\n", \
                 $1, $(NF-ADDRESSIBLE), same_addressible[$1];
        else if (same_addressible[$1] && same_addressible[$1] != "FALSE")
          printf "%% Overloaded function %s is addressible\n", $1
        same_addressible[$1] = $(NF-ADDRESSIBLE);

        # Record the line.
        line[n_lines++] = $0;
    }
    function push(fcn, n) {
        if (last) printf "};\n";
        # Gcc3: declare as arrays of const pointers
        if (fcn) printf "static const struct builtin *const O_%s[%d] = {\n", fcn, n;
        last = fcn;
    }
    function mangle(name) {
        if (split(name, names, ":") == 1)
          return ("B_" names[1]);
        return ("B" names[2] "_" names[1]);
    }
    END { 
        if (status) exit;
        
        # Gcc3: Mark file as Apple local
        printf "/* APPLE LOCAL file AltiVec */\n";
        printf "/* This file is generated by ops-to-gp.  Do not edit.   */\n\n";
        printf "/* To regenerate execute:\n";
        printf "     ops-to-gp -gcc vec.ops builtin.ops\n";
        printf "   with the current directory being gcc/config/rs6000.  */\n\n";
        
        # Output the description of each specific function.
        uid = 0;
        if (MCC) print "";
        for (i = 0; i < n_lines; i++) {
          nf = split(line[i], part);
          fcn = part[nf-SPECIFIC];
          if (!done[fcn]) {
            printf "static const struct builtin %s = {", mangle(fcn);
	    if (GCC) printf " {";
            ellipsis = 1;
            for (j = 2; j <= nf-OPN; j++)
              if (part[j] != "...") {
                printf " &T_%s,", part[j];
              } else {
                ellipsis = -1;
                printf " NULL,";
              }
            while (j++ <= MAXARGS+1)
              printf " NULL,";
            instruction = part[nf-INSTRUCTION];
            if (substr(instruction, 1, 4) == "MOP_")
              instruction = substr(instruction, 5);
            if (substr(instruction, length(instruction)) == "D")
              instruction = (substr(instruction, 1, length(instruction) - 1) ".");
	    # Gcc3: Prefix each specific instruction with a "*"
	    if (match (instruction, "^[a-zA-Z]") > 0)
	      instruction = "*" instruction;
	    if (GCC) printf " },";
	    if (GCC) printf " \"%s\",", substr(part[nf-CONSTRAINTS], 1, length(part[nf-CONSTRAINTS]) - 1);
            printf " &T_%s,", part[nf-RESULT];
            if (MCC) printf " \"%s\",", part[nf-SPECIFIC];
            printf " %d,", ellipsis * (nf - NARGS);
	    if (MCC) {
	      printf " %s,", part[nf-WHEN];
	      printf " %s,", part[nf-ADDRESSIBLE];
	      printf " %s,", part[nf-CONST_PTR_OK];
	      printf " %s,", part[nf-VOLATILE_PTR_OK];
	      printf " %s,", part[nf-CONFIGURED];
	      printf " %s,", part[nf-INSTRUCTION];
	      printf " %s,", part[nf-TRANSFORM];
	      printf " %s", part[nf-PREDICATE];
            } else if (GCC) {
	      printf " %s,", part[nf-CONST_PTR_OK];
	      printf " %s,", part[nf-VOLATILE_PTR_OK];
	      printf " %s,", part[nf-OPTIMIZE];
	      printf " \"%s\",", part[nf-SPECIFIC];
	      printf " \"%s\",", instruction;
	      printf " %s,", part[nf-INSN_CODE];
	      printf " B_UID(%d)", uid++;
            }
            printf " };\n";
          }
          done[fcn] = 1;
        }

        if (GCC) printf "#define LAST_B_UID B_UID(%d)\n", uid;

	if (GCC) {
	  # Output the description of each specific function.
	  print "";
	  uid = 0;
	  for (i in done)
	    done[i] = "";
	  print "const struct builtin * const Builtin[] = {"
	  for (i = 0; i < n_lines; i++) {
	    nf = split(line[i], part);
	    fcn = part[nf-SPECIFIC];
	    if (!done[fcn]) {
	      printf "  &%s,\n", mangle(fcn);
	    }
	    done[fcn] = 1;
	  }
	  print "};"
	}

        # Output the overload tables for each generic function.
        print "";
        for (i = 0; i < n_lines; i++) {
          nf = split(line[i], part);
          fcn = part[1];
          if (last != fcn) 
            push(fcn, part[nf]);
          printf "  &%s,\n", mangle(part[nf-SPECIFIC]);
        }
        push("", 0);

        # Output the builtin function structure.
        print "";
	if (MCC) {
	  print "%}";
	  print "struct overloadx {";
	  print "  char *name;";
	  print "  int fcns;";
	  print "  int args;";
	  print "  struct builtin **functions;";
	  print "};";
	  print "%%";
	} else if (GCC) {
	  print "const struct overloadx Overload[] = {";
	}

        # Output the builtin function list and data.
        uid = 0;
        for (i = 0; i < n_lines; i++) {
          nf = split(line[i], part);
          fcn = part[1];
          args = nf - NARGS;
          if (part[nf-OPN] == "...") args = -args;
          if (last != fcn) {
	    if (MCC) printf "%s, %d, %d, O_%s\n", fcn, part[nf], args, fcn;
            if (GCC) printf "  { \"%s\", %d, %d, O_%s, O_UID(%d) },\n", \
                            fcn, part[nf], args, fcn, uid++;
	  }
          last = fcn;
        }

	if (GCC) {
          print "  { NULL, 0, 0, NULL, 0 }"
          print "};";

          printf "#define LAST_O_UID O_UID(%d)\n", uid;
	}

    }' > $output.$suffix

if [ "$MCC" = "1" ] ; then
    $gperf > $output.h
fi