Updated to fedora-glibc-20050106T1443
[glibc.git] / sysdeps / ia64 / fpu / import_file.awk
blobc6335dc1dff12bcb2aa3771cbfb0567a27be6628
1 BEGIN {
2 getline;
3 while (!match($0, "^/[/*] static char cvs_id")) {
4 print;
5 getline;
7 getline;
8 while (!match($0, "^// WARRANTY DISCLAIMER")) {
9 print;
10 getline;
12 getline;
13 printf \
14 "// Redistribution and use in source and binary forms, with or without\n" \
15 "// modification, are permitted provided that the following conditions are\n" \
16 "// met:\n" \
17 "//\n" \
18 "// * Redistributions of source code must retain the above copyright\n" \
19 "// notice, this list of conditions and the following disclaimer.\n" \
20 "//\n" \
21 "// * Redistributions in binary form must reproduce the above copyright\n" \
22 "// notice, this list of conditions and the following disclaimer in the\n" \
23 "// documentation and/or other materials provided with the distribution.\n" \
24 "//\n" \
25 "// * The name of Intel Corporation may not be used to endorse or promote\n" \
26 "// products derived from this software without specific prior written\n" \
27 "// permission.\n\n";
28 if (LICENSE_ONLY == "y") {
29 do {
30 print;
31 } while (getline);
35 /^[.]data/ {
36 print "RODATA";
37 next;
39 /^([a-zA-Z_0-9]*_(tb[l0-9]|Tt|[tT]able|data|low|coeffs|constants|CONSTANTS|reduction|Stirling)(_?([1-9cdimpqstPQT]+|tail))?|(Constants|Poly|coeff)_.+|(double_sin_?cos|double_cis)[fl]?_.+):/ {
40 table_name=substr($1,1,length($1)-1);
41 printf "LOCAL_OBJECT_START(%s)\n", table_name;
42 getline;
43 while (!match($0, "^[ \t]*data")) {
44 print;
45 getline;
47 while (match($0, "(//|^[ \t]*data)")) {
48 print;
49 getline;
51 printf "LOCAL_OBJECT_END(%s)\n\n", table_name;
52 next;
54 /^[.]proc[ \t]+__libm_(error_region|callout)/ {
55 printf "LOCAL_LIBM_ENTRY(%s)\n", $2;
56 getline;
57 next;
59 /^[.]endp[ \t]+__libm_(error_region|callout)/ {
60 printf "LOCAL_LIBM_END(%s)\n", $2;
61 next;
63 /^[.]global/ {
64 split($2, part, "#");
65 name=part[1];
66 if (match(name, "^"FUNC"$")) {
67 next;
70 /^[.]proc/ {
71 split($2, part, "#");
72 name=part[1];
73 if (match(name, "^"FUNC"$")) {
74 local_funcs=("^(" \
75 "cis|cisf|cisl" \
76 "|cabs|cabsf|cabsl" \
77 "|cot|cotf|cotl" \
78 ")$");
79 ieee754_funcs=("^(" \
80 "atan2|atan2f|atan2l|atanl" \
81 "|cos|cosf|cosl" \
82 "|cosh|coshf|coshl" \
83 "|exp|expf|expl" \
84 "|exp10|exp10f|exp10l" \
85 "|expm1|expm1f|expm1l" \
86 "|fmod|fmodf|fmodl" \
87 "|hypot|hypotf|hypotl" \
88 "|fabs|fabsf|fabsl" \
89 "|floor|floorf|floorl" \
90 "|log1p|log1pf|log1pl" \
91 "|log|log10|log10f|log10l|log2l|logf|logl" \
92 "|remainder|remainderf|remainderl|" \
93 "|rint|rintf|rintl|" \
94 "|scalb|scalbf|scalbl" \
95 "|sin|sinf|sinl" \
96 "|sincos|sincosf|sincosl" \
97 "|sinh|sinhf|sinhl" \
98 "|sqrt|sqrtf|sqrtl" \
99 "|tan|tanf|tanl" \
100 ")$");
101 if (match(name, ieee754_funcs)) {
102 type="GLOBAL_IEEE754";
103 } else if (match (name, local_funcs)) {
104 type="LOCAL_LIBM";
105 } else {
106 type="GLOBAL_LIBM";
108 printf "%s_ENTRY(%s)\n", type, name;
109 getline;
110 while (!match($0, "^"name"#?:")) {
111 getline;
113 getline;
114 while (!match($0, "^.endp")) {
115 print
116 getline;
118 getline;
119 printf "%s_END(%s)\n", type, name;
120 if (match(name, "^exp10[fl]?$")) {
121 t=substr(name,6)
122 printf "weak_alias (exp10%s, pow10%s)\n", t, t
124 next;
127 /^[a-zA-Z_]+:/ {
128 split($1, part, ":");
129 name=part[1];
130 if (match(name, "^"FUNC"$")) {
131 printf "GLOBAL_LIBM_ENTRY(%s)\n", name;
132 getline;
133 while (!match($0, "^"name"#?:")) {
134 getline;
136 getline;
137 while (!match($0, "^.endp")) {
138 print
139 getline;
141 getline;
142 printf "GLOBAL_LIBM_END(%s)\n", name;
143 next;
147 { print }