On 6/26/23 08:26, Robin Dapp via Gcc-patches wrote:
Hi,

this patch changes TYPE_MODE into element_mode in a match.pd
simplification.  As the simplification can be called with vector types
real_can_shorten_arithmetic would ICE in REAL_MODE_FORMAT which
expects a scalar mode.  Therefore, use element_mode instead of
TYPE_MODE.

Additionally, check if the target supports the resulting operation in the
new mode.  One target that supports e.g. a float addition but not a
_Float16 addition is the RISC-V vector Float16 extension Zvfhmin.

Bootstrap on x86_64 succeeded, testsuite is currently running.  Is this OK
if the testsuite is clean?

Regards
  Robin

gcc/ChangeLog:

        * match.pd: Use element_mode and check if target supports
        operation with new type.
Ugh. What a mess -- not helped by the fact the code is poorly indented. Indention would lead one to believe this is guarded by the integral type test.


+                  && target_supports_op_p (newtype, op, optab_default)
FWIW, I think there are other targets that support various 16bit FP modes, but not the full complement of operations. It was fairly common when the 16bit FP modes were first landing.


OK after the usual bootstrap & testing.

jeff

Reply via email to