2016-04-29 12:48 GMT+03:00 Uros Bizjak <ubiz...@gmail.com>: > On Thu, Apr 28, 2016 at 12:36 PM, Ilya Enkovich <enkovich....@gmail.com> > wrote: > >> That's what I have in my draft for DImode immediates: >> >> @@ -3114,6 +3123,20 @@ scalar_chain::build (bitmap candidates, >> unsigned insn_uid) >> BITMAP_FREE (queue); >> } >> >> +/* Return a cost of building a vector costant >> + instead of using a scalar one. */ >> + >> +int >> +scalar_chain::vector_const_cost (rtx exp) >> +{ >> + gcc_assert (CONST_INT_P (exp)); >> + >> + if (const0_operand (exp, GET_MODE (exp)) >> + || constm1_operand (exp, GET_MODE (exp))) > > The above should just use > > standard_sse_constant_p (exp, V2DImode).
Thanks for the tip! Surprisingly this replacement caused a different cost for non-standard constants. Looking at it in GDB I found: (gdb) p exp $3 = (rtx) 0x7ffff7f0b560 (gdb) pr warning: Expression is not an assignment (and might have no effect) (const_int -1085102592571150096 [0xf0f0f0f0f0f0f0f0]) (gdb) p constm1_operand (exp,GET_MODE (exp)) $4 = 1 Do I misuse constm1_operand? Thanks, Ilya > > Uros.