[partial backport of gcc-4.8/trunk r195574, needed by partial 198772 backport, which is needed by PR57980 fix ] gcc/ 2013-01-30 Georg-Johann Lay PR tree-optimization/56064 * fixed-value.c (fixed_from_double_int): New function. * fixed-value.h (fixed_from_double_int): New prototype. --- gcc-4.7.3/gcc/fixed-value.c.~1~ 2010-11-30 12:41:24.000000000 +0100 +++ gcc-4.7.3/gcc/fixed-value.c 2013-08-10 18:16:33.284220675 +0200 @@ -81,6 +81,24 @@ check_real_for_fixed_mode (REAL_VALUE_TY return FIXED_OK; } + +/* Construct a CONST_FIXED from a bit payload and machine mode MODE. + The bits in PAYLOAD are used verbatim. */ + +FIXED_VALUE_TYPE +fixed_from_double_int (double_int payload, enum machine_mode mode) +{ + FIXED_VALUE_TYPE value; + + gcc_assert (GET_MODE_BITSIZE (mode) <= HOST_BITS_PER_DOUBLE_INT); + + value.data = payload; + value.mode = mode; + + return value; +} + + /* Initialize from a decimal or hexadecimal string. */ void --- gcc-4.7.3/gcc/fixed-value.h.~1~ 2009-04-22 20:29:36.000000000 +0200 +++ gcc-4.7.3/gcc/fixed-value.h 2013-08-10 18:16:56.564181277 +0200 @@ -49,6 +49,11 @@ extern FIXED_VALUE_TYPE fconst1[MAX_FCON 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); + /* Initialize from a decimal or hexadecimal string. */ extern void fixed_from_string (FIXED_VALUE_TYPE *, const char *, enum machine_mode);