[PATCH 1/n] Add conditional compare support

Joey Ye joey.ye.cc@gmail.com
Mon Nov 4 09:56:00 GMT 2013


+  "TARGET_ARM || TARGET_THUMB2"
TARGET_32BIT

+    static const char *const ite = "it\t%d4";
+    static const int cmp_idx[9] = {0, 0, 1, 0, 1};
s/9/5/

On Wed, Oct 30, 2013 at 5:32 PM, Zhenqiang Chen <zhenqiang.chen@arm.com> wrote:
>
>> -----Original Message-----
>> From: Richard Henderson [mailto:rth@redhat.com]
>> Sent: Monday, October 28, 2013 11:07 PM
>> To: Zhenqiang Chen; Richard Earnshaw; 'Richard Biener'
>> Cc: GCC Patches
>> Subject: Re: [PATCH 1/n] Add conditional compare support
>>
>> On 10/28/2013 01:32 AM, Zhenqiang Chen wrote:
>> > Patch is updated according to your comments. Main changes are:
>> > * Add two hooks: legitimize_cmp_combination and
>> > legitimize_ccmp_combination
>> > * Improve document.
>>
>> No, these are not the hooks I proposed.
>>
>> You should *not* have a ccmp_optab, because the middle-end has
>> absolutely no idea what mode TARGET should be in.
>>
>> The hook needs to return an rtx expression appropriate for feeding to
>> cbranch et al.  E.g. for arm,
>>
>>   (ne (reg:CC_Z CC_REGNUM) (const_int 0))
>>
>> after having emitted the instruction that sets CC_REGNUM.
>>
>> We need to push this to the backend because for ia64 the expression needs
>> to be of te form
>>
>>   (ne (reg:BI new_pseudo) (const_int 0))
>
> Thanks for the clarification.
> Patch is updated:
> * ccmp_optab is removed.
> * Add two hooks gen_ccmp_with_cmp_cmp and gen_ccmp_with_ccmp_cmp for backends to generate the conditional compare instructions.
>
> Thanks!
> -Zhenqiang



More information about the Gcc-patches mailing list