[PATCH] [hexagon] remove sxth after max with two halfword operands

iajbar at codeaurora.org iajbar at codeaurora.org
Mon Feb 4 09:47:15 PST 2013


I put these intrinsics in Hexagon.td because they take an intrinsic and an
SD node. Maybe I should move them to HexagonIntrinsicsOpt.td and include
it after the instruction and intrinsics td files.

Thanks,
Ikhlas


> Also, is there a reason for defining these intrinsics in Hexagon.td
> instead
> of HexagonIntrinsics.td?
>
> +//===----------------------------------------------------------------------
> ===//
> +// DAG to DAG optimizations: this section needs to be after including
> +// HexagonInstrInfo.td and HexagonIntrinsics.td.
> +//===----------------------------------------------------------------------
> ===//
> +
> +class sextMinMaxIntrinsic<Intrinsic Op, InstHexagon Inst> :
> +  Pat<(i32 (sext_inreg (i32 (Op (i32 PositiveHalfWord:$a),
> +                                (i32 PositiveHalfWord:$b))),
> +                       i16)),
> +      (i32 (Inst (i32 IntRegs:$a), (i32 IntRegs:$b)))>;
> +
> +
> +def : sextMinMaxIntrinsic<int_hexagon_A2_max, HEXAGON_A2_max>;
> +def : sextMinMaxIntrinsic<int_hexagon_A2_maxu, HEXAGON_A2_maxu>;
> +def : sextMinMaxIntrinsic<int_hexagon_A2_min, HEXAGON_A2_min>;
> +def : sextMinMaxIntrinsic<int_hexagon_A2_minu, HEXAGON_A2_minu>;
>
> -Jyotsna
> --
> Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted
> by
> The Linux Foundation
>
>
>> -----Original Message-----
>> From: Ikhlas Ajbar [mailto:iajbar at codeaurora.org]
>> Sent: Tuesday, January 29, 2013 9:55 PM
>> To: llvm-commits at cs.uiuc.edu
>> Cc: iajbar at codeaurora.org; jverma at codeaurora.org;
>> adasgupt at codeaurora.org
>> Subject: [PATCH] [hexagon] remove sxth after max with two halfword
>> operands
>>
>> Hello,
>>
>> The attached patch improves the way min and max instructions are
>> generated to recognize more patterns. In particular, this patch was
>> needed
>> to remove a sign extend halfword "sxth" after a max with two halfword
>> operands: testcases attached.
>>
>> Tested on x86-linux with make check. Could you please review the patch?
>>
>> Thanks,
>> Ikhlas
>
>





More information about the llvm-commits mailing list