@@ -1055,8 +1055,6 @@ enum cris_pic_symbol_type
/* FIXME: Investigate CASE_VECTOR_SHORTEN_MODE to make sure HImode is not
used when broken-.word could possibly fail (plus testcase). */
-#define FIXUNS_TRUNC_LIKE_FIX_TRUNC
-
/* This is the number of bytes that can be moved in one
reasonably fast instruction sequence. For CRIS, this is two
instructions: mem => reg, reg => mem. */
@@ -566,10 +566,6 @@ struct cum_arg
are unsigned. */
#define DEFAULT_SIGNED_CHAR 0
-/* This flag, if defined, says the same insns that convert to a signed fixnum
- also convert validly to an unsigned one. */
-#define FIXUNS_TRUNC_LIKE_FIX_TRUNC
-
/* Max number of bytes we can move from memory to memory
in one reasonably fast instruction. */
#define MOVE_MAX (TARGET_H8300H || TARGET_H8300S ? 4 : 2)
@@ -703,10 +703,6 @@ do { \
#define LOAD_EXTEND_OP(MODE) ZERO_EXTEND
-/* This flag, if defined, says the same insns that convert to a signed fixnum
- also convert validly to an unsigned one. */
-#define FIXUNS_TRUNC_LIKE_FIX_TRUNC
-
/* Max number of bytes we can move from memory to memory
in one reasonably fast instruction. */
#define MOVE_MAX 4
@@ -1821,11 +1821,6 @@ do { \
/* Define this as 1 if `char' should by default be signed; else as 0. */
#define DEFAULT_SIGNED_CHAR 0
-/* This flag, if defined, says the same insns that convert to a signed fixnum
- also convert validly to an unsigned one. */
-
-/* #define FIXUNS_TRUNC_LIKE_FIX_TRUNC */
-
/* An integer expression for the size in bits of the largest integer machine
mode that should actually be used. */
@@ -812,10 +812,6 @@ typedef enum
/* Byte and short loads sign extend the value to a word. */
#define LOAD_EXTEND_OP(MODE) SIGN_EXTEND
-/* This flag, if defined, says the same insns that convert to a signed fixnum
- also convert validly to an unsigned one. */
-#define FIXUNS_TRUNC_LIKE_FIX_TRUNC
-
/* Max number of bytes we can move from memory to memory
in one reasonably fast instruction. */
#define MOVE_MAX 4
@@ -1938,7 +1938,7 @@
;; float -> int
(define_insn "fix_truncsfsi2"
[(set (match_operand:SI 0 "register_operand" "=r")
- (fix:SI (fix:SF (match_operand:SF 1 "register_operand" "r"))))]
+ (fix:SI (match_operand:SF 1 "register_operand" "r")))]
"TARGET_V850E2V3"
"trncf.sw %1,%0"
[(set_attr "length" "4")
@@ -1947,13 +1947,23 @@
(define_insn "fix_truncdfsi2"
[(set (match_operand:SI 0 "register_operand" "=r")
- (fix:SI (fix:DF (match_operand:DF 1 "even_reg_operand" "r"))))]
+ (fix:SI (match_operand:DF 1 "even_reg_operand" "r")))]
"TARGET_V850E2V3"
"trncf.dw %1,%0"
[(set_attr "length" "4")
(set_attr "cc" "none_0hit")
(set_attr "type" "fpu")])
+(define_expand "fixuns_truncsfsi2"
+ [(set (match_operand:SI 0 "register_operand" "=r")
+ (fix:SI (match_operand:SF 1 "register_operand" "r")))]
+ "TARGET_V850E2V3")
+
+(define_expand "fixuns_truncdfsi2"
+ [(set (match_operand:SI 0 "register_operand" "=r")
+ (fix:SI (match_operand:DF 1 "even_reg_operand" "r")))]
+ "TARGET_V850E2V3")
+
;; int -> float
(define_insn "floatsisf2"
[(set (match_operand:SF 0 "register_operand" "=r")
@@ -455,10 +455,6 @@ enum reg_class { NO_REGS, ALL_REGS, LIM_REG_CLASSES };
/* Define this as 1 if `char' should by default be signed; else as 0. */
#define DEFAULT_SIGNED_CHAR 1
-/* This flag, if defined, says the same insns that convert to a signed fixnum
- also convert validly to an unsigned one. */
-#define FIXUNS_TRUNC_LIKE_FIX_TRUNC
-
/* Max number of bytes we can move from memory to memory
in one reasonably fast instruction. */
#define MOVE_MAX 8
@@ -318,9 +318,14 @@
(define_insn "fix_trunc<VAXfp:mode><VAXint:mode>2"
[(set (match_operand:VAXint 0 "nonimmediate_operand" "=g")
- (fix:VAXint (fix:VAXfp (match_operand:VAXfp 1 "general_operand" "gF"))))]
+ (fix:VAXint (match_operand:VAXfp 1 "general_operand" "gF")))]
""
"cvt<VAXfp:fsfx><VAXint:isfx> %1,%0")
+
+(define_expand "fixuns_trunc<VAXfp:mode><VAXint:mode>2"
+ [(set (match_operand:VAXint 0 "nonimmediate_operand" "")
+ (fix:VAXint (match_operand:VAXfp 1 "general_operand")))]
+ "")
;;- All kinds of add instructions.
@@ -10339,12 +10339,6 @@ Define this macro if loading short immediate values into registers sign
extends.
@end defmac
-@defmac FIXUNS_TRUNC_LIKE_FIX_TRUNC
-Define this macro if the same instructions that convert a floating
-point number to a signed fixed point number also convert validly to an
-unsigned one.
-@end defmac
-
@deftypefn {Target Hook} {unsigned int} TARGET_MIN_DIVISIONS_FOR_RECIP_MUL (enum machine_mode @var{mode})
When @option{-ffast-math} is in effect, GCC tries to optimize
divisions by the same divisor, by turning them into multiplications by
@@ -10205,12 +10205,6 @@ Define this macro if loading short immediate values into registers sign
extends.
@end defmac
-@defmac FIXUNS_TRUNC_LIKE_FIX_TRUNC
-Define this macro if the same instructions that convert a floating
-point number to a signed fixed point number also convert validly to an
-unsigned one.
-@end defmac
-
@hook TARGET_MIN_DIVISIONS_FOR_RECIP_MUL
When @option{-ffast-math} is in effect, GCC tries to optimize
divisions by the same divisor, by turning them into multiplications by
@@ -888,7 +888,7 @@ extern void fancy_abort (const char *, int, const char *) ATTRIBUTE_NORETURN;
IDENT_ASM_OP UNALIGNED_SHORT_ASM_OP UNALIGNED_INT_ASM_OP \
UNALIGNED_LONG_ASM_OP UNALIGNED_DOUBLE_INT_ASM_OP \
USE_COMMON_FOR_ONE_ONLY IFCVT_EXTRA_FIELDS IFCVT_INIT_EXTRA_FIELDS \
- CASE_USE_BIT_TESTS
+ CASE_USE_BIT_TESTS FIXUNS_TRUNC_LIKE_FIX_TRUNC
/* Hooks that are no longer used. */
#pragma GCC poison LANG_HOOKS_FUNCTION_MARK LANG_HOOKS_FUNCTION_FREE \