@@ -946,6 +946,9 @@ bool DAGTypeLegalizer::SoftenFloatOperand(SDNode *N, unsigned OpNo) {
946
946
case ISD::STRICT_FSETCCS:
947
947
case ISD::SETCC: Res = SoftenFloatOp_SETCC (N); break ;
948
948
case ISD::STORE: Res = SoftenFloatOp_STORE (N, OpNo); break ;
949
+ case ISD::ATOMIC_STORE:
950
+ Res = SoftenFloatOp_ATOMIC_STORE (N, OpNo);
951
+ break ;
949
952
case ISD::FCOPYSIGN: Res = SoftenFloatOp_FCOPYSIGN (N); break ;
950
953
}
951
954
@@ -1172,6 +1175,21 @@ SDValue DAGTypeLegalizer::SoftenFloatOp_STORE(SDNode *N, unsigned OpNo) {
1172
1175
ST->getMemOperand ());
1173
1176
}
1174
1177
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
+
1175
1193
SDValue DAGTypeLegalizer::SoftenFloatOp_FCOPYSIGN (SDNode *N) {
1176
1194
SDValue LHS = N->getOperand (0 );
1177
1195
SDValue RHS = BitConvertToInteger (N->getOperand (1 ));
0 commit comments