From: Krzysztof Parzyszek Date: Fri, 14 Dec 2018 22:05:44 +0000 (+0000) Subject: [Hexagon] Use IMPLICIT_DEF to any-extend 32-bit values to 64 bits X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cba44d9b38205b8683079ddf5f5f43f0a1bf784e;p=llvm [Hexagon] Use IMPLICIT_DEF to any-extend 32-bit values to 64 bits git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@349199 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/Hexagon/HexagonPatterns.td b/lib/Target/Hexagon/HexagonPatterns.td index fef97ddf419..0a7f578a60f 100644 --- a/lib/Target/Hexagon/HexagonPatterns.td +++ b/lib/Target/Hexagon/HexagonPatterns.td @@ -218,6 +218,8 @@ def I1toI32: OutPatFrag<(ops node:$Rs), (C2_muxii (i1 $Rs), 1, 0)>; def I32toI1: OutPatFrag<(ops node:$Rs), (i1 (C2_cmpgtui (i32 $Rs), (i32 0)))>; def ToZext64: OutPatFrag<(ops node:$Rs), (i64 (A4_combineir 0, (i32 $Rs)))>; def ToSext64: OutPatFrag<(ops node:$Rs), (i64 (A2_sxtw (i32 $Rs)))>; +def ToAext64: OutPatFrag<(ops node:$Rs), + (REG_SEQUENCE DoubleRegs, (i32 (IMPLICIT_DEF)), isub_hi, (i32 $Rs), isub_lo)>; def Combinew: OutPatFrag<(ops node:$Rs, node:$Rt), (REG_SEQUENCE DoubleRegs, $Rs, isub_hi, $Rt, isub_lo)>; @@ -811,9 +813,9 @@ def: Pat<(select (not I1:$Pu), F32:$Rt, f32ImmPred:$I), (C2_muxri I1:$Pu, (ftoi $I), F32:$Rt)>; def: Pat<(select I1:$Pu, V4I8:$Rs, V4I8:$Rt), - (LoReg (C2_vmux I1:$Pu, (ToZext64 $Rs), (ToZext64 $Rt)))>; + (LoReg (C2_vmux I1:$Pu, (ToAext64 $Rs), (ToAext64 $Rt)))>; def: Pat<(select I1:$Pu, V2I16:$Rs, V2I16:$Rt), - (LoReg (C2_vmux I1:$Pu, (ToZext64 $Rs), (ToZext64 $Rt)))>; + (LoReg (C2_vmux I1:$Pu, (ToAext64 $Rs), (ToAext64 $Rt)))>; def: Pat<(select I1:$Pu, V2I32:$Rs, V2I32:$Rt), (Combinew (C2_mux I1:$Pu, (HiReg $Rs), (HiReg $Rt)), (C2_mux I1:$Pu, (LoReg $Rs), (LoReg $Rt)))>; @@ -1512,9 +1514,9 @@ def: Pat<(add V2I32:$Rx, (mul V2I32:$Rs, V2I32:$Rt)), // Add/subtract two v4i8: Hexagon does not have an insn for this one, so // we use the double add v8i8, and use only the low part of the result. def: Pat<(add V4I8:$Rs, V4I8:$Rt), - (LoReg (A2_vaddub (ToZext64 $Rs), (ToZext64 $Rt)))>; + (LoReg (A2_vaddub (ToAext64 $Rs), (ToAext64 $Rt)))>; def: Pat<(sub V4I8:$Rs, V4I8:$Rt), - (LoReg (A2_vsubub (ToZext64 $Rs), (ToZext64 $Rt)))>; + (LoReg (A2_vsubub (ToAext64 $Rs), (ToAext64 $Rt)))>; // Use M2_vmpy2s_s0 for half-word vector multiply. It multiplies two // half-words, and saturates the result to a 32-bit value, except the @@ -1863,10 +1865,10 @@ let AddedComplexity = 20 in { } let AddedComplexity = 30 in { - defm: Loadxim_pat; - defm: Loadxim_pat; - defm: Loadxim_pat; - defm: Loadxim_pat; + defm: Loadxim_pat; + defm: Loadxim_pat; + defm: Loadxim_pat; + defm: Loadxim_pat; defm: Loadxim_pat; defm: Loadxim_pat; defm: Loadxim_pat; @@ -1901,13 +1903,13 @@ let AddedComplexity = 60 in { def: Loadxum_pat; def: Loadxum_pat; - def: Loadxum_pat; + def: Loadxum_pat; def: Loadxum_pat; def: Loadxum_pat; - def: Loadxum_pat; + def: Loadxum_pat; def: Loadxum_pat; def: Loadxum_pat; - def: Loadxum_pat; + def: Loadxum_pat; } let AddedComplexity = 40 in { @@ -1947,25 +1949,25 @@ let AddedComplexity = 20 in { } let AddedComplexity = 40 in { - def: Loadxrm_shl_pat; + def: Loadxrm_shl_pat; def: Loadxrm_shl_pat; def: Loadxrm_shl_pat; - def: Loadxrm_shl_pat; + def: Loadxrm_shl_pat; def: Loadxrm_shl_pat; def: Loadxrm_shl_pat; - def: Loadxrm_shl_pat; + def: Loadxrm_shl_pat; def: Loadxrm_shl_pat; def: Loadxrm_shl_pat; } let AddedComplexity = 20 in { - def: Loadxrm_add_pat; + def: Loadxrm_add_pat; def: Loadxrm_add_pat; def: Loadxrm_add_pat; - def: Loadxrm_add_pat; + def: Loadxrm_add_pat; def: Loadxrm_add_pat; def: Loadxrm_add_pat; - def: Loadxrm_add_pat; + def: Loadxrm_add_pat; def: Loadxrm_add_pat; def: Loadxrm_add_pat; } @@ -1997,13 +1999,13 @@ let AddedComplexity = 60 in { } let AddedComplexity = 30 in { - def: Loadam_pat; + def: Loadam_pat; def: Loadam_pat; def: Loadam_pat; - def: Loadam_pat; + def: Loadam_pat; def: Loadam_pat; def: Loadam_pat; - def: Loadam_pat; + def: Loadam_pat; def: Loadam_pat; def: Loadam_pat; @@ -2039,13 +2041,13 @@ let AddedComplexity = 100 in { } let AddedComplexity = 70 in { - def: Loadam_pat; + def: Loadam_pat; def: Loadam_pat; def: Loadam_pat; - def: Loadam_pat; + def: Loadam_pat; def: Loadam_pat; def: Loadam_pat; - def: Loadam_pat; + def: Loadam_pat; def: Loadam_pat; def: Loadam_pat;