https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92488

--- Comment #4 from Peter Bergner <bergner at gcc dot gnu.org> ---
So the following pattern added to dfp.md:

+(define_insn "trunctdsd2"
+  [(set (match_operand:SD 0 "gpc_reg_operand" "=d")
+       (float_truncate:SD (match_operand:TD 1 "gpc_reg_operand" "d")))
+   (clobber (match_scratch:TD 2 "=d"))
+   (clobber (match_scratch:DF 3 "=&d"))]
+  "TARGET_DFP"
+  "mffs %3\;mtfsfi 7,7,1\;drdpq %2,%1\;mtfsf 0xff,%3,1,0\;drsp %0,%2"
+  [(set_attr "type" "dfp")
+   (set_attr "length" "20")])

Gives me the following on Paul's test case:

truncd128:
.LFB0:
        .cfi_startproc
        mffs 0
        mtfsfi 7,7,1
        drdpq 12,2
        mtfsf 0xff,0,1,0
        drsp 1,12
        blr

Does this look like what we want?

Reply via email to