aboutsummaryrefslogtreecommitdiff
path: root/gcc/fixed-value.h
diff options
context:
space:
mode:
authorGeorg-Johann Lay <avr@gjlay.de>2013-01-30 11:04:30 +0000
committerGeorg-Johann Lay <avr@gjlay.de>2013-01-30 11:04:30 +0000
commit872dec84fd526d66c0a53c7d0e708d67da1fb517 (patch)
tree7cbebdbd492e700058cfc647470eb384b37f121e /gcc/fixed-value.h
parent198596c62abc7cb8e0d46d2a8b1b66fabcf13c87 (diff)
gcc/
PR tree-optimization/56064 * fixed-value.c (fixed_from_double_int): New function. * fixed-value.h (fixed_from_double_int): New prototype. (const_fixed_from_double_int): New static inline function. * fold-const.c (native_interpret_fixed): New static function. (native_interpret_expr) <FIXED_POINT_TYPE>: Use it. (can_native_interpret_type_p) <FIXED_POINT_TYPE>: Return true. (native_encode_fixed): New static function. (native_encode_expr) <FIXED_CST>: Use it. (native_interpret_int): Move double_int worker code to... * double-int.c (double_int::from_buffer): ...this new static method. * double-int.h (double_int::from_buffer): Prototype it. gcc/testsuite/ PR tree-optimization/56064 * gcc.dg/fixed-point/view-convert.c: New test. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@195574 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fixed-value.h')
-rw-r--r--gcc/fixed-value.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/gcc/fixed-value.h b/gcc/fixed-value.h
index 9951b181d2e..5ffe67ca87a 100644
--- a/gcc/fixed-value.h
+++ b/gcc/fixed-value.h
@@ -49,6 +49,22 @@ extern FIXED_VALUE_TYPE fconst1[MAX_FCONST1];
const_fixed_from_fixed_value (r, m)
extern rtx const_fixed_from_fixed_value (FIXED_VALUE_TYPE, enum machine_mode);
+/* Construct a FIXED_VALUE from a bit payload and machine mode MODE.
+ The bits in PAYLOAD are used verbatim. */
+extern FIXED_VALUE_TYPE fixed_from_double_int (double_int,
+ enum machine_mode);
+
+/* Return a CONST_FIXED from a bit payload and machine mode MODE.
+ The bits in PAYLOAD are used verbatim. */
+static inline rtx
+const_fixed_from_double_int (double_int payload,
+ enum machine_mode mode)
+{
+ return
+ const_fixed_from_fixed_value (fixed_from_double_int (payload, mode),
+ mode);
+}
+
/* Initialize from a decimal or hexadecimal string. */
extern void fixed_from_string (FIXED_VALUE_TYPE *, const char *,
enum machine_mode);