|
Packit |
6c4009 |
BEGIN {
|
|
Packit |
6c4009 |
getline;
|
|
Packit |
6c4009 |
while (!match($0, "^/[/*] static char cvs_id")) {
|
|
Packit |
6c4009 |
print;
|
|
Packit |
6c4009 |
getline;
|
|
Packit |
6c4009 |
}
|
|
Packit |
6c4009 |
getline;
|
|
Packit |
6c4009 |
while (!match($0, "^// WARRANTY DISCLAIMER")) {
|
|
Packit |
6c4009 |
print;
|
|
Packit |
6c4009 |
if (!getline) {
|
|
Packit |
6c4009 |
break;
|
|
Packit |
6c4009 |
}
|
|
Packit |
6c4009 |
}
|
|
Packit |
6c4009 |
if (getline)
|
|
Packit |
6c4009 |
{
|
|
Packit |
6c4009 |
printf \
|
|
Packit |
6c4009 |
"// Redistribution and use in source and binary forms, with or without\n" \
|
|
Packit |
6c4009 |
"// modification, are permitted provided that the following conditions are\n" \
|
|
Packit |
6c4009 |
"// met:\n" \
|
|
Packit |
6c4009 |
"//\n" \
|
|
Packit |
6c4009 |
"// * Redistributions of source code must retain the above copyright\n" \
|
|
Packit |
6c4009 |
"// notice, this list of conditions and the following disclaimer.\n" \
|
|
Packit |
6c4009 |
"//\n" \
|
|
Packit |
6c4009 |
"// * Redistributions in binary form must reproduce the above copyright\n" \
|
|
Packit |
6c4009 |
"// notice, this list of conditions and the following disclaimer in the\n" \
|
|
Packit |
6c4009 |
"// documentation and/or other materials provided with the distribution.\n" \
|
|
Packit |
6c4009 |
"//\n" \
|
|
Packit |
6c4009 |
"// * The name of Intel Corporation may not be used to endorse or promote\n" \
|
|
Packit |
6c4009 |
"// products derived from this software without specific prior written\n" \
|
|
Packit |
6c4009 |
"// permission.\n\n";
|
|
Packit |
6c4009 |
if (LICENSE_ONLY == "y") {
|
|
Packit |
6c4009 |
do {
|
|
Packit |
6c4009 |
print;
|
|
Packit |
6c4009 |
} while (getline);
|
|
Packit |
6c4009 |
}
|
|
Packit |
6c4009 |
}
|
|
Packit |
6c4009 |
}
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
/^[.]data/ {
|
|
Packit |
6c4009 |
print "RODATA";
|
|
Packit |
6c4009 |
next;
|
|
Packit |
6c4009 |
}
|
|
Packit |
6c4009 |
/^([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]?_.+):/ {
|
|
Packit |
6c4009 |
table_name=substr($1,1,length($1)-1);
|
|
Packit |
6c4009 |
printf "LOCAL_OBJECT_START(%s)\n", table_name;
|
|
Packit |
6c4009 |
getline;
|
|
Packit |
6c4009 |
while (!match($0, "^[ \t]*data")) {
|
|
Packit |
6c4009 |
print;
|
|
Packit |
6c4009 |
getline;
|
|
Packit |
6c4009 |
}
|
|
Packit |
6c4009 |
while (match($0, "(//|^[ \t]*data)")) {
|
|
Packit |
6c4009 |
print;
|
|
Packit |
6c4009 |
getline;
|
|
Packit |
6c4009 |
}
|
|
Packit |
6c4009 |
printf "LOCAL_OBJECT_END(%s)\n\n", table_name;
|
|
Packit |
6c4009 |
next;
|
|
Packit |
6c4009 |
}
|
|
Packit |
6c4009 |
/^[.]proc[ \t]+__libm_(error_region|callout)/ {
|
|
Packit |
6c4009 |
printf "LOCAL_LIBM_ENTRY(%s)\n", $2;
|
|
Packit |
6c4009 |
getline;
|
|
Packit |
6c4009 |
next;
|
|
Packit |
6c4009 |
}
|
|
Packit |
6c4009 |
/^[.]endp[ \t]+__libm_(error_region|callout)/ {
|
|
Packit |
6c4009 |
printf "LOCAL_LIBM_END(%s)\n", $2;
|
|
Packit |
6c4009 |
next;
|
|
Packit |
6c4009 |
}
|
|
Packit |
6c4009 |
/^[.]global/ {
|
|
Packit |
6c4009 |
split($2, part, "#");
|
|
Packit |
6c4009 |
name=part[1];
|
|
Packit |
6c4009 |
if (match(name, "^"FUNC"$")) {
|
|
Packit |
6c4009 |
next;
|
|
Packit |
6c4009 |
}
|
|
Packit |
6c4009 |
}
|
|
Packit |
6c4009 |
/^[.]proc/ {
|
|
Packit |
6c4009 |
split($2, part, "#");
|
|
Packit |
6c4009 |
name=part[1];
|
|
Packit |
6c4009 |
if (match(name, "^"FUNC"$")) {
|
|
Packit |
6c4009 |
local_funcs=("^(" \
|
|
Packit |
6c4009 |
"cis|cisf|cisl" \
|
|
Packit |
6c4009 |
"|cabs|cabsf|cabsl" \
|
|
Packit |
6c4009 |
"|cot|cotf|cotl" \
|
|
Packit |
6c4009 |
")$");
|
|
Packit |
6c4009 |
ieee754_funcs=("^(" \
|
|
Packit |
6c4009 |
"atan2|atan2f|atan2l|atanl" \
|
|
Packit |
6c4009 |
"|cos|cosf|cosl" \
|
|
Packit |
6c4009 |
"|cosh|coshf|coshl" \
|
|
Packit |
6c4009 |
"|exp|expf|expl" \
|
|
Packit |
6c4009 |
"|exp10|exp10f|exp10l" \
|
|
Packit |
6c4009 |
"|expm1|expm1f|expm1l" \
|
|
Packit |
6c4009 |
"|fmod|fmodf|fmodl" \
|
|
Packit |
6c4009 |
"|hypot|hypotf|hypotl" \
|
|
Packit |
6c4009 |
"|fabs|fabsf|fabsl" \
|
|
Packit |
6c4009 |
"|floor|floorf|floorl" \
|
|
Packit |
6c4009 |
"|log1p|log1pf|log1pl" \
|
|
Packit |
6c4009 |
"|log|log10|log10f|log10l|log2l|logf|logl" \
|
|
Packit |
6c4009 |
"|remainder|remainderf|remainderl|" \
|
|
Packit |
6c4009 |
"|rint|rintf|rintl|" \
|
|
Packit |
6c4009 |
"|scalb|scalbf|scalbl" \
|
|
Packit |
6c4009 |
"|sin|sinf|sinl" \
|
|
Packit |
6c4009 |
"|sincos|sincosf|sincosl" \
|
|
Packit |
6c4009 |
"|sinh|sinhf|sinhl" \
|
|
Packit |
6c4009 |
"|sqrt|sqrtf|sqrtl" \
|
|
Packit |
6c4009 |
"|tan|tanf|tanl" \
|
|
Packit |
6c4009 |
")$");
|
|
Packit |
6c4009 |
if (match(name, ieee754_funcs)) {
|
|
Packit |
6c4009 |
type="GLOBAL_IEEE754";
|
|
Packit |
6c4009 |
} else if (match (name, local_funcs)) {
|
|
Packit |
6c4009 |
type="LOCAL_LIBM";
|
|
Packit |
6c4009 |
} else {
|
|
Packit |
6c4009 |
type="GLOBAL_LIBM";
|
|
Packit |
6c4009 |
}
|
|
Packit |
6c4009 |
printf "%s_ENTRY(%s)\n", type, name;
|
|
Packit |
6c4009 |
getline;
|
|
Packit |
6c4009 |
while (!match($0, "^"name"#?:")) {
|
|
Packit |
6c4009 |
getline;
|
|
Packit |
6c4009 |
}
|
|
Packit |
6c4009 |
getline;
|
|
Packit |
6c4009 |
while (!match($0, "^.endp")) {
|
|
Packit |
6c4009 |
print
|
|
Packit |
6c4009 |
getline;
|
|
Packit |
6c4009 |
}
|
|
Packit |
6c4009 |
printf "%s_END(%s)\n", type, name;
|
|
Packit |
6c4009 |
if (match(name, "^exp10[fl]?$")) {
|
|
Packit |
6c4009 |
t=substr(name,6)
|
|
Packit |
6c4009 |
printf "weak_alias (exp10%s, pow10%s)\n", t, t
|
|
Packit |
6c4009 |
}
|
|
Packit |
6c4009 |
next;
|
|
Packit |
6c4009 |
}
|
|
Packit |
6c4009 |
}
|
|
Packit |
6c4009 |
/^[a-zA-Z_]+:/ {
|
|
Packit |
6c4009 |
split($1, part, ":");
|
|
Packit |
6c4009 |
name=part[1];
|
|
Packit |
6c4009 |
if (match(name, "^"FUNC"$")) {
|
|
Packit |
6c4009 |
printf "GLOBAL_LIBM_ENTRY(%s)\n", name;
|
|
Packit |
6c4009 |
getline;
|
|
Packit |
6c4009 |
while (!match($0, "^"name"#?:")) {
|
|
Packit |
6c4009 |
getline;
|
|
Packit |
6c4009 |
}
|
|
Packit |
6c4009 |
getline;
|
|
Packit |
6c4009 |
while (!match($0, "^.endp")) {
|
|
Packit |
6c4009 |
print
|
|
Packit |
6c4009 |
getline;
|
|
Packit |
6c4009 |
}
|
|
Packit |
6c4009 |
getline;
|
|
Packit |
6c4009 |
printf "GLOBAL_LIBM_END(%s)\n", name;
|
|
Packit |
6c4009 |
next;
|
|
Packit |
6c4009 |
}
|
|
Packit |
6c4009 |
}
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
{ print }
|