Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
Emulators
tme
0006-ieee754-misc-auto.m4-ieee754-ops-auto.m4-i...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0006-ieee754-misc-auto.m4-ieee754-ops-auto.m4-ieee754-pre.patch of Package tme
From 28ce91afc0a9bff840e09db0c8bf5fbff75b32a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Klaus=20K=C3=A4mpf?= <kkaempf@gmail.com> Date: Thu, 3 Oct 2024 15:33:05 +0200 Subject: [PATCH 06/12] ieee754-misc-auto.m4,ieee754-ops-auto.m4,ieee754-precision.m4: Fix $as_echo MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Klaus Kämpf <kkaempf@gmail.com> --- ic/ieee754/ieee754-misc-auto.m4 | 196 +++++++++++------------ ic/ieee754/ieee754-ops-auto.m4 | 276 ++++++++++++++++---------------- ic/ieee754/ieee754-precision.m4 | 10 +- 3 files changed, 241 insertions(+), 241 deletions(-) diff --git a/ic/ieee754/ieee754-misc-auto.m4 b/ic/ieee754/ieee754-misc-auto.m4 index 3325f8c..bf2964c 100644 --- a/ic/ieee754/ieee754-misc-auto.m4 +++ b/ic/ieee754/ieee754-misc-auto.m4 @@ -74,7 +74,7 @@ for precision in single double extended80 quad; do # get information about this precision: # - _precision=`$as_echo $0 | sed -e "s/$PROG/ieee754-precision.sh/"` + _precision=`AS_ECHO([$0 | sed -e])"s/$PROG/ieee754-precision.sh/"` eval `sh ${_precision} ${precision}` # if we're generating a header: @@ -192,22 +192,22 @@ EOF x_value="(x)->tme_float_value_ieee754_${precision}" case "${precision}" in single) - $as_echo " ${x_value} = *(y); \\" + AS_ECHO([" ${x_value} = *(y); \\"]) ;; double) - $as_echo " ${x_value}.tme_value64_uint32_hi = (y)->tme_ieee754_double_constant_hi; \\" - $as_echo " ${x_value}.tme_value64_uint32_lo = (y)->tme_ieee754_double_constant_lo; \\" + AS_ECHO([" ${x_value}.tme_value64_uint32_hi = (y)->tme_ieee754_double_constant_hi; \\"]) + AS_ECHO([" ${x_value}.tme_value64_uint32_lo = (y)->tme_ieee754_double_constant_lo; \\"]) ;; extended80) - $as_echo " ${x_value}.tme_float_ieee754_extended80_sexp = (y)->tme_ieee754_extended80_constant_sexp; \\" - $as_echo " ${x_value}.tme_float_ieee754_extended80_significand.tme_value64_uint32_hi = (y)->tme_ieee754_extended80_constant_significand_hi; \\" - $as_echo " ${x_value}.tme_float_ieee754_extended80_significand.tme_value64_uint32_lo = (y)->tme_ieee754_extended80_constant_significand_lo; \\" + AS_ECHO([" ${x_value}.tme_float_ieee754_extended80_sexp = (y)->tme_ieee754_extended80_constant_sexp; \\"]) + AS_ECHO([" ${x_value}.tme_float_ieee754_extended80_significand.tme_value64_uint32_hi = (y)->tme_ieee754_extended80_constant_significand_hi; \\"]) + AS_ECHO([" ${x_value}.tme_float_ieee754_extended80_significand.tme_value64_uint32_lo = (y)->tme_ieee754_extended80_constant_significand_lo; \\"]) ;; quad) - $as_echo " ${x_value}.tme_float_ieee754_quad_hi.tme_value64_uint32_hi = (y)->tme_ieee754_quad_constant_hi_hi; \\" - $as_echo " ${x_value}.tme_float_ieee754_quad_hi.tme_value64_uint32_lo = (y)->tme_ieee754_quad_constant_hi_lo; \\" - $as_echo " ${x_value}.tme_float_ieee754_quad_lo.tme_value64_uint32_hi = (y)->tme_ieee754_quad_constant_lo_hi; \\" - $as_echo " ${x_value}.tme_float_ieee754_quad_lo.tme_value64_uint32_lo = (y)->tme_ieee754_quad_constant_lo_lo; \\" + AS_ECHO([" ${x_value}.tme_float_ieee754_quad_hi.tme_value64_uint32_hi = (y)->tme_ieee754_quad_constant_hi_hi; \\"]) + AS_ECHO([" ${x_value}.tme_float_ieee754_quad_hi.tme_value64_uint32_lo = (y)->tme_ieee754_quad_constant_hi_lo; \\"]) + AS_ECHO([" ${x_value}.tme_float_ieee754_quad_lo.tme_value64_uint32_hi = (y)->tme_ieee754_quad_constant_lo_hi; \\"]) + AS_ECHO([" ${x_value}.tme_float_ieee754_quad_lo.tme_value64_uint32_lo = (y)->tme_ieee754_quad_constant_lo_lo; \\"]) ;; esac cat <<EOF @@ -252,16 +252,16 @@ EOF case "${precision}" in single) ;; double) - $as_echo " (x)->tme_float_value_ieee754_double.tme_value64_uint32_lo = 0; \\" + AS_ECHO([" (x)->tme_float_value_ieee754_double.tme_value64_uint32_lo = 0; \\"]) ;; extended80) - $as_echo " (x)->tme_float_value_ieee754_extended80.tme_float_ieee754_extended80_significand.tme_value64_uint32_hi = 0; \\" - $as_echo " (x)->tme_float_value_ieee754_extended80.tme_float_ieee754_extended80_significand.tme_value64_uint32_lo = 0; \\" + AS_ECHO([" (x)->tme_float_value_ieee754_extended80.tme_float_ieee754_extended80_significand.tme_value64_uint32_hi = 0; \\"]) + AS_ECHO([" (x)->tme_float_value_ieee754_extended80.tme_float_ieee754_extended80_significand.tme_value64_uint32_lo = 0; \\"]) ;; quad) - $as_echo " (x)->tme_float_value_ieee754_quad.tme_float_ieee754_quad_hi.tme_value64_uint32_lo = 0; \\" - $as_echo " (x)->tme_float_value_ieee754_quad.tme_float_ieee754_quad_lo.tme_value64_uint32_hi = 0; \\" - $as_echo " (x)->tme_float_value_ieee754_quad.tme_float_ieee754_quad_lo.tme_value64_uint32_lo = 0; \\" + AS_ECHO([" (x)->tme_float_value_ieee754_quad.tme_float_ieee754_quad_hi.tme_value64_uint32_lo = 0; \\"]) + AS_ECHO([" (x)->tme_float_value_ieee754_quad.tme_float_ieee754_quad_lo.tme_value64_uint32_hi = 0; \\"]) + AS_ECHO([" (x)->tme_float_value_ieee754_quad.tme_float_ieee754_quad_lo.tme_value64_uint32_lo = 0; \\"]) ;; esac cat <<EOF @@ -316,17 +316,17 @@ EOF esac if test "${cond}" != 1; then - $as_echo "" - $as_echo "#if ${cond}" + AS_ECHO([""]) + AS_ECHO(["#if ${cond}"]) fi - $as_echo "" - $as_echo "/* this converts a ${convert_builtin} to a ${precision}: */" - $as_echo "void tme_ieee754_${precision}_from_${convert} _TME_P((${convert_builtin}, struct tme_float *));" + AS_ECHO([""]) + AS_ECHO(["/* this converts a ${convert_builtin} to a ${precision}: */"]) + AS_ECHO(["void tme_ieee754_${precision}_from_${convert} _TME_P((${convert_builtin}, struct tme_float *));"]) if test "${cond}" != 1; then - $as_echo "" - $as_echo "#endif /* ${cond} */" + AS_ECHO([""]) + AS_ECHO(["#endif /* ${cond} */"]) fi done @@ -377,20 +377,20 @@ EOF if test "x${chunk_member}" = xx; then break fi - $as_echo " chunk = TME_FIELD_MASK_EXTRACTU((*x_ieee754)${chunk_member}, ${chunk_mask});" + AS_ECHO([" chunk = TME_FIELD_MASK_EXTRACTU((*x_ieee754)${chunk_member}, ${chunk_mask});"]) if test ${chunk_i} = 0; then - $as_echo " fracor = chunk;" + AS_ECHO([" fracor = chunk;"]) if ${implicit}; then - $as_echo " /* if the exponent is nonzero, add the implicit integer bit: */" - $as_echo " if (exponent != 0) chunk |= ((${chunk_mask} / _TME_FIELD_MASK_FACTOR(${chunk_mask})) + 1);" + AS_ECHO([" /* if the exponent is nonzero, add the implicit integer bit: */"]) + AS_ECHO([" if (exponent != 0) chunk |= ((${chunk_mask} / _TME_FIELD_MASK_FACTOR(${chunk_mask})) + 1);"]) else - $as_echo " /* if the exponent is the biased maximum, clear the explicit integer bit: */" - $as_echo " if (exponent == ${exp_biased_max}) fracor &= ~_TME_FIELD_MASK_MSBIT(${chunk_mask} / _TME_FIELD_MASK_FACTOR(${chunk_mask}));" + AS_ECHO([" /* if the exponent is the biased maximum, clear the explicit integer bit: */"]) + AS_ECHO([" if (exponent == ${exp_biased_max}) fracor &= ~_TME_FIELD_MASK_MSBIT(${chunk_mask} / _TME_FIELD_MASK_FACTOR(${chunk_mask}));"]) fi - $as_echo " x_builtin = chunk;" + AS_ECHO([" x_builtin = chunk;"]) else - $as_echo " fracor |= chunk;" - $as_echo " x_builtin = (x_builtin * 65536) + chunk;" + AS_ECHO([" fracor |= chunk;"]) + AS_ECHO([" x_builtin = (x_builtin * 65536) + chunk;"]) fi chunk_i=`expr ${chunk_i} + 1` done @@ -567,19 +567,19 @@ EOF factor="((${chunk_mask} / _TME_FIELD_MASK_FACTOR(${chunk_mask})) + 1)" if test ${chunk_i} = 0; then if ${implicit}; then - $as_echo " /* remove any implicit integer bit: */" - $as_echo " if (x_builtin >= 1) {" - $as_echo " x_builtin -= 1;" - $as_echo " }" + AS_ECHO([" /* remove any implicit integer bit: */"]) + AS_ECHO([" if (x_builtin >= 1) {"]) + AS_ECHO([" x_builtin -= 1;"]) + AS_ECHO([" }"]) else factor="(${factor} / 2)" fi fi - $as_echo " x_builtin = x_builtin * ${factor};" - $as_echo " chunk = x_builtin;" - $as_echo " chunk -= (chunk > x_builtin);" - $as_echo " x_builtin -= chunk;" - $as_echo " TME_FIELD_MASK_DEPOSITU((*x_ieee754)${chunk_member}, ${chunk_mask}, chunk);" + AS_ECHO([" x_builtin = x_builtin * ${factor};"]) + AS_ECHO([" chunk = x_builtin;"]) + AS_ECHO([" chunk -= (chunk > x_builtin);"]) + AS_ECHO([" x_builtin -= chunk;"]) + AS_ECHO([" TME_FIELD_MASK_DEPOSITU((*x_ieee754)${chunk_member}, ${chunk_mask}, chunk);"]) chunk_i=`expr ${chunk_i} + 1` done cat <<EOF @@ -598,50 +598,50 @@ EOF for monadic in true false; do if ${monadic}; then type=monadic; else type=dyadic; fi - $as_echo "" - $as_echo "/* this does a NaN check for an IEEE 754 ${precision} precision ${type} function: */" - $as_echo "int" - $as_echo_n "tme_ieee754_${precision}_check_nan_${type}(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0" + AS_ECHO([""]) + AS_ECHO(["/* this does a NaN check for an IEEE 754 ${precision} precision ${type} function: */"]) + AS_ECHO(["int"]) + AS_ECHO_N(["tme_ieee754_${precision}_check_nan_${type}(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0"]) if ${monadic}; then :; else - $as_echo_n ", const struct tme_float *src1" + AS_ECHO_N([", const struct tme_float *src1"]) fi - $as_echo ", struct tme_float *dst)" - $as_echo "{" - $as_echo " const ${integral} *nan0;" + AS_ECHO([", struct tme_float *dst)"]) + AS_ECHO(["{"]) + AS_ECHO([" const ${integral} *nan0;"]) if $monadic; then :; else - $as_echo " const ${integral} *nan1;" + AS_ECHO([" const ${integral} *nan1;"]) fi - $as_echo "" - $as_echo " /* check for a NaN operand: */" - $as_echo " nan0 = NULL;" - $as_echo " if (tme_ieee754_${precision}_is_nan(src0)) {" - $as_echo " assert (src0->tme_float_format == TME_FLOAT_FORMAT_IEEE754_${capprecision});" - $as_echo " nan0 = &src0->tme_float_value_ieee754_${precision};" - $as_echo " }" + AS_ECHO([""]) + AS_ECHO([" /* check for a NaN operand: */"]) + AS_ECHO([" nan0 = NULL;"]) + AS_ECHO([" if (tme_ieee754_${precision}_is_nan(src0)) {"]) + AS_ECHO([" assert (src0->tme_float_format == TME_FLOAT_FORMAT_IEEE754_${capprecision});"]) + AS_ECHO([" nan0 = &src0->tme_float_value_ieee754_${precision};"]) + AS_ECHO([" }"]) if $monadic; then nan1=nan0; else nan1=nan1 - $as_echo " nan1 = nan0;" - $as_echo " if (tme_ieee754_${precision}_is_nan(src1)) {" - $as_echo " assert (src1->tme_float_format == TME_FLOAT_FORMAT_IEEE754_${capprecision});" - $as_echo " nan1 = &src1->tme_float_value_ieee754_${precision};" - $as_echo " if (nan0 == NULL) {" - $as_echo " nan0 = nan1;" - $as_echo " }" - $as_echo " }" + AS_ECHO([" nan1 = nan0;"]) + AS_ECHO([" if (tme_ieee754_${precision}_is_nan(src1)) {"]) + AS_ECHO([" assert (src1->tme_float_format == TME_FLOAT_FORMAT_IEEE754_${capprecision});"]) + AS_ECHO([" nan1 = &src1->tme_float_value_ieee754_${precision};"]) + AS_ECHO([" if (nan0 == NULL) {"]) + AS_ECHO([" nan0 = nan1;"]) + AS_ECHO([" }"]) + AS_ECHO([" }"]) fi - $as_echo "" - $as_echo " /* if we have a NaN operand: */" - $as_echo " if (__tme_predict_false(nan0 != NULL)) {" - $as_echo "" - $as_echo " /* propagate a NaN: */" - $as_echo " dst->tme_float_format = TME_FLOAT_FORMAT_IEEE754_${capprecision};" - $as_echo " (*ieee754_ctl->tme_ieee754_ctl_nan_from_nans_${precision})" - $as_echo " (ieee754_ctl, nan0, ${nan1}, &dst->tme_float_value_ieee754_${precision});" - $as_echo " return (TRUE);" - $as_echo " }" - $as_echo "" - $as_echo " return (FALSE);" - $as_echo "}" + AS_ECHO([""]) + AS_ECHO([" /* if we have a NaN operand: */"]) + AS_ECHO([" if (__tme_predict_false(nan0 != NULL)) {"]) + AS_ECHO([""]) + AS_ECHO([" /* propagate a NaN: */"]) + AS_ECHO([" dst->tme_float_format = TME_FLOAT_FORMAT_IEEE754_${capprecision};"]) + AS_ECHO([" (*ieee754_ctl->tme_ieee754_ctl_nan_from_nans_${precision})"]) + AS_ECHO([" (ieee754_ctl, nan0, ${nan1}, &dst->tme_float_value_ieee754_${precision});"]) + AS_ECHO([" return (TRUE);"]) + AS_ECHO([" }"]) + AS_ECHO([""]) + AS_ECHO([" return (FALSE);"]) + AS_ECHO(["}"]) done # emit the from-integer conversion functions: @@ -655,21 +655,21 @@ EOF esac if test "${cond}" != 1; then - $as_echo "" - $as_echo "#if ${cond}" + AS_ECHO([""]) + AS_ECHO(["#if ${cond}"]) fi - $as_echo "" - $as_echo "/* this converts a ${convert_builtin} to a ${precision}: */" - $as_echo "void" - $as_echo "tme_ieee754_${precision}_from_${convert}(${convert_builtin} src, struct tme_float *dst)" - $as_echo "{" - $as_echo " _tme_ieee754_${precision}_value_set(dst, ${precision_sf}, ${convert}_to_${precision_sf}(src));" - $as_echo "}" + AS_ECHO([""]) + AS_ECHO(["/* this converts a ${convert_builtin} to a ${precision}: */"]) + AS_ECHO(["void"]) + AS_ECHO(["tme_ieee754_${precision}_from_${convert}(${convert_builtin} src, struct tme_float *dst)"]) + AS_ECHO(["{"]) + AS_ECHO([" _tme_ieee754_${precision}_value_set(dst, ${precision_sf}, ${convert}_to_${precision_sf}(src));"]) + AS_ECHO(["}"]) if test "${cond}" != 1; then - $as_echo "" - $as_echo "#endif /* ${cond} */" + AS_ECHO([""]) + AS_ECHO(["#endif /* ${cond} */"]) fi done @@ -734,14 +734,14 @@ EOF } EOF if test ${radix} = 2; then - $as_echo "" - $as_echo " /* extract the unbiased exponent: */" - $as_echo " exponent = TME_FIELD_MASK_EXTRACTU(src->tme_float_value_ieee754_${precision}${sexp}, ${mask_exp});" - $as_echo " exponent -= ${exp_bias};" - $as_echo "" - $as_echo " /* the mantissa is the source with a biased zero for the exponent: */" - $as_echo " *_mantissa = *src;" - $as_echo " TME_FIELD_MASK_DEPOSITU(_mantissa->tme_float_value_ieee754_${precision}${sexp}, ${mask_exp}, ${exp_bias});" + AS_ECHO([""]) + AS_ECHO([" /* extract the unbiased exponent: */"]) + AS_ECHO([" exponent = TME_FIELD_MASK_EXTRACTU(src->tme_float_value_ieee754_${precision}${sexp}, ${mask_exp});"]) + AS_ECHO([" exponent -= ${exp_bias};"]) + AS_ECHO([""]) + AS_ECHO([" /* the mantissa is the source with a biased zero for the exponent: */"]) + AS_ECHO([" *_mantissa = *src;"]) + AS_ECHO([" TME_FIELD_MASK_DEPOSITU(_mantissa->tme_float_value_ieee754_${precision}${sexp}, ${mask_exp}, ${exp_bias});"]) else cat <<EOF diff --git a/ic/ieee754/ieee754-ops-auto.m4 b/ic/ieee754/ieee754-ops-auto.m4 index 0db7e35..57eb07d 100644 --- a/ic/ieee754/ieee754-ops-auto.m4 +++ b/ic/ieee754/ieee754-ops-auto.m4 @@ -63,7 +63,7 @@ fi # the precision information helper script: # -ieee754_precision_sh=`$as_echo $0 | sed -e "s/$PROG/ieee754-precision.sh/"` +ieee754_precision_sh=`AS_ECHO([$0]) | sed -e "s/$PROG/ieee754-precision.sh/"` # the different compliance levels: # @@ -85,20 +85,20 @@ for level in ${levels}; do # operations struct type: # if test "${level}-${what}" = strict-funcs; then - $as_echo "/* the IEEE 754 operations: */" - $as_echo "struct tme_ieee754_ops {" - $as_echo "" - $as_echo " /* the version of this structure: */" - $as_echo " tme_uint32_t tme_ieee754_ops_version;" + AS_ECHO(["/* the IEEE 754 operations: */"]) + AS_ECHO(["struct tme_ieee754_ops {"]) + AS_ECHO([""]) + AS_ECHO([" /* the version of this structure: */"]) + AS_ECHO([" tme_uint32_t tme_ieee754_ops_version;"]) # otherwise, if we're doing a set, just declare the set # and continue: # elif test ${what} = set; then - $as_echo "" - $as_echo "/* the ${level} compliance operations: */" - $as_echo "extern _tme_const struct tme_ieee754_ops tme_ieee754_ops_${level};" + AS_ECHO([""]) + AS_ECHO(["/* the ${level} compliance operations: */"]) + AS_ECHO(["extern _tme_const struct tme_ieee754_ops tme_ieee754_ops_${level};"]) continue fi @@ -108,12 +108,12 @@ for level in ${levels}; do # start the operations set for this level: # - $as_echo "" - $as_echo "/* the ${level} compliance operations: */" - $as_echo "_tme_const struct tme_ieee754_ops tme_ieee754_ops_${level} = {" - $as_echo "" - $as_echo " /* the version of this structure: */" - $as_echo " TME_X_VERSION(0, 0)," + AS_ECHO([""]) + AS_ECHO(["/* the ${level} compliance operations: */"]) + AS_ECHO(["_tme_const struct tme_ieee754_ops tme_ieee754_ops_${level} = {"]) + AS_ECHO([""]) + AS_ECHO([" /* the version of this structure: */"]) + AS_ECHO([" TME_X_VERSION(0, 0),"]) fi # permute for the different precisions: @@ -164,7 +164,7 @@ for level in ${levels}; do from_precision= case "${name}" in from_*) - from_precision=`$as_echo ${name} | sed -e 's/^from_//'` + from_precision=`AS_ECHO([${name}]) | sed -e 's/^from_//'` if test ${from_precision} = ${precision}; then continue fi @@ -179,13 +179,13 @@ for level in ${levels}; do # doing the strict level functions: # if test "${level}-${what}" = strict-funcs; then - $as_echo "" - $as_echo " /* this does a ${precision}-precision "`$as_echo ${name} | tr _ -`": */" - $as_echo_n " void (*tme_ieee754_ops_${precision}_${name}) _TME_P((struct tme_ieee754_ctl *, " + AS_ECHO([""]) + AS_ECHO([" /* this does a ${precision}-precision "`AS_ECHO([${name}]) | tr _ -`": */"]) + AS_ECHO_N([" void (*tme_ieee754_ops_${precision}_${name}) _TME_P((struct tme_ieee754_ctl *, "]) if $monadic; then :; else - $as_echo_n "_tme_const struct tme_float *, " + AS_ECHO_N(["_tme_const struct tme_float *, "]) fi - $as_echo "_tme_const ${src_type}, ${dst_type} *));" + AS_ECHO(["_tme_const ${src_type}, ${dst_type} *));"]) fi continue @@ -321,7 +321,7 @@ for level in ${levels}; do if test "x${cond_builtin_match}" != x; then cond="${cond} && (TME_FLOAT_FORMAT_IEEE754_${capprecision}_BUILTIN == TME_FLOAT_FORMAT_IEEE754_${capprecision})" fi - eval "cond=\`$as_echo_n '${cond}' | sed -e 's%^1 && %%'\`" + eval "cond=\`AS_ECHO_N(['${cond}']) | sed -e 's%^1 && %%'\`" case "${cond}" in 0*) cond=0 ;; esac # finish the operands: @@ -411,146 +411,146 @@ for level in ${levels}; do # start any conditional: # if test "${cond}" != 1; then - $as_echo "" - $as_echo "#if ${cond}" + AS_ECHO([""]) + AS_ECHO(["#if ${cond}"]) fi # start the function: # - $as_echo "" - $as_echo "/* this does a ${level} compliance ${precision}-precision "`$as_echo ${name} | tr _ -`": */" - $as_echo "static void" - $as_echo_n "${func}(struct tme_ieee754_ctl *ieee754_ctl, const ${src_type}src0, " + AS_ECHO([""]) + AS_ECHO(["/* this does a ${level} compliance ${precision}-precision "`AS_ECHO([${name}]) | tr _ -`": */"]) + AS_ECHO(["static void"]) + AS_ECHO_N(["${func}(struct tme_ieee754_ctl *ieee754_ctl, const ${src_type}src0, "]) if $monadic; then :; else - $as_echo_n "const struct tme_float *src1, " + AS_ECHO_N(["const struct tme_float *src1, "]) fi - $as_echo "${dst_type} *dst)" - $as_echo "{" + AS_ECHO(["${dst_type} *dst)"]) + AS_ECHO(["{"]) # emit locals: # if ${src0_buffer}; then - $as_echo " ${op0_integral} src0_buffer;" + AS_ECHO([" ${op0_integral} src0_buffer;"]) fi if ${src1_buffer}; then - $as_echo " ${op1_integral} src1_buffer;" + AS_ECHO([" ${op1_integral} src1_buffer;"]) fi - $as_echo " int exceptions;" + AS_ECHO([" int exceptions;"]) # check the operand(s): # if ${check_nan}; then - $as_echo "" - $as_echo " /* check for a NaN operand: */" + AS_ECHO([""]) + AS_ECHO([" /* check for a NaN operand: */"]) if $monadic; then nanf=monadic; src1= ; else nanf=dyadic; src1=", src1"; fi - $as_echo " if (__tme_predict_false(tme_ieee754_${src0_precision}_check_nan_${nanf}(ieee754_ctl, src0${src1}, dst))) {" - $as_echo " return;" - $as_echo " }" + AS_ECHO([" if (__tme_predict_false(tme_ieee754_${src0_precision}_check_nan_${nanf}(ieee754_ctl, src0${src1}, dst))) {"]) + AS_ECHO([" return;"]) + AS_ECHO([" }"]) fi if test "x${check_inf_src0}" != x; then - $as_echo "" - $as_echo " /* if the operand is an infinity: */" - $as_echo " if (tme_ieee754_${precision}_is_inf(src0)) {" - $as_echo "" + AS_ECHO([""]) + AS_ECHO([" /* if the operand is an infinity: */"]) + AS_ECHO([" if (tme_ieee754_${precision}_is_inf(src0)) {"]) + AS_ECHO([""]) case "${check_inf_src0}" in return-nan) - $as_echo " /* return a NaN: */" - $as_echo " dst->tme_float_format = TME_FLOAT_FORMAT_IEEE754_${capprecision};" - $as_echo " dst->tme_float_value_ieee754_${precision} = ieee754_ctl->tme_ieee754_ctl_default_nan_${precision};" - $as_echo " return;" + AS_ECHO([" /* return a NaN: */"]) + AS_ECHO([" dst->tme_float_format = TME_FLOAT_FORMAT_IEEE754_${capprecision};"]) + AS_ECHO([" dst->tme_float_value_ieee754_${precision} = ieee754_ctl->tme_ieee754_ctl_default_nan_${precision};"]) + AS_ECHO([" return;"]) ;; esac - $as_echo " }" + AS_ECHO([" }"]) fi # enter the operation mode: # if ${enter_softfloat}; then - $as_echo "" - $as_echo " /* enter softfloat operation: */" - $as_echo " tme_mutex_lock(&tme_ieee754_global_mutex);" - $as_echo " tme_ieee754_global_ctl = ieee754_ctl;" - $as_echo " tme_ieee754_global_exceptions = 0;" - $as_echo " ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_ieee754_unlock_softfloat;" + AS_ECHO([""]) + AS_ECHO([" /* enter softfloat operation: */"]) + AS_ECHO([" tme_mutex_lock(&tme_ieee754_global_mutex);"]) + AS_ECHO([" tme_ieee754_global_ctl = ieee754_ctl;"]) + AS_ECHO([" tme_ieee754_global_exceptions = 0;"]) + AS_ECHO([" ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_ieee754_unlock_softfloat;"]) fi if ${enter_native}; then - $as_echo "" - $as_echo " /* enter native floating-point operation: */" - $as_echo " tme_float_enter(ieee754_ctl->tme_ieee754_ctl_rounding_mode, tme_ieee754_exception_float, ieee754_ctl);" - $as_echo " ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_float_leave;" + AS_ECHO([""]) + AS_ECHO([" /* enter native floating-point operation: */"]) + AS_ECHO([" tme_float_enter(ieee754_ctl->tme_ieee754_ctl_rounding_mode, tme_ieee754_exception_float, ieee754_ctl);"]) + AS_ECHO([" ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_float_leave;"]) fi # assume that this operation raises no exceptions: # - $as_echo "" - $as_echo " /* assume that this operation raises no exceptions: */" - $as_echo " exceptions = 0;" + AS_ECHO([""]) + AS_ECHO([" /* assume that this operation raises no exceptions: */"]) + AS_ECHO([" exceptions = 0;"]) # the operation: # - $as_echo "" - $as_echo " /* the operation: */" + AS_ECHO([""]) + AS_ECHO([" /* the operation: */"]) case "${type}" in # a move operation: # *-move) - $as_echo " *dst = *src0;" + AS_ECHO([" *dst = *src0;"]) ;; # a getexp operation: # strict-getexp) - $as_echo "" - $as_echo " /* if the operand is a zero, return a zero: */" - $as_echo " if (tme_ieee754_${precision}_is_zero(src0)) {" - $as_echo " tme_ieee754_${precision}_value_builtin_set(dst, TME_FLOAT_FORMAT_IEEE754_${capprecision}_BUILTIN, 0);" - $as_echo " }" - $as_echo "" - $as_echo " /* otherwise, return the unbiased exponent: */" - $as_echo " else {" - $as_echo " tme_ieee754_${precision}_value_builtin_set(dst, TME_FLOAT_FORMAT_IEEE754_${capprecision}_BUILTIN, TME_FIELD_MASK_EXTRACTU(${op0}${sexp}, ${mask_exp}) - ${exp_bias});" - $as_echo " }" + AS_ECHO([""]) + AS_ECHO([" /* if the operand is a zero, return a zero: */"]) + AS_ECHO([" if (tme_ieee754_${precision}_is_zero(src0)) {"]) + AS_ECHO([" tme_ieee754_${precision}_value_builtin_set(dst, TME_FLOAT_FORMAT_IEEE754_${capprecision}_BUILTIN, 0);"]) + AS_ECHO([" }"]) + AS_ECHO([""]) + AS_ECHO([" /* otherwise, return the unbiased exponent: */"]) + AS_ECHO([" else {"]) + AS_ECHO([" tme_ieee754_${precision}_value_builtin_set(dst, TME_FLOAT_FORMAT_IEEE754_${capprecision}_BUILTIN, TME_FIELD_MASK_EXTRACTU(${op0}${sexp}, ${mask_exp}) - ${exp_bias});"]) + AS_ECHO([" }"]) ;; # a getman operation: # strict-getman) - $as_echo "" - $as_echo " /* if the operand is a zero, return it: */" - $as_echo " if (tme_ieee754_${precision}_is_zero(src0)) {" - $as_echo " *dst = *src0;" - $as_echo " }" - $as_echo "" - $as_echo " /* otherwise, return the operand, with its exponent set to biased zero: */" - $as_echo " else {" - $as_echo " tme_ieee754_${precision}_value_set(dst, ${op0});" - $as_echo " TME_FIELD_MASK_DEPOSITU(dst->tme_float_value_ieee754_${precision}${sexp}, ${mask_exp}, ${exp_bias});" - $as_echo " }" + AS_ECHO([""]) + AS_ECHO([" /* if the operand is a zero, return it: */"]) + AS_ECHO([" if (tme_ieee754_${precision}_is_zero(src0)) {"]) + AS_ECHO([" *dst = *src0;"]) + AS_ECHO([" }"]) + AS_ECHO([""]) + AS_ECHO([" /* otherwise, return the operand, with its exponent set to biased zero: */"]) + AS_ECHO([" else {"]) + AS_ECHO([" tme_ieee754_${precision}_value_set(dst, ${op0});"]) + AS_ECHO([" TME_FIELD_MASK_DEPOSITU(dst->tme_float_value_ieee754_${precision}${sexp}, ${mask_exp}, ${exp_bias});"]) + AS_ECHO([" }"]) ;; # a strict to-integer conversion operation: # strict-to_int32 | strict-to_int64) - $as_echo " *dst = ${precision_sf}_${name}(${op0});" + AS_ECHO([" *dst = ${precision_sf}_${name}(${op0});"]) ;; # a softfloat operation: # softfloat) - $as_echo " _tme_ieee754_${precision}_value_set(dst, ${precision_sf}," + AS_ECHO([" _tme_ieee754_${precision}_value_set(dst, ${precision_sf},"]) func_softfloat_raw="${func_softfloat}" - func_softfloat=`$as_echo ${func_softfloat} | sed -e "s/OP0_PRECISION_SF/${op0_precision_sf}/g"` - func_softfloat=`$as_echo ${func_softfloat} | sed -e "s/OP1_PRECISION_SF/${op1_precision_sf}/g"` + func_softfloat=`AS_ECHO([${func_softfloat}]) | sed -e "s/OP0_PRECISION_SF/${op0_precision_sf}/g"` + func_softfloat=`AS_ECHO([${func_softfloat}]) | sed -e "s/OP1_PRECISION_SF/${op1_precision_sf}/g"` if test "${func_softfloat}" = "${func_softfloat_raw}"; then func_softfloat="${precision_sf}_${func_softfloat}" fi - $as_echo_n " ${func_softfloat}(${op0}" + AS_ECHO_N([" ${func_softfloat}(${op0}"]) if test "x${op1}" != x; then - $as_echo "," - $as_echo_n " ${op1}" + AS_ECHO([","]) + AS_ECHO_N([" ${op1}"]) fi - $as_echo "));" + AS_ECHO(["));"]) ;; # a libm operation: @@ -560,24 +560,24 @@ for level in ${levels}; do # if there is a float variant of this libm function: # if ${func_libm_has_f}; then - $as_echo "#if (TME_FLOAT_FORMAT_IEEE754_${capprecision}_BUILTIN == TME_FLOAT_FORMAT_FLOAT)" - $as_echo " tme_ieee754_${precision}_value_builtin_set(dst, TME_FLOAT_FORMAT_FLOAT, ${func_libm}f(${ops}));" - $as_echo "#else /* (TME_FLOAT_FORMAT_IEEE754_${capprecision}_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */" + AS_ECHO(["#if (TME_FLOAT_FORMAT_IEEE754_${capprecision}_BUILTIN == TME_FLOAT_FORMAT_FLOAT)"]) + AS_ECHO([" tme_ieee754_${precision}_value_builtin_set(dst, TME_FLOAT_FORMAT_FLOAT, ${func_libm}f(${ops}));"]) + AS_ECHO(["#else /* (TME_FLOAT_FORMAT_IEEE754_${capprecision}_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */"]) fi - $as_echo " tme_ieee754_${precision}_value_builtin_set(dst, TME_FLOAT_FORMAT_DOUBLE, ${func_libm}(${ops}));" + AS_ECHO([" tme_ieee754_${precision}_value_builtin_set(dst, TME_FLOAT_FORMAT_DOUBLE, ${func_libm}(${ops}));"]) if ${func_libm_has_f}; then - $as_echo "#endif /* (TME_FLOAT_FORMAT_IEEE754_${capprecision}_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */" + AS_ECHO(["#endif /* (TME_FLOAT_FORMAT_IEEE754_${capprecision}_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */"]) fi ;; # a builtin operation: # builtin) - $as_echo " tme_ieee754_${precision}_value_builtin_set(dst, TME_FLOAT_FORMAT_IEEE754_${capprecision}_BUILTIN, ${op0} ${op_builtin} ${op1});" + AS_ECHO([" tme_ieee754_${precision}_value_builtin_set(dst, TME_FLOAT_FORMAT_IEEE754_${capprecision}_BUILTIN, ${op0} ${op_builtin} ${op1});"]) ;; *) - $as_echo "$PROG internal error: don't know how to generate a ${type} type operation" 1>&2 + AS_ECHO(["$PROG internal error: don't know how to generate a ${type} type operation"]) 1>&2 exit 1 ;; esac @@ -585,36 +585,36 @@ for level in ${levels}; do # leave the operation mode: # if ${enter_native}; then - $as_echo "" - $as_echo " /* leave native floating-point operation: */" - $as_echo " exceptions |= tme_float_leave();" + AS_ECHO([""]) + AS_ECHO([" /* leave native floating-point operation: */"]) + AS_ECHO([" exceptions |= tme_float_leave();"]) fi if ${enter_softfloat}; then - $as_echo "" - $as_echo " /* leave softfloat operation: */" - $as_echo " tme_ieee754_global_ctl = NULL;" - $as_echo " exceptions |= tme_ieee754_global_exceptions;" - $as_echo " tme_mutex_unlock(&tme_ieee754_global_mutex);" + AS_ECHO([""]) + AS_ECHO([" /* leave softfloat operation: */"]) + AS_ECHO([" tme_ieee754_global_ctl = NULL;"]) + AS_ECHO([" exceptions |= tme_ieee754_global_exceptions;"]) + AS_ECHO([" tme_mutex_unlock(&tme_ieee754_global_mutex);"]) fi - $as_echo " ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;" + AS_ECHO([" ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;"]) # signal any exceptions: # - $as_echo "" - $as_echo " /* signal any exceptions: */" - $as_echo " if (exceptions != 0) {" - $as_echo " (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);" - $as_echo " }" + AS_ECHO([""]) + AS_ECHO([" /* signal any exceptions: */"]) + AS_ECHO([" if (exceptions != 0) {"]) + AS_ECHO([" (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);"]) + AS_ECHO([" }"]) # end the function: # - $as_echo "}" + AS_ECHO(["}"]) # close any conditional: # if test "${cond}" != 1; then - $as_echo "" - $as_echo "#endif /* ${cond} */" + AS_ECHO([""]) + AS_ECHO(["#endif /* ${cond} */"]) fi fi @@ -636,9 +636,9 @@ for level in ${levels}; do # if we're making a set: # if test ${what} = set; then - $as_echo "" - $as_echo " /* this does a ${level} compliance ${precision}-precision ${name}: */" - $as_echo "${func_set}" | tr '@' '\n' + AS_ECHO([""]) + AS_ECHO([" /* this does a ${level} compliance ${precision}-precision ${name}: */"]) + AS_ECHO(["${func_set}"]) | tr '@' '\n' fi done @@ -652,7 +652,7 @@ for level in ${levels}; do # operations struct type: # if test "${level}-${what}" = strict-funcs; then - $as_echo "};" + AS_ECHO(["};"]) fi # otherwise, if we're doing a set: @@ -661,7 +661,7 @@ for level in ${levels}; do # close the operations set for this level: # - $as_echo "};" + AS_ECHO(["};"]) fi done @@ -672,29 +672,29 @@ done # if $header; then :; else - $as_echo "" - $as_echo "/* this looks up an operations structure: */" - $as_echo "const struct tme_ieee754_ops *" - $as_echo "tme_ieee754_ops_lookup(const char *compliance)" - $as_echo "{" - $as_echo "" + AS_ECHO([""]) + AS_ECHO(["/* this looks up an operations structure: */"]) + AS_ECHO(["const struct tme_ieee754_ops *"]) + AS_ECHO(["tme_ieee754_ops_lookup(const char *compliance)"]) + AS_ECHO(["{"]) + AS_ECHO([""]) for level in ${levels}; do - $as_echo " if (TME_ARG_IS(compliance, \"${level}\")) { " - $as_echo " return (&tme_ieee754_ops_${level});" - $as_echo " }" + AS_ECHO([" if (TME_ARG_IS(compliance, \"${level}\")) { "]) + AS_ECHO([" return (&tme_ieee754_ops_${level});"]) + AS_ECHO([" }"]) done - $as_echo " return (NULL);" - $as_echo "}" + AS_ECHO([" return (NULL);"]) + AS_ECHO(["}"]) - $as_echo "" - $as_echo "/* this is a compliance options string: */" - $as_echo_n "const char * const tme_ieee754_compliance_options = \"{ "; + AS_ECHO([""]) + AS_ECHO(["/* this is a compliance options string: */"]) + AS_ECHO_N(["const char * const tme_ieee754_compliance_options = \"{ "]); sep= for level in ${levels}; do - $as_echo_n "${sep}${level}" + AS_ECHO_N(["${sep}${level}"]) sep=' | ' done - $as_echo " }\";" + AS_ECHO([" }\";"]) fi # done: diff --git a/ic/ieee754/ieee754-precision.m4 b/ic/ieee754/ieee754-precision.m4 index ceb38fa..f4533a9 100644 --- a/ic/ieee754/ieee754-precision.m4 +++ b/ic/ieee754/ieee754-precision.m4 @@ -118,23 +118,23 @@ esac # to avoid integer overflow warnings, make sure that the exponent # mask is always unsigned: # -$as_echo ${prefix}'mask_exp="((tme_uint32_t) ${'${prefix}'mask_exp})" ;' +AS_ECHO([${prefix}'mask_exp="((tme_uint32_t) ${'${prefix}'mask_exp})" ;']) # a mask for the sign bit can be derived from the exponent mask: # -$as_echo ${prefix}'mask_sign="(${'${prefix}'mask_exp} + _TME_FIELD_MASK_FACTOR(${'${prefix}'mask_exp}))" ; ' +AS_ECHO([${prefix}'mask_sign="(${'${prefix}'mask_exp} + _TME_FIELD_MASK_FACTOR(${'${prefix}'mask_exp}))" ; ']) # the maximum biased exponent can be derived from the exponent mask: # -$as_echo ${prefix}'exp_biased_max="(${'${prefix}'mask_exp} / _TME_FIELD_MASK_FACTOR(${'${prefix}'mask_exp}))" ; ' +AS_ECHO([${prefix}'exp_biased_max="(${'${prefix}'mask_exp} / _TME_FIELD_MASK_FACTOR(${'${prefix}'mask_exp}))" ; ']) # the exponent bias can be derived from the maximum biased exponent: # -$as_echo ${prefix}'exp_bias="(${'${prefix}'exp_biased_max} >> 1)" ; ' +AS_ECHO([${prefix}'exp_bias="(${'${prefix}'exp_biased_max} >> 1)" ; ']) # make a capitalized version of the precision name: # -$as_echo ${prefix}'capprecision=`$as_echo ${precision} | tr a-z A-Z` ; ' +AS_ECHO([${prefix}'capprecision=`AS_ECHO([${precision}]) | tr a-z A-Z` ; ']) # done: # -- 2.47.0
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor