On Tue, Oct 29, 2013 at 10:34 AM, Uros Bizjak <ubiz...@gmail.com> wrote: > On Tue, Oct 29, 2013 at 6:18 PM, Cong Hou <co...@google.com> wrote: > >>>> For the define_expand I added as below, the else body is there to >>>> avoid fall-through transformations to ABS operation in optabs.c. >>>> Otherwise ABS will be converted to other operations even that we have >>>> corresponding instructions from SSSE3. >>> >>> No, it wont be. >>> >>> Fallthrough will generate the pattern that will be matched by the insn >>> pattern above, just like you are doing by hand below. >> >> >> I think the case is special for abs(). In optabs.c, there is a >> function expand_abs() in which the function expand_abs_nojump() is >> called. This function first tries the expand function defined for the >> target and if it fails it will try max(v, -v) then shift-xor-sub >> method. If I don't generate any instruction for SSSE3, the >> fall-through will be max(v, -v). I have tested it on my machine. > > Huh, strange. > > Then you can rename previous pattern to abs<mode>2_1 and call it from > the new expander instead of expanding it manually. Please also add a > small comment, describing the situation to prevent future > "optimizations" in this place.
Could you tell me how to do that? The renamed pattern abs<mode>2_1 is also a "define_expand"? How to call this expander? Thank you! Cong > > Thanks, > Uros.