This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
store double-cvtd-to-int to memory
- From: Dale Johannesen <dalej at apple dot com>
- To: David Edelsohn <dje at watson dot ibm dot com>, gcc at gcc dot gnu dot org
- Cc: Dale Johannesen <dalej at apple dot com>
- Date: Wed, 12 Mar 2003 17:45:36 -0800
- Subject: store double-cvtd-to-int to memory
I'm trying to get PPC to generate a more efficient sequence for the
case where you want to put the result of double-to-int conversion in
memory, and don't need it in a register. The normal code looks
like cvt in FP reg, store to temp mem, load to int reg, store to
the real location. There is an instruction to do it directly,
though, without going through temp mem. I thought getting
combine to do it looked right, and wrote this pattern, which is
just fix_truncdfsi2 with the result fed into a store:
[(set (match_operand:SI 0 "memory_operand" "=m")
(fix:SI (match_operand:DF 1 "gpc_reg_operand" "f")))
(clobber (match_operand:DI 2 "gpc_reg_operand" "=f"))
(clobber (match_operand:DI 3 "memory_operand" "=o"))]
where op3 is a stack temp.
Unfortunately combine refuses to generate this pattern; it is afraid
the two parallel memory_operands might conflict (which we can see they
don't), and doesn't even attempt to do alias checking. So what is Plan
B?
Putting alias checking into combine seems like a big hammer (for that
matter, I don't think there's enough alias info in the stack-temp to
get this right anyway). Is there an alternative general approach?