[Patch] Add support for IEEE-conformant versions of scalar fmin* and fmax*

David Sherwood david.sherwood@arm.com
Mon Jun 29 08:44:00 GMT 2015


Hi,

I have added new STRICT_MAX_EXPR and STRICT_MIN_EXPR expressions to support the
IEEE versions of fmin and fmax. This is done by recognising the math library
"fmax" and "fmin" builtin functions in a similar way to how this is done for
-ffast-math. This also allows us to vectorise the IEEE max/min functions for
targets that support it, for example aarch64/aarch32.

Tested:

x86_64-linux: no regressions
aarch64-none-elf: no regressions
aarch64_be-none-elf: no regressions
arm-none-eabi: no regressions

ChangeLog:

    2015-06-26  David Sherwood  <david.sherwood@arm.com>

    gcc/
        * builtins.c (integer_valued_real_p): Add STRICT_MIN_EXPR and
        STRICT_MAX_EXPR.
        (fold_builtin_fmin_fmax): For strict math, convert builting fmin and 
        fmax to STRICT_MIN_EXPR and STRICT_MIN_EXPR, respectively.
        * expr.c (expand_expr_real_2): Add STRICT_MIN_EXPR and STRICT_MAX_EXPR.
        * fold-const.c (const_binop): Likewise.
        (fold_binary_loc, tree_binary_nonnegative_warnv_p): Likewise.
        (tree_binary_nonzero_warnv_p): Likewise.
        * optabs.h (strict_minmax_support): Declare.
        * optabs.def: Add new optabs strict_max_optab/strict_min_optab.
        * optabs.c (optab_for_tree_code): Return new optabs for STRICT_MIN_EXPR
        and STRICT_MAX_EXPR.
        (strict_minmax_support): New function.
        * real.c (real_arithmetic): Add STRICT_MIN_EXPR and STRICT_MAX_EXPR.
        * tree.def: Likewise.
        * tree.c (associative_tree_code, commutative_tree_code): Likewise.
        * tree-cfg.c (verify_expr): Likewise.
        (verify_gimple_assign_binary): Likewise.
        * tree-inline.c (estimate_operator_cost): Likewise.
        * tree-pretty-print.c (dump_generic_node, op_code_prio): Likewise.
        (op_symbol_code): Likewise.
        * config/aarch64/aarch64.md: New pattern.
        * config/aarch64/aarch64-simd.md: Likewise.
        * config/aarch64/iterators.md: New unspecs, iterators.
        * config/arm/iterators.md: New iterators.
        * config/arm/unspecs.md: New unspecs.
        * config/arm/neon.md: New pattern.
        * config/arm/vfp.md: Likewise.
    gcc/testsuite
        * gcc.target/aarch64/maxmin_strict.c: New test.
        * gcc.target/arm/maxmin_strict.c: New test.
        * lib/target-supports.exp
        (check_effective_target_arm_v8_vfp_neon_ok): New check.
        (add_options_for_arm_v8_vfp_neon): New options.

Regards,
David Sherwood.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch
Type: application/octet-stream
Size: 20208 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20150629/e74a26e8/attachment.obj>


More information about the Gcc-patches mailing list