[PowerPC] Support conversion between f16 and f128 (#130158) · llvm/llvm-project@3e2801e (original) (raw)

`@@ -223,13 +223,19 @@ PPCTargetLowering::PPCTargetLowering(const PPCTargetMachine &TM,

`

223

223

` setLoadExtAction(ISD::SEXTLOAD, VT, MVT::i8, Expand);

`

224

224

` }

`

225

225

``

``

226

`+

setTruncStoreAction(MVT::f128, MVT::f16, Expand);

`

``

227

`+

setOperationAction(ISD::FP_TO_FP16, MVT::f128, Expand);

`

``

228

+

226

229

` if (Subtarget.isISA3_0()) {

`

``

230

`+

setLoadExtAction(ISD::EXTLOAD, MVT::f128, MVT::f16, Legal);

`

227

231

` setLoadExtAction(ISD::EXTLOAD, MVT::f64, MVT::f16, Legal);

`

228

232

` setLoadExtAction(ISD::EXTLOAD, MVT::f32, MVT::f16, Legal);

`

229

233

` setTruncStoreAction(MVT::f64, MVT::f16, Legal);

`

230

234

` setTruncStoreAction(MVT::f32, MVT::f16, Legal);

`

231

235

` } else {

`

232

236

` // No extending loads from f16 or HW conversions back and forth.

`

``

237

`+

setLoadExtAction(ISD::EXTLOAD, MVT::f128, MVT::f16, Expand);

`

``

238

`+

setOperationAction(ISD::FP16_TO_FP, MVT::f128, Expand);

`

233

239

` setLoadExtAction(ISD::EXTLOAD, MVT::f64, MVT::f16, Expand);

`

234

240

` setOperationAction(ISD::FP16_TO_FP, MVT::f64, Expand);

`

235

241

` setOperationAction(ISD::FP_TO_FP16, MVT::f64, Expand);

`