On Fri, Apr 29, 2016 at 1:26 PM, Ilya Enkovich <enkovich....@gmail.com> wrote: > 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?
No, it is just a typo that crept in constm1_operand: ;; Match exactly -1. (define_predicate "constm1_operand" (and (match_code "const_int") (match_test "op = constm1_rtx"))) There should be a test, not an assignment. Uros.