Re: {PATCH] RL78 movdf define expand

2018-02-16 Thread DJ Delorie

This is OK.  In the future, please include the Changelog entry as a
separate text, not part of the patch, as it will rarely apply cleanly.

"Sebastian Perta"  writes:
>
>   * config/rl78/rl78.md (movdf): New define expand.


{PATCH] RL78 movdf define expand

2018-02-16 Thread Sebastian Perta
Hello,

The following patch defines a new expand movdf, it is similar to the movdi
expand which I implemented a while ago.
The usefulness of the patch can be seen easily even on the following test
case where it reduces the code size from 199 bytes to 109 bytes:

long double long_double_add(long double a, long double b)
{
return a + b;
}

Regression test is OK, tested with the following command:
make -k check-gcc RUNTESTFLAGS=--target_board=rl78-sim

Best Regards,
Sebastian

Index: ChangeLog
===
--- ChangeLog   (revision 257733)
+++ ChangeLog   (working copy)
@@ -1,3 +1,7 @@
+2018-02-16  Sebastian Perta  
+
+   * config/rl78/rl78.md (movdf): New define expand.
+
 2018-02-16  Richard Biener  
 
PR tree-optimization/84417




Index: rl78.md
===
--- rl78.md (revision 257733)
+++ rl78.md (working copy)
@@ -727,6 +727,14 @@
   DONE;"
 )
 
+(define_expand "movdf"
+  [(set (match_operand:DF 0 "nonimmediate_operand" "")
+(match_operand:DF 1 "general_operand" ""))]
+  ""
+  "rl78_split_movdi(operands, DFmode);
+  DONE;"
+)
+
 (define_expand "umindi3"
  [(set (match_operand:DI  0 "nonimmediate_operand" "")
(umin:DI (match_operand:DI 1 "general_operand"  "")