]> git.ipfire.org Git - thirdparty/gcc.git/commit
match.pd: Use element_mode instead of TYPE_MODE.
authorRobin Dapp <rdapp@ventanamicro.com>
Mon, 26 Jun 2023 11:30:26 +0000 (13:30 +0200)
committerRobin Dapp <rdapp@ventanamicro.com>
Tue, 27 Jun 2023 20:39:26 +0000 (22:39 +0200)
commitd915762ea9043da858d388b60b2d8093ff77eeab
tree40e3bd33d92b317cce2d979f96441149558b4627
parent231f6b56c77c50f337f2529b3ae51e2083ce461d
match.pd: Use element_mode instead of TYPE_MODE.

This patch changes TYPE_MODE into element_mode in a match.pd
simplification.  As the simplification can be also 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.  One
target that supports e.g. a float addition but not a _Float16 addition
is the RISC-V vector extension Zvfhmin.

gcc/ChangeLog:

* match.pd: Use element_mode and check if target supports
operation with new type.
gcc/match.pd