On 25/03/13 06:00, Pinski, Andrew wrote:
Yes I know what you want to do but I think this is better to without adding a new tree code. You want to expand the following: a = x < y c = z ? a : b
Where a is only used in the assignment of a.
I think this is better to add target specific hook for doing expansions which are complex and only effect one target.
Two (at least).
Then the patch becomes almost all target specific and no longer need to add a new tree code which is only good for the arm target.
Not necessarily. It's often easier to lower something more specific into general code when that feature isn't present that to optimize for it by identifying specific patterns when it is. The existing code stands almost no chance of being able to deal with repeated conditional comparison operations, it just gets too hairy.
R.
Thanks, Andrew ________________________________________ From: Zhenqiang Chen [zhenqiang.chen@linaro.org] Sent: Sunday, March 24, 2013 9:34 PM To: Pinski, Andrew Cc: linaro-toolchain Subject: Re: [ACTIVITY] Week 12
On 25 March 2013 12:05, Pinski, Andrew Andrew.Pinski@caviumnetworks.com wrote:
- Investigate how to expand conditional compare GIMPLE to RTL and emit asm.
I think maybe we should start adding target specific expanders. Then all you need to do is take that expander and when you get a COND_EXPR and then looks at TRE provided information which then can exapnd the conditional compare without adding a new tree code. Note I think this should be discussed on the GCC list directly anyways rather than on the linaro form because it is more likely be accepted if talked about there.
Thanks for the comments.
The "conditional compare" mentioned here is a different from COND_EXPR. If my understanding is correct,
COND_EXPR is for "c1? v1: v2"
"conditional compare" here is to represent the second operand of short-circuit, e.g. TRUTH_ANDIF_EXPR. It is more like "c1? CMP (v1, v2): c1"
It is just a CMP (GT, NE, etc)_EXPR if ignoring the "conditional" part.
Agree with you, we should discuss it on GCC list. But before that, I want a prototype and estimate the efforts.
Thanks! -Zhenqiang
linaro-toolchain mailing list linaro-toolchain@lists.linaro.org http://lists.linaro.org/mailman/listinfo/linaro-toolchain