//===- HexagonIntrinsicsV60.td - V60 instruction intrinsics -*- tablegen *-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // // This file describes the Hexagon V60 Compiler Intrinsics in TableGen format. // //===----------------------------------------------------------------------===// let AddedComplexity = 100 in { def : Pat < (v16i32 (int_hexagon_V6_lo (v32i32 HvxWR:$src1))), (v16i32 (EXTRACT_SUBREG (v32i32 HvxWR:$src1), vsub_lo)) >; def : Pat < (v16i32 (int_hexagon_V6_hi (v32i32 HvxWR:$src1))), (v16i32 (EXTRACT_SUBREG (v32i32 HvxWR:$src1), vsub_hi)) >; def : Pat < (v32i32 (int_hexagon_V6_lo_128B (v64i32 HvxWR:$src1))), (v32i32 (EXTRACT_SUBREG (v64i32 HvxWR:$src1), vsub_lo)) >; def : Pat < (v32i32 (int_hexagon_V6_hi_128B (v64i32 HvxWR:$src1))), (v32i32 (EXTRACT_SUBREG (v64i32 HvxWR:$src1), vsub_hi)) >; } def : Pat <(v64i1 (bitconvert (v16i32 HvxVR:$src1))), (v64i1 (V6_vandvrt(v16i32 HvxVR:$src1), (A2_tfrsi 0x01010101)))>; def : Pat <(v64i1 (bitconvert (v32i16 HvxVR:$src1))), (v64i1 (V6_vandvrt(v32i16 HvxVR:$src1), (A2_tfrsi 0x01010101)))>; def : Pat <(v64i1 (bitconvert (v64i8 HvxVR:$src1))), (v64i1 (V6_vandvrt(v64i8 HvxVR:$src1), (A2_tfrsi 0x01010101)))>; def : Pat <(v16i32 (bitconvert (v64i1 HvxQR:$src1))), (v16i32 (V6_vandqrt(v64i1 HvxQR:$src1), (A2_tfrsi 0x01010101)))>; def : Pat <(v32i16 (bitconvert (v64i1 HvxQR:$src1))), (v32i16 (V6_vandqrt(v64i1 HvxQR:$src1), (A2_tfrsi 0x01010101)))>; def : Pat <(v64i8 (bitconvert (v64i1 HvxQR:$src1))), (v64i8 (V6_vandqrt(v64i1 HvxQR:$src1), (A2_tfrsi 0x01010101)))>; def : Pat <(v128i1 (bitconvert (v32i32 HvxVR:$src1))), (v128i1 (V6_vandvrt (v32i32 HvxVR:$src1), (A2_tfrsi 0x01010101)))>; def : Pat <(v128i1 (bitconvert (v64i16 HvxVR:$src1))), (v128i1 (V6_vandvrt (v64i16 HvxVR:$src1), (A2_tfrsi 0x01010101)))>; def : Pat <(v128i1 (bitconvert (v128i8 HvxVR:$src1))), (v128i1 (V6_vandvrt (v128i8 HvxVR:$src1), (A2_tfrsi 0x01010101)))>; def : Pat <(v32i32 (bitconvert (v128i1 HvxQR:$src1))), (v32i32 (V6_vandqrt (v128i1 HvxQR:$src1), (A2_tfrsi 0x01010101)))>; def : Pat <(v64i16 (bitconvert (v128i1 HvxQR:$src1))), (v64i16 (V6_vandqrt (v128i1 HvxQR:$src1), (A2_tfrsi 0x01010101)))>; def : Pat <(v128i8 (bitconvert (v128i1 HvxQR:$src1))), (v128i8 (V6_vandqrt (v128i1 HvxQR:$src1), (A2_tfrsi 0x01010101)))>; let AddedComplexity = 140 in { def : Pat <(store (v64i1 HvxQR:$src1), (i32 IntRegs:$addr)), (V6_vS32b_ai IntRegs:$addr, 0, (v16i32 (V6_vandqrt (v64i1 HvxQR:$src1), (A2_tfrsi 0x01010101))))>; def : Pat <(v64i1 (load (i32 IntRegs:$addr))), (v64i1 (V6_vandvrt (v16i32 (V6_vL32b_ai IntRegs:$addr, 0)), (A2_tfrsi 0x01010101)))>; def : Pat <(store (v128i1 HvxQR:$src1), (i32 IntRegs:$addr)), (V6_vS32b_ai IntRegs:$addr, 0, (v32i32 (V6_vandqrt (v128i1 HvxQR:$src1), (A2_tfrsi 0x01010101))))>; def : Pat <(v128i1 (load (i32 IntRegs:$addr))), (v128i1 (V6_vandvrt (v32i32 (V6_vL32b_ai IntRegs:$addr, 0)), (A2_tfrsi 0x01010101)))>; } multiclass T_R_pat { def: Pat<(IntID IntRegs:$src1), (MI IntRegs:$src1)>; def: Pat<(!cast(IntID#"_128B") IntRegs:$src1), (MI IntRegs:$src1)>; } multiclass T_V_pat { def: Pat<(IntID HvxVR:$src1), (MI HvxVR:$src1)>; def: Pat<(!cast(IntID#"_128B") HvxVR:$src1), (MI HvxVR:$src1)>; } multiclass T_W_pat { def: Pat<(IntID HvxWR:$src1), (MI HvxWR:$src1)>; def: Pat<(!cast(IntID#"_128B") HvxWR:$src1), (MI HvxWR:$src1)>; } multiclass T_Q_pat { def: Pat<(IntID HvxQR:$src1), (MI HvxQR:$src1)>; def: Pat<(!cast(IntID#"_128B") HvxQR:$src1), (MI HvxQR:$src1)>; } multiclass T_WR_pat { def: Pat<(IntID HvxWR:$src1, IntRegs:$src2), (MI HvxWR:$src1, IntRegs:$src2)>; def: Pat<(!cast(IntID#"_128B")HvxWR:$src1, IntRegs:$src2), (MI HvxWR:$src1, IntRegs:$src2)>; } multiclass T_VR_pat { def: Pat<(IntID HvxVR:$src1, IntRegs:$src2), (MI HvxVR:$src1, IntRegs:$src2)>; def: Pat<(!cast(IntID#"_128B")HvxVR:$src1, IntRegs:$src2), (MI HvxVR:$src1, IntRegs:$src2)>; } multiclass T_WV_pat { def: Pat<(IntID HvxWR:$src1, HvxVR:$src2), (MI HvxWR:$src1, HvxVR:$src2)>; def: Pat<(!cast(IntID#"_128B") HvxWR:$src1, HvxVR:$src2), (MI HvxWR:$src1, HvxVR:$src2)>; } multiclass T_WW_pat { def: Pat<(IntID HvxWR:$src1, HvxWR:$src2), (MI HvxWR:$src1, HvxWR:$src2)>; def: Pat<(!cast(IntID#"_128B") HvxWR:$src1, HvxWR:$src2), (MI HvxWR:$src1, HvxWR:$src2)>; } multiclass T_VV_pat { def: Pat<(IntID HvxVR:$src1, HvxVR:$src2), (MI HvxVR:$src1, HvxVR:$src2)>; def: Pat<(!cast(IntID#"_128B") HvxVR:$src1, HvxVR:$src2), (MI HvxVR:$src1, HvxVR:$src2)>; } multiclass T_QR_pat { def: Pat<(IntID HvxQR:$src1, IntRegs:$src2), (MI HvxQR:$src1, IntRegs:$src2)>; def: Pat<(!cast(IntID#"_128B") HvxQR:$src1, IntRegs:$src2), (MI HvxQR:$src1, IntRegs:$src2)>; } multiclass T_QQ_pat { def: Pat<(IntID HvxQR:$src1, HvxQR:$src2), (MI HvxQR:$src1, HvxQR:$src2)>; def: Pat<(!cast(IntID#"_128B") HvxQR:$src1, HvxQR:$src2), (MI HvxQR:$src1, HvxQR:$src2)>; } multiclass T_WWR_pat { def: Pat<(IntID HvxWR:$src1, HvxWR:$src2, IntRegs:$src3), (MI HvxWR:$src1, HvxWR:$src2, IntRegs:$src3)>; def: Pat<(!cast(IntID#"_128B") HvxWR:$src1, HvxWR:$src2, IntRegs:$src3), (MI HvxWR:$src1, HvxWR:$src2, IntRegs:$src3)>; } multiclass T_VVR_pat { def: Pat<(IntID HvxVR:$src1, HvxVR:$src2, IntRegs:$src3), (MI HvxVR:$src1, HvxVR:$src2, IntRegs:$src3)>; def: Pat<(!cast(IntID#"_128B") HvxVR:$src1, HvxVR:$src2, IntRegs:$src3), (MI HvxVR:$src1, HvxVR:$src2, IntRegs:$src3)>; } multiclass T_WVR_pat { def: Pat<(IntID HvxWR:$src1, HvxVR:$src2, IntRegs:$src3), (MI HvxWR:$src1, HvxVR:$src2, IntRegs:$src3)>; def: Pat<(!cast(IntID#"_128B") HvxWR:$src1, HvxVR:$src2, IntRegs:$src3), (MI HvxWR:$src1, HvxVR:$src2, IntRegs:$src3)>; } multiclass T_VWR_pat { def: Pat<(IntID HvxVR:$src1, HvxWR:$src2, IntRegs:$src3), (MI HvxVR:$src1, HvxWR:$src2, IntRegs:$src3)>; def: Pat<(!cast(IntID#"_128B") HvxVR:$src1, HvxWR:$src2, IntRegs:$src3), (MI HvxVR:$src1, HvxWR:$src2, IntRegs:$src3)>; } multiclass T_VVV_pat { def: Pat<(IntID HvxVR:$src1, HvxVR:$src2, HvxVR:$src3), (MI HvxVR:$src1, HvxVR:$src2, HvxVR:$src3)>; def: Pat<(!cast(IntID#"_128B") HvxVR:$src1, HvxVR:$src2, HvxVR:$src3), (MI HvxVR:$src1, HvxVR:$src2, HvxVR:$src3)>; } multiclass T_WVV_pat { def: Pat<(IntID HvxWR:$src1, HvxVR:$src2, HvxVR:$src3), (MI HvxWR:$src1, HvxVR:$src2, HvxVR:$src3)>; def: Pat<(!cast(IntID#"_128B") HvxWR:$src1, HvxVR:$src2, HvxVR:$src3), (MI HvxWR:$src1, HvxVR:$src2, HvxVR:$src3)>; } multiclass T_QVV_pat { def: Pat<(IntID HvxQR:$src1, HvxVR:$src2, HvxVR:$src3), (MI HvxQR:$src1, HvxVR:$src2, HvxVR:$src3)>; def: Pat<(!cast(IntID#"_128B") HvxQR:$src1, HvxVR:$src2, HvxVR:$src3), (MI HvxQR:$src1, HvxVR:$src2, HvxVR:$src3)>; } multiclass T_VQR_pat { def: Pat<(IntID HvxVR:$src1, HvxQR:$src2, IntRegs:$src3), (MI HvxVR:$src1, HvxQR:$src2, IntRegs:$src3)>; def: Pat<(!cast(IntID#"_128B") HvxVR:$src1, HvxQR:$src2, IntRegs:$src3), (MI HvxVR:$src1, HvxQR:$src2, IntRegs:$src3)>; } multiclass T_QVR_pat { def: Pat<(IntID HvxQR:$src1, HvxVR:$src2, IntRegs:$src3), (MI HvxQR:$src1, HvxVR:$src2, IntRegs:$src3)>; def: Pat<(!cast(IntID#"_128B") HvxQR:$src1, HvxVR:$src2, IntRegs:$src3), (MI HvxQR:$src1, HvxVR:$src2, IntRegs:$src3)>; } multiclass T_VVI_pat { def: Pat<(IntID HvxVR:$src1, HvxVR:$src2, imm:$src3), (MI HvxVR:$src1, HvxVR:$src2, imm:$src3)>; def: Pat<(!cast(IntID#"_128B") HvxVR:$src1, HvxVR:$src2, imm:$src3), (MI HvxVR:$src1, HvxVR:$src2, imm:$src3)>; } multiclass T_WRI_pat { def: Pat<(IntID HvxWR:$src1, IntRegs:$src2, imm:$src3), (MI HvxWR:$src1, IntRegs:$src2, imm:$src3)>; def: Pat<(!cast(IntID#"_128B") HvxWR:$src1, IntRegs:$src2, imm:$src3), (MI HvxWR:$src1, IntRegs:$src2, imm:$src3)>; } multiclass T_WWRI_pat { def: Pat<(IntID HvxWR:$src1, HvxWR:$src2, IntRegs:$src3, imm:$src4), (MI HvxWR:$src1, HvxWR:$src2, IntRegs:$src3, imm:$src4)>; def: Pat<(!cast(IntID#"_128B") HvxWR:$src1, HvxWR:$src2, IntRegs:$src3, imm:$src4), (MI HvxWR:$src1, HvxWR:$src2, IntRegs:$src3, imm:$src4)>; } multiclass T_VVVR_pat { def: Pat<(IntID HvxVR:$src1, HvxVR:$src2, HvxVR:$src3, IntRegs:$src4), (MI HvxVR:$src1, HvxVR:$src2, HvxVR:$src3, IntRegs:$src4)>; def: Pat<(!cast(IntID#"_128B") HvxVR:$src1, HvxVR:$src2, HvxVR:$src3, IntRegs:$src4), (MI HvxVR:$src1, HvxVR:$src2, HvxVR:$src3, IntRegs:$src4)>; } multiclass T_WVVR_pat { def: Pat<(IntID HvxWR:$src1, HvxVR:$src2, HvxVR:$src3, IntRegs:$src4), (MI HvxWR:$src1, HvxVR:$src2, HvxVR:$src3, IntRegs:$src4)>; def: Pat<(!cast(IntID#"_128B") HvxWR:$src1, HvxVR:$src2, HvxVR:$src3, IntRegs:$src4), (MI HvxWR:$src1, HvxVR:$src2, HvxVR:$src3, IntRegs:$src4)>; } defm : T_WR_pat ; defm : T_WR_pat ; defm : T_VR_pat ; defm : T_VR_pat ; defm : T_VR_pat ; defm : T_WR_pat ; defm : T_VR_pat ; defm : T_WR_pat ; defm : T_VR_pat ; defm : T_WR_pat ; defm : T_VR_pat ; defm : T_WR_pat ; defm : T_WR_pat ; defm : T_VR_pat ; defm : T_WR_pat ; defm : T_WR_pat ; defm : T_VR_pat ; defm : T_VR_pat ; defm : T_VR_pat ; defm : T_VR_pat ; defm : T_VR_pat ; defm : T_VR_pat ; defm : T_VR_pat ; defm : T_VR_pat ; defm : T_VR_pat ; defm : T_VR_pat ; defm : T_VR_pat ; defm : T_VR_pat ; defm : T_VR_pat ; defm : T_VR_pat ; defm : T_WR_pat ; defm : T_VR_pat ; defm : T_VV_pat ; defm : T_VV_pat ; defm : T_VV_pat ; defm : T_VV_pat ; defm : T_VV_pat ; defm : T_VV_pat ; defm : T_VV_pat ; defm : T_VV_pat ; defm : T_VV_pat ; defm : T_VV_pat ; defm : T_VV_pat ; defm : T_WW_pat ; defm : T_VV_pat ; defm : T_VV_pat ; defm : T_VV_pat ; defm : T_VV_pat ; defm : T_VV_pat ; defm : T_VV_pat ; defm : T_VV_pat ; defm : T_VV_pat ; defm : T_VV_pat ; defm : T_VV_pat ; defm : T_VV_pat ; defm : T_VV_pat ; defm : T_VV_pat ; defm : T_VV_pat ; defm : T_VV_pat ; defm : T_VV_pat ; defm : T_WW_pat ; defm : T_WW_pat ; defm : T_WW_pat ; defm : T_WW_pat ; defm : T_WW_pat ; defm : T_WW_pat ; defm : T_WW_pat ; defm : T_WW_pat ; defm : T_WW_pat ; defm : T_WW_pat ; defm : T_WW_pat ; defm : T_WW_pat ; defm : T_WW_pat ; defm : T_WW_pat ; defm : T_VV_pat ; defm : T_VV_pat ; defm : T_VV_pat ; defm : T_VV_pat ; defm : T_VV_pat ; defm : T_VV_pat ; defm : T_VV_pat ; defm : T_VV_pat ; defm : T_VV_pat ; defm : T_VV_pat ; defm : T_VV_pat ; defm : T_VV_pat ; defm : T_VV_pat ; defm : T_VV_pat ; defm : T_VV_pat ; defm : T_VV_pat ; defm : T_VV_pat ; defm : T_VV_pat ; defm : T_VV_pat ; defm : T_VV_pat ; defm : T_VV_pat ; defm : T_WW_pat ; defm : T_VVR_pat ; defm : T_VVR_pat ; defm : T_VVR_pat ; defm : T_VVR_pat ; defm : T_VVR_pat ; defm : T_VVR_pat ; defm : T_VVR_pat ; defm : T_VVR_pat ; defm : T_VVR_pat ; defm : T_VVR_pat ; defm : T_VVR_pat ; defm : T_VWR_pat ; defm : T_VWR_pat ; defm : T_WVR_pat ; defm : T_WVR_pat ; defm : T_WVR_pat ; defm : T_WVR_pat ; defm : T_WWR_pat ; defm : T_WWR_pat ; defm : T_WWR_pat ; defm : T_WWR_pat ; defm : T_WWR_pat ; defm : T_WWR_pat ; defm : T_WWR_pat ; defm : T_WWR_pat ; defm : T_VVV_pat ; defm : T_WVV_pat ; defm : T_WVV_pat ; defm : T_WVV_pat ; defm : T_WVV_pat ; defm : T_VVV_pat ; defm : T_VVV_pat ; defm : T_VVV_pat ; defm : T_VVV_pat ; defm : T_VVV_pat ; defm : T_WVV_pat ; defm : T_WVV_pat ; defm : T_VVV_pat ; defm : T_VVV_pat ; defm : T_VVV_pat ; // Compare instructions defm : T_QVV_pat ; defm : T_QVV_pat ; defm : T_QVV_pat ; defm : T_QVV_pat ; defm : T_QVV_pat ; defm : T_QVV_pat ; defm : T_QVV_pat ; defm : T_QVV_pat ; defm : T_QVV_pat ; defm : T_QVV_pat ; defm : T_QVV_pat ; defm : T_QVV_pat ; defm : T_QVV_pat ; defm : T_QVV_pat ; defm : T_QVV_pat ; defm : T_QVV_pat ; defm : T_QVV_pat ; defm : T_QVV_pat ; defm : T_QVV_pat ; defm : T_QVV_pat ; defm : T_QVV_pat ; defm : T_QVV_pat ; defm : T_QVV_pat ; defm : T_QVV_pat ; defm : T_QVV_pat ; defm : T_QVV_pat ; defm : T_QVV_pat ; defm : T_VV_pat ; defm : T_VV_pat ; defm : T_VV_pat ; defm : T_VV_pat ; defm : T_VV_pat ; defm : T_VV_pat ; defm : T_VV_pat ; defm : T_VV_pat ; defm : T_VV_pat ; defm : T_VV_pat ; defm : T_VV_pat ; defm : T_VV_pat ; defm : T_VV_pat ; defm : T_VV_pat ; defm : T_VV_pat ; defm : T_VV_pat ; defm : T_VV_pat ; defm : T_VV_pat ; defm : T_VV_pat ; defm : T_VV_pat ; defm : T_VV_pat ; defm : T_VV_pat ; defm : T_VV_pat ; defm : T_VV_pat ; defm : T_VV_pat ; defm : T_VV_pat ; defm : T_VV_pat ; defm : T_VV_pat ; defm : T_VV_pat ; defm : T_VV_pat ; defm : T_VV_pat ; defm : T_VV_pat ; defm : T_VV_pat ; defm : T_VV_pat ; defm : T_VV_pat ; defm : T_VV_pat ; defm : T_VV_pat ; defm : T_VV_pat ; defm : T_VV_pat ; defm : T_VV_pat ; defm : T_VV_pat ; defm : T_VV_pat ; defm : T_VV_pat ; defm : T_VV_pat ; defm : T_VV_pat ; defm : T_VV_pat ; defm : T_QVV_pat ; defm : T_QVV_pat ; defm : T_QVV_pat ; defm : T_QVV_pat ; defm : T_QVV_pat ; defm : T_QVV_pat ; defm : T_QVV_pat ; defm : T_QVV_pat ; defm : T_QVV_pat ; defm : T_QVV_pat ; defm : T_QVV_pat ; defm : T_QVV_pat ; defm : T_V_pat ; defm : T_V_pat ; defm : T_V_pat ; defm : T_V_pat ; defm : T_V_pat ; defm : T_V_pat ; defm : T_V_pat ; defm : T_V_pat ; defm : T_V_pat ; defm : T_V_pat ; defm : T_V_pat ; defm : T_V_pat ; defm : T_V_pat ; defm : T_V_pat ; defm : T_V_pat ; defm : T_V_pat ; defm : T_V_pat ; defm : T_V_pat ; defm : T_V_pat ; defm : T_V_pat ; defm : T_V_pat ; defm : T_V_pat ; defm : T_V_pat ; defm : T_W_pat ; defm : T_W_pat ; defm : T_W_pat ; defm : T_WRI_pat ; defm : T_WRI_pat ; defm : T_WRI_pat ; defm : T_WWRI_pat ; defm : T_WWRI_pat ; defm : T_WWRI_pat ; // assembler mapped. //defm : T_V_pat ; // not present earlier.. need to add intrinsic defm : T_VVR_pat ; defm : T_VVR_pat ; defm : T_VVR_pat ; defm : T_VVR_pat ; defm : T_VVR_pat ; defm : T_VVR_pat ; defm : T_VVR_pat ; defm : T_VVR_pat ; defm : T_VVR_pat ; defm : T_VVR_pat ; defm : T_VVR_pat ; defm : T_WV_pat ; defm : T_WV_pat ; defm : T_VVI_pat ; defm : T_VVI_pat ; defm : T_QVV_pat ; defm : T_QVV_pat ; defm : T_QQ_pat ; defm : T_QQ_pat ; defm : T_Q_pat ; defm : T_QQ_pat ; defm : T_QQ_pat ; defm : T_QQ_pat ; defm : T_VV_pat ; defm : T_VV_pat ; defm : T_VV_pat ; defm : T_VV_pat ; defm : T_VV_pat ; defm : T_VV_pat ; defm : T_VV_pat ; defm : T_VV_pat ; defm : T_VV_pat ; defm : T_VQR_pat ; defm : T_QVR_pat ; defm : T_QR_pat ; defm : T_R_pat ; defm : T_R_pat ; defm : T_VR_pat ; defm : T_VVR_pat ; defm : T_VVR_pat ; defm : T_VVVR_pat ; defm : T_WVVR_pat ; defm : T_QVR_pat ; def : T_PI_pat ; def : T_RI_pat ; def : T_PPI_pat ; def : T_PPI_pat ; def : T_PPI_pat ; def : T_PPI_pat ; def : T_PPI_pat ; def : T_RRI_pat ; def : T_RRI_pat ; def : T_RRI_pat ; def : T_RRI_pat ; def : T_RRI_pat ; defm : T_VR_pat ; defm : T_VR_pat ; //def : T_PPQ_pat ; def: Pat<(v64i16 (trunc v64i32:$Vdd)), (v64i16 (V6_vpackwh_sat (v32i32 (V6_hi HvxWR:$Vdd)), (v32i32 (V6_lo HvxWR:$Vdd))))>; def: Pat<(int_hexagon_V6_vd0), (V6_vd0)>; def: Pat<(int_hexagon_V6_vd0_128B), (V6_vd0)>;