@@ -946,6 +946,9 @@ bool DAGTypeLegalizer::SoftenFloatOperand(SDNode *N, unsigned OpNo) {
946946 case ISD::STRICT_FSETCCS:
947947 case ISD::SETCC: Res = SoftenFloatOp_SETCC (N); break ;
948948 case ISD::STORE: Res = SoftenFloatOp_STORE (N, OpNo); break ;
949+ case ISD::ATOMIC_STORE:
950+ Res = SoftenFloatOp_ATOMIC_STORE (N, OpNo);
951+ break ;
949952 case ISD::FCOPYSIGN: Res = SoftenFloatOp_FCOPYSIGN (N); break ;
950953 }
951954
@@ -1172,6 +1175,21 @@ SDValue DAGTypeLegalizer::SoftenFloatOp_STORE(SDNode *N, unsigned OpNo) {
11721175 ST->getMemOperand ());
11731176}
11741177
1178+ SDValue DAGTypeLegalizer::SoftenFloatOp_ATOMIC_STORE (SDNode *N, unsigned OpNo) {
1179+ assert (ISD::isUNINDEXEDStore (N) && " Indexed store during type legalization!" );
1180+ assert (OpNo == 1 && " Can only soften the stored value!" );
1181+ AtomicSDNode *ST = cast<AtomicSDNode>(N);
1182+ SDValue Val = ST->getVal ();
1183+ EVT VT = Val.getValueType ();
1184+ SDLoc dl (N);
1185+
1186+ assert (ST->getMemoryVT () == VT && " truncating atomic store not handled" );
1187+
1188+ SDValue NewVal = GetSoftenedFloat (Val);
1189+ return DAG.getAtomic (ISD::ATOMIC_STORE, dl, VT, ST->getChain (), NewVal,
1190+ ST->getBasePtr (), ST->getMemOperand ());
1191+ }
1192+
11751193SDValue DAGTypeLegalizer::SoftenFloatOp_FCOPYSIGN (SDNode *N) {
11761194 SDValue LHS = N->getOperand (0 );
11771195 SDValue RHS = BitConvertToInteger (N->getOperand (1 ));
0 commit comments