在 2023/11/23 下午5:02, Xi Ruoyao 写道:
On Thu, 2023-11-23 at 16:13 +0800, chenglulu wrote:
The fix_truncv4sfv4si2 template is indeed called when debugging with
gdb.
So I think we can use define_expand here.
The problem is cases where we want to combine an rint call with float-
to-int conversion:
float x[4];
int y[4];
void test()
{
for (int i = 0; i < 4; i++)
y[i] = __builtin_rintf(x[i]);
}
With define_expand we get "vfrint + vftintrz", but with define_insn we
get a single "vftint".
Arguably the generic code should try to handle this (PR86609), but it's
"not sure if that's a good idea in general" (comment 1 in the PR) so we
can do this in a target-specific way.
I tried to use Ofast to compile, and found that a vftint was generated,
and at.006t.gimple appeared.
If O2 was compiled, __builtin_rintf would be generated, but Ofast would
generate __builtin_irintf