* config/epiphany/epiphany.opt (-may-round-for-trunc): New option.
authoramylaar <amylaar@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 28 Nov 2012 13:28:57 +0000 (13:28 +0000)
committeramylaar <amylaar@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 28 Nov 2012 13:28:57 +0000 (13:28 +0000)
        * config/epiphany/epiphany.md (*fix_truncsfsi2_i): Take it into account.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@193891 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/epiphany/epiphany.md
gcc/config/epiphany/epiphany.opt

index 1d4a0c9..5d503fd 100644 (file)
@@ -8,6 +8,9 @@
        for misaligned memory operands.
        * config/epiphany/predicates.md (misaligned_operand): New predicate.
 
+       * config/epiphany/epiphany.opt (-may-round-for-trunc): New option.
+       * config/epiphany/epiphany.md (*fix_truncsfsi2_i): Take it into account.
+
 2012-11-28  Richard Biener  <rguenther@suse.de>
 
        PR tree-optimization/54547
index f650870..d0cbcc4 100644 (file)
   ""
   "fix %0, %1"
   [(set_attr "type" "fp")
-   (set_attr "fp_mode" "round_trunc")])
+   (set (attr "fp_mode")
+       (cond [(match_test "TARGET_MAY_ROUND_FOR_TRUNC")
+              (const_string "round_unknown")]
+             (const_string "round_trunc")))])
 
 (define_expand "fixuns_truncsfsi2"
   [(set (match_operand:SI 0 "gpr_operand" "")
index 3740182..613bb98 100644 (file)
@@ -103,6 +103,10 @@ Enum(attr_fp_mode) String(truncate) Value(FP_MODE_ROUND_TRUNC)
 EnumValue
 Enum(attr_fp_mode) String(int) Value(FP_MODE_INT)
 
+may-round-for-trunc
+Target Mask(MAY_ROUND_FOR_TRUNC)
+A floatig point to integer truncation may be replaced with rounding to save mode switching
+
 mvect-double
 Target Mask(VECT_DOUBLE)
 Vectorize for double-word operations.