------- Comment #5 from ubizjak at gmail dot com 2008-05-07 13:33 ------- The problem with memory operands has been fixed by the patch, so we generate optimal one insn sequence for both functions in:
--cut here-- #include <emmintrin.h> extern __m128i a; __m128i madd (__m128i b) { return _mm_madd_epi16(a, b); } __m128i madd_swapped (__m128i b) { return _mm_madd_epi16(b, a); } --cut here-- Original testcase passes immediate operand to expanders. Since immediates don't satisfy insn operand constraints, we move them to the register. Since there is no direct imm->reg load insn for V4SF, they are first pushed to memory and then loaded to register. To solve this problem, we should push immediates to the memory in case insn supports memory operands. Alternatively, we can perhaps find original memory location (if available) and pass this location to the expander. -- ubizjak at gmail dot com changed: What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|unassigned at gcc dot gnu |ubizjak at gmail dot com |dot org | Status|UNCONFIRMED |ASSIGNED Ever Confirmed|0 |1 Last reconfirmed|0000-00-00 00:00:00 |2008-05-07 13:33:55 date| | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35714