# Changeset View

Changeset View

# Standalone View

Standalone View

# llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp

Show First 20 Lines • Show All 166 Lines • ▼ Show 20 Line(s) | 46 | #endif | |||
---|---|---|---|---|---|

167 | case ISD::STRICT_FMAXNUM: | 167 | case ISD::STRICT_FMAXNUM: | ||

168 | case ISD::STRICT_FMINNUM: | 168 | case ISD::STRICT_FMINNUM: | ||

169 | case ISD::STRICT_FCEIL: | 169 | case ISD::STRICT_FCEIL: | ||

170 | case ISD::STRICT_FFLOOR: | 170 | case ISD::STRICT_FFLOOR: | ||

171 | case ISD::STRICT_FROUND: | 171 | case ISD::STRICT_FROUND: | ||

172 | case ISD::STRICT_FTRUNC: | 172 | case ISD::STRICT_FTRUNC: | ||

173 | R = ScalarizeVecRes_StrictFPOp(N); | 173 | R = ScalarizeVecRes_StrictFPOp(N); | ||

174 | break; | 174 | break; | ||

175 | case ISD::SMULFIX: | ||||

176 | R = ScalarizeVecRes_SMULFIX(N); | ||||

177 | break; | ||||

175 | } | 178 | } | ||

176 | 179 | | |||

177 | // If R is null, the sub-method took care of registering the result. | 180 | // If R is null, the sub-method took care of registering the result. | ||

178 | if (R.getNode()) | 181 | if (R.getNode()) | ||

179 | SetScalarizedVector(SDValue(N, ResNo), R); | 182 | SetScalarizedVector(SDValue(N, ResNo), R); | ||

180 | } | 183 | } | ||

181 | 184 | | |||

182 | SDValue DAGTypeLegalizer::ScalarizeVecRes_BinOp(SDNode *N) { | 185 | SDValue DAGTypeLegalizer::ScalarizeVecRes_BinOp(SDNode *N) { | ||

183 | SDValue LHS = GetScalarizedVector(N->getOperand(0)); | 186 | SDValue LHS = GetScalarizedVector(N->getOperand(0)); | ||

184 | SDValue RHS = GetScalarizedVector(N->getOperand(1)); | 187 | SDValue RHS = GetScalarizedVector(N->getOperand(1)); | ||

185 | return DAG.getNode(N->getOpcode(), SDLoc(N), | 188 | return DAG.getNode(N->getOpcode(), SDLoc(N), | ||

186 | LHS.getValueType(), LHS, RHS, N->getFlags()); | 189 | LHS.getValueType(), LHS, RHS, N->getFlags()); | ||

187 | } | 190 | } | ||

188 | 191 | | |||

189 | SDValue DAGTypeLegalizer::ScalarizeVecRes_TernaryOp(SDNode *N) { | 192 | SDValue DAGTypeLegalizer::ScalarizeVecRes_TernaryOp(SDNode *N) { | ||

190 | SDValue Op0 = GetScalarizedVector(N->getOperand(0)); | 193 | SDValue Op0 = GetScalarizedVector(N->getOperand(0)); | ||

191 | SDValue Op1 = GetScalarizedVector(N->getOperand(1)); | 194 | SDValue Op1 = GetScalarizedVector(N->getOperand(1)); | ||

192 | SDValue Op2 = GetScalarizedVector(N->getOperand(2)); | 195 | SDValue Op2 = GetScalarizedVector(N->getOperand(2)); | ||

193 | return DAG.getNode(N->getOpcode(), SDLoc(N), | 196 | return DAG.getNode(N->getOpcode(), SDLoc(N), | ||

194 | Op0.getValueType(), Op0, Op1, Op2); | 197 | Op0.getValueType(), Op0, Op1, Op2); | ||

195 | } | 198 | } | ||

196 | 199 | | |||

200 | SDValue DAGTypeLegalizer::ScalarizeVecRes_SMULFIX(SDNode *N) { | ||||

201 | SDValue Op0 = GetScalarizedVector(N->getOperand(0)); | ||||

202 | SDValue Op1 = GetScalarizedVector(N->getOperand(1)); | ||||

203 | SDValue Op2 = N->getOperand(2); | ||||

204 | return DAG.getNode(N->getOpcode(), SDLoc(N), Op0.getValueType(), Op0, Op1, | ||||

205 | Op2); | ||||

206 | } | ||||

207 | | ||||

197 | SDValue DAGTypeLegalizer::ScalarizeVecRes_StrictFPOp(SDNode *N) { | 208 | SDValue DAGTypeLegalizer::ScalarizeVecRes_StrictFPOp(SDNode *N) { | ||

198 | EVT VT = N->getValueType(0).getVectorElementType(); | 209 | EVT VT = N->getValueType(0).getVectorElementType(); | ||

199 | unsigned NumOpers = N->getNumOperands(); | 210 | unsigned NumOpers = N->getNumOperands(); | ||

200 | SDValue Chain = N->getOperand(0); | 211 | SDValue Chain = N->getOperand(0); | ||

201 | EVT ValueVTs[] = {VT, MVT::Other}; | 212 | EVT ValueVTs[] = {VT, MVT::Other}; | ||

202 | SDLoc dl(N); | 213 | SDLoc dl(N); | ||

203 | 214 | | |||

204 | SmallVector<SDValue, 4> Opers; | 215 | SmallVector<SDValue, 4> Opers; | ||

▲ Show 20 Lines • Show All 638 Lines • ▼ Show 20 Line(s) | 716 | #endif | |||

843 | case ISD::STRICT_FMAXNUM: | 854 | case ISD::STRICT_FMAXNUM: | ||

844 | case ISD::STRICT_FMINNUM: | 855 | case ISD::STRICT_FMINNUM: | ||

845 | case ISD::STRICT_FCEIL: | 856 | case ISD::STRICT_FCEIL: | ||

846 | case ISD::STRICT_FFLOOR: | 857 | case ISD::STRICT_FFLOOR: | ||

847 | case ISD::STRICT_FROUND: | 858 | case ISD::STRICT_FROUND: | ||

848 | case ISD::STRICT_FTRUNC: | 859 | case ISD::STRICT_FTRUNC: | ||

849 | SplitVecRes_StrictFPOp(N, Lo, Hi); | 860 | SplitVecRes_StrictFPOp(N, Lo, Hi); | ||

850 | break; | 861 | break; | ||

862 | case ISD::SMULFIX: | ||||

863 | SplitVecRes_SMULFIX(N, Lo, Hi); | ||||

864 | break; | ||||

851 | } | 865 | } | ||

852 | 866 | | |||

853 | // If Lo/Hi is null, the sub-method took care of registering results etc. | 867 | // If Lo/Hi is null, the sub-method took care of registering results etc. | ||

854 | if (Lo.getNode()) | 868 | if (Lo.getNode()) | ||

855 | SetSplitVector(SDValue(N, ResNo), Lo, Hi); | 869 | SetSplitVector(SDValue(N, ResNo), Lo, Hi); | ||

856 | } | 870 | } | ||

857 | 871 | | |||

858 | void DAGTypeLegalizer::SplitVecRes_BinOp(SDNode *N, SDValue &Lo, | 872 | void DAGTypeLegalizer::SplitVecRes_BinOp(SDNode *N, SDValue &Lo, | ||

Show All 21 Lines | 886 | void DAGTypeLegalizer::SplitVecRes_TernaryOp(SDNode *N, SDValue &Lo, | |||

880 | SDLoc dl(N); | 894 | SDLoc dl(N); | ||

881 | 895 | | |||

882 | Lo = DAG.getNode(N->getOpcode(), dl, Op0Lo.getValueType(), | 896 | Lo = DAG.getNode(N->getOpcode(), dl, Op0Lo.getValueType(), | ||

883 | Op0Lo, Op1Lo, Op2Lo); | 897 | Op0Lo, Op1Lo, Op2Lo); | ||

884 | Hi = DAG.getNode(N->getOpcode(), dl, Op0Hi.getValueType(), | 898 | Hi = DAG.getNode(N->getOpcode(), dl, Op0Hi.getValueType(), | ||

885 | Op0Hi, Op1Hi, Op2Hi); | 899 | Op0Hi, Op1Hi, Op2Hi); | ||

886 | } | 900 | } | ||

887 | 901 | | |||

902 | void DAGTypeLegalizer::SplitVecRes_SMULFIX(SDNode *N, SDValue &Lo, | ||||

903 | SDValue &Hi) { | ||||

904 | SDValue LHSLo, LHSHi; | ||||

905 | GetSplitVector(N->getOperand(0), LHSLo, LHSHi); | ||||

906 | SDValue RHSLo, RHSHi; | ||||

907 | GetSplitVector(N->getOperand(1), RHSLo, RHSHi); | ||||

908 | SDLoc dl(N); | ||||

909 | SDValue Op2 = N->getOperand(2); | ||||

910 | | ||||

911 | unsigned Opcode = N->getOpcode(); | ||||

912 | Lo = DAG.getNode(Opcode, dl, LHSLo.getValueType(), LHSLo, RHSLo, Op2); | ||||

913 | Hi = DAG.getNode(Opcode, dl, LHSHi.getValueType(), LHSHi, RHSHi, Op2); | ||||

914 | } | ||||

915 | | ||||

888 | void DAGTypeLegalizer::SplitVecRes_BITCAST(SDNode *N, SDValue &Lo, | 916 | void DAGTypeLegalizer::SplitVecRes_BITCAST(SDNode *N, SDValue &Lo, | ||

889 | SDValue &Hi) { | 917 | SDValue &Hi) { | ||

890 | // We know the result is a vector. The input may be either a vector or a | 918 | // We know the result is a vector. The input may be either a vector or a | ||

891 | // scalar value. | 919 | // scalar value. | ||

892 | EVT LoVT, HiVT; | 920 | EVT LoVT, HiVT; | ||

893 | std::tie(LoVT, HiVT) = DAG.GetSplitDestVTs(N->getValueType(0)); | 921 | std::tie(LoVT, HiVT) = DAG.GetSplitDestVTs(N->getValueType(0)); | ||

894 | SDLoc dl(N); | 922 | SDLoc dl(N); | ||

895 | 923 | | |||

▲ Show 20 Lines • Show All 3588 Lines • Show Last 20 Lines |