On 2/29/24 06:28, Robin Dapp wrote:
On 2/29/24 02:38, Li, Pan2 wrote:
So it's going to check if V2SF can be tied to DI and V4QI with SI. I
suspect those are going to fail for RISC-V as those aren't tieable.
Yes, you are right. Different REG_CLASS are not allowed to be tieable in RISC-V.
static bool
riscv_modes_tieable_p (machine_mode mode1, machine_mode mode2)
{
/* We don't allow different REG_CLASS modes tieable since it
will cause ICE in register allocation (RA).
E.g. V2SI and DI are not tieable. */
if (riscv_v_ext_mode_p (mode1) != riscv_v_ext_mode_p (mode2))
return false;
return (mode1 == mode2
|| !(GET_MODE_CLASS (mode1) == MODE_FLOAT
&& GET_MODE_CLASS (mode2) == MODE_FLOAT));
}
Yes, but what we set tieable is e.g. V4QI and V2SF.
But in the case of a vector modes, we can usually reinterpret the
underlying bits in whatever mode we want and do any of the usual
operations on those bits.
In my mind that's fundamentally different than the int vs fp case. If
we have an integer value in an FP register, we can't really operate on
the value in any sensible way without first copying it over to the
integer register file and vice-versa.
Jeff