[llvm] [Legalizer] Soften EXTRACT_ELEMENT on ppcf128 (PR #77412)

Qiu Chaofan via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 9 18:41:41 PST 2024


================
@@ -262,6 +264,16 @@ SDValue DAGTypeLegalizer::SoftenFloatRes_ConstantFP(SDNode *N) {
   }
 }
 
+SDValue DAGTypeLegalizer::SoftenFloatRes_EXTRACT_ELEMENT(SDNode *N) {
----------------
ecnelises wrote:

It's something like

```
        t10: i64 = build_pair t8, t6
        t9: i64 = build_pair t4, t2
      t11: i128 = build_pair t10, t9
    t12: ppcf128 = bitcast t11
  t14: f64 = extract_element t12, Constant:i32<1>
t15: i64 = bitcast t14
```

ppc_fp128 is operand, but result is also a float value which needs soften. Only ppc_fp128 supports `extract_element` (it consists of two f64s) and result of extracting from `ppc_fp128` is f64.

Calling the type ppc_fp128 is because only PPC uses the format, but PPC also does not support it in hardware instruction level, it's always soft.

https://github.com/llvm/llvm-project/pull/77412


More information about the llvm-commits mailing list