@@ -4406,6 +4406,18 @@
[(set_attr "op_type" "RRF")
(set_attr "type" "ftruncsd")])
+(define_expand "trunctdsd2"
+ [(parallel
+ [(set (match_dup 3)
+ (float_truncate:DD (match_operand:TD 1 "register_operand" "")))
+ (clobber (match_scratch:TD 2 ""))])
+ (set (match_operand:SD 0 "register_operand" "")
+ (float_truncate:SD (match_dup 3)))]
+ "TARGET_HARD_DFP"
+{
+ operands[3] = gen_reg_rtx (DDmode);
+})
+
;
; extend(sf|df)(df|tf)2 instruction pattern(s).
;
@@ -4442,6 +4454,16 @@
[(set_attr "op_type" "RRF")
(set_attr "type" "fsimptf")])
+(define_expand "extendsdtd2"
+ [(set (match_dup 2)
+ (float_extend:DD (match_operand:SD 1 "register_operand" "")))
+ (set (match_operand:TD 0 "register_operand" "")
+ (float_extend:TD (match_dup 2)))]
+ "TARGET_HARD_DFP"
+{
+ operands[2] = gen_reg_rtx (DDmode);
+})
+
; Binary Floating Point - load fp integer
; Expanders for: floor, btrunc, round, ceil, and nearbyint
new file mode 100644
@@ -0,0 +1,22 @@
+/* We do not have hardware instructions which do a direct conversion
+ between the 32 and 128 bit DFP types. But we can easily do it in
+ two steps. Older libdfp implementations require this not to call
+ into a lib in order to prevent an endless loop. */
+
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=z10 -mzarch" } */
+
+_Decimal32
+foo (_Decimal128 a)
+{
+ return (_Decimal32)a;
+}
+
+_Decimal128
+bar (_Decimal32 a)
+{
+ return (_Decimal128)a;
+}
+
+/* Make sure no library call is emitted. */
+/* { dg-final { scan-assembler-not "brasl" } } */