summaryrefslogtreecommitdiff
path: root/gcc/config/s390
diff options
context:
space:
mode:
authoruweigand <uweigand@138bc75d-0d04-0410-961f-82ee72b054a4>2007-07-09 20:12:51 +0000
committeruweigand <uweigand@138bc75d-0d04-0410-961f-82ee72b054a4>2007-07-09 20:12:51 +0000
commit93f564d603705e3e717097547f34510ed7f19da3 (patch)
tree01bce16cd8187f0c885645cbd5419094990089a3 /gcc/config/s390
parentefd4cd99a429aac82f7bac08f0756dab535a2581 (diff)
downloadgcc-93f564d603705e3e717097547f34510ed7f19da3.tar.gz
2007-07-09 Wolfgang Gellerich <gellerich@de.ibm.com>
* optabs.h: Added declaration for signbit_optab. * optabs.c: (init_optabs): Added initialization for signbit_optab. * genoptinit.c (optabs): Added entry for signbit insns. * builtins.c (expand_builtin_signbit): Added code to use a signbit insn, if available. * config/s390/s390.h (S390_TDC_SIGNBIT_SET): New constant. * config/s390/s390.md (signbit<mode>2): New expander. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@126495 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/s390')
-rw-r--r--gcc/config/s390/s390.h7
-rw-r--r--gcc/config/s390/s390.md12
2 files changed, 19 insertions, 0 deletions
diff --git a/gcc/config/s390/s390.h b/gcc/config/s390/s390.h
index f95dae2605d..8336a8fe63d 100644
--- a/gcc/config/s390/s390.h
+++ b/gcc/config/s390/s390.h
@@ -156,6 +156,13 @@ extern enum processor_flags s390_arch_flags;
#define S390_TDC_POSITIVE_SIGNALING_NAN (1 << 1)
#define S390_TDC_NEGATIVE_SIGNALING_NAN (1 << 0)
+#define S390_TDC_SIGNBIT_SET (S390_TDC_NEGATIVE_ZERO \
+ | S390_TDC_NEGATIVE_NORMALIZED_NUMBER \
+ | S390_TDC_NEGATIVE_DENORMALIZED_NUMBER\
+ | S390_TDC_NEGATIVE_INFINITY \
+ | S390_TDC_NEGATIVE_QUIET_NAN \
+ | S390_TDC_NEGATIVE_SIGNALING_NAN )
+
#define S390_TDC_INFINITY (S390_TDC_POSITIVE_INFINITY \
| S390_TDC_NEGATIVE_INFINITY )
diff --git a/gcc/config/s390/s390.md b/gcc/config/s390/s390.md
index 3fac610c543..eb05553a98e 100644
--- a/gcc/config/s390/s390.md
+++ b/gcc/config/s390/s390.md
@@ -2308,6 +2308,18 @@
; Test data class.
;
+(define_expand "signbit<mode>2"
+ [(set (reg:CCZ CC_REGNUM)
+ (unspec:CCZ [(match_operand:BFP 1 "register_operand" "f")
+ (match_dup 2)]
+ UNSPEC_TDC_INSN))
+ (set (match_operand:SI 0 "register_operand" "=d")
+ (unspec:SI [(reg:CCZ CC_REGNUM)] UNSPEC_CCZ_TO_INT))]
+ "TARGET_HARD_FLOAT"
+{
+ operands[2] = GEN_INT (S390_TDC_SIGNBIT_SET);
+})
+
(define_expand "isinf<mode>2"
[(set (reg:CCZ CC_REGNUM)
(unspec:CCZ [(match_operand:BFP 1 "register_operand" "f")