|
|
8de16c |
commit 8358562298cf72905c128c2c96526b7fdccf742c
|
|
|
8de16c |
Author: Segher Boessenkool <segher@kernel.crashing.org>
|
|
|
8de16c |
Date: Fri Aug 30 16:13:51 2019 +0200
|
|
|
8de16c |
|
|
|
8de16c |
backport: altivec.md (unspec): Delete UNSPEC_DARN...
|
|
|
8de16c |
|
|
|
8de16c |
Backport from trunk
|
|
|
8de16c |
2019-08-22 Segher Boessenkool <segher@kernel.crashing.org>
|
|
|
8de16c |
|
|
|
8de16c |
* config/rs6000/altivec.md (unspec): Delete UNSPEC_DARN, UNSPEC_DARN_32,
|
|
|
8de16c |
UNSPEC_DARN_RAW, UNSPEC_CMPRB, UNSPEC_CMPRB2, UNSPEC_CMPEQB; move to...
|
|
|
8de16c |
* config/rs6000/rs6000.md (unspec): ... here.
|
|
|
8de16c |
* config/rs6000/altivec.md (darn_32, darn_raw, darn, cmprb,
|
|
|
8de16c |
*cmprb_internal, setb_signed, setb_unsigned, cmprb2, *cmprb2_internal,
|
|
|
8de16c |
cmpeqb, *cmpeqb_internal): Delete, move to...
|
|
|
8de16c |
* config/rs6000/rs6000.md (darn_32, darn_raw, darn, cmprb,
|
|
|
8de16c |
*cmprb_internal, setb_signed, setb_unsigned, cmprb2, *cmprb2_internal,
|
|
|
8de16c |
cmpeqb, *cmpeqb_internal): ... here.
|
|
|
8de16c |
|
|
|
8de16c |
From-SVN: r275180
|
|
|
8de16c |
|
|
|
8de16c |
--- gcc/config/rs6000/altivec.md
|
|
|
8de16c |
+++ gcc/config/rs6000/altivec.md
|
|
|
8de16c |
@@ -80,9 +80,6 @@
|
|
|
8de16c |
UNSPEC_VUPKHPX
|
|
|
8de16c |
UNSPEC_VUPKLPX
|
|
|
8de16c |
UNSPEC_CONVERT_4F32_8I16
|
|
|
8de16c |
- UNSPEC_DARN
|
|
|
8de16c |
- UNSPEC_DARN_32
|
|
|
8de16c |
- UNSPEC_DARN_RAW
|
|
|
8de16c |
UNSPEC_DST
|
|
|
8de16c |
UNSPEC_DSTT
|
|
|
8de16c |
UNSPEC_DSTST
|
|
|
8de16c |
@@ -161,9 +158,6 @@
|
|
|
8de16c |
UNSPEC_BCDADD
|
|
|
8de16c |
UNSPEC_BCDSUB
|
|
|
8de16c |
UNSPEC_BCD_OVERFLOW
|
|
|
8de16c |
- UNSPEC_CMPRB
|
|
|
8de16c |
- UNSPEC_CMPRB2
|
|
|
8de16c |
- UNSPEC_CMPEQB
|
|
|
8de16c |
UNSPEC_VRLMI
|
|
|
8de16c |
UNSPEC_VRLNM
|
|
|
8de16c |
])
|
|
|
8de16c |
@@ -4317,223 +4311,6 @@
|
|
|
8de16c |
[(set_attr "length" "4")
|
|
|
8de16c |
(set_attr "type" "vecsimple")])
|
|
|
8de16c |
|
|
|
8de16c |
-(define_insn "darn_32"
|
|
|
8de16c |
- [(set (match_operand:SI 0 "register_operand" "=r")
|
|
|
8de16c |
- (unspec:SI [(const_int 0)] UNSPEC_DARN_32))]
|
|
|
8de16c |
- "TARGET_P9_MISC"
|
|
|
8de16c |
- "darn %0,0"
|
|
|
8de16c |
- [(set_attr "type" "integer")])
|
|
|
8de16c |
-
|
|
|
8de16c |
-(define_insn "darn_raw"
|
|
|
8de16c |
- [(set (match_operand:DI 0 "register_operand" "=r")
|
|
|
8de16c |
- (unspec:DI [(const_int 0)] UNSPEC_DARN_RAW))]
|
|
|
8de16c |
- "TARGET_P9_MISC && TARGET_64BIT"
|
|
|
8de16c |
- "darn %0,2"
|
|
|
8de16c |
- [(set_attr "type" "integer")])
|
|
|
8de16c |
-
|
|
|
8de16c |
-(define_insn "darn"
|
|
|
8de16c |
- [(set (match_operand:DI 0 "register_operand" "=r")
|
|
|
8de16c |
- (unspec:DI [(const_int 0)] UNSPEC_DARN))]
|
|
|
8de16c |
- "TARGET_P9_MISC && TARGET_64BIT"
|
|
|
8de16c |
- "darn %0,1"
|
|
|
8de16c |
- [(set_attr "type" "integer")])
|
|
|
8de16c |
-
|
|
|
8de16c |
-;; Test byte within range.
|
|
|
8de16c |
-;;
|
|
|
8de16c |
-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
|
|
|
8de16c |
-;; represents a byte whose value is ignored in this context and
|
|
|
8de16c |
-;; vv, the least significant byte, holds the byte value that is to
|
|
|
8de16c |
-;; be tested for membership within the range specified by operand 2.
|
|
|
8de16c |
-;; The bytes of operand 2 are organized as xx:xx:hi:lo.
|
|
|
8de16c |
-;;
|
|
|
8de16c |
-;; Return in target register operand 0 a value of 1 if lo <= vv and
|
|
|
8de16c |
-;; vv <= hi. Otherwise, set register operand 0 to 0.
|
|
|
8de16c |
-;;
|
|
|
8de16c |
-;; Though the instructions to which this expansion maps operate on
|
|
|
8de16c |
-;; 64-bit registers, the current implementation only operates on
|
|
|
8de16c |
-;; SI-mode operands as the high-order bits provide no information
|
|
|
8de16c |
-;; that is not already available in the low-order bits. To avoid the
|
|
|
8de16c |
-;; costs of data widening operations, future enhancements might allow
|
|
|
8de16c |
-;; DI mode for operand 0 and/or might allow operand 1 to be QI mode.
|
|
|
8de16c |
-(define_expand "cmprb"
|
|
|
8de16c |
- [(set (match_dup 3)
|
|
|
8de16c |
- (unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
|
|
|
8de16c |
- (match_operand:SI 2 "gpc_reg_operand" "r")]
|
|
|
8de16c |
- UNSPEC_CMPRB))
|
|
|
8de16c |
- (set (match_operand:SI 0 "gpc_reg_operand" "=r")
|
|
|
8de16c |
- (if_then_else:SI (lt (match_dup 3)
|
|
|
8de16c |
- (const_int 0))
|
|
|
8de16c |
- (const_int -1)
|
|
|
8de16c |
- (if_then_else (gt (match_dup 3)
|
|
|
8de16c |
- (const_int 0))
|
|
|
8de16c |
- (const_int 1)
|
|
|
8de16c |
- (const_int 0))))]
|
|
|
8de16c |
- "TARGET_P9_MISC"
|
|
|
8de16c |
-{
|
|
|
8de16c |
- operands[3] = gen_reg_rtx (CCmode);
|
|
|
8de16c |
-})
|
|
|
8de16c |
-
|
|
|
8de16c |
-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
|
|
|
8de16c |
-;; represents a byte whose value is ignored in this context and
|
|
|
8de16c |
-;; vv, the least significant byte, holds the byte value that is to
|
|
|
8de16c |
-;; be tested for membership within the range specified by operand 2.
|
|
|
8de16c |
-;; The bytes of operand 2 are organized as xx:xx:hi:lo.
|
|
|
8de16c |
-;;
|
|
|
8de16c |
-;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if
|
|
|
8de16c |
-;; lo <= vv and vv <= hi. Otherwise, set the GT bit to 0. The other
|
|
|
8de16c |
-;; 3 bits of the target CR register are all set to 0.
|
|
|
8de16c |
-(define_insn "*cmprb_internal"
|
|
|
8de16c |
- [(set (match_operand:CC 0 "cc_reg_operand" "=y")
|
|
|
8de16c |
- (unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
|
|
|
8de16c |
- (match_operand:SI 2 "gpc_reg_operand" "r")]
|
|
|
8de16c |
- UNSPEC_CMPRB))]
|
|
|
8de16c |
- "TARGET_P9_MISC"
|
|
|
8de16c |
- "cmprb %0,0,%1,%2"
|
|
|
8de16c |
- [(set_attr "type" "logical")])
|
|
|
8de16c |
-
|
|
|
8de16c |
-;; Set operand 0 register to -1 if the LT bit (0x8) of condition
|
|
|
8de16c |
-;; register operand 1 is on. Otherwise, set operand 0 register to 1
|
|
|
8de16c |
-;; if the GT bit (0x4) of condition register operand 1 is on.
|
|
|
8de16c |
-;; Otherwise, set operand 0 to 0. Note that the result stored into
|
|
|
8de16c |
-;; register operand 0 is non-zero iff either the LT or GT bits are on
|
|
|
8de16c |
-;; within condition register operand 1.
|
|
|
8de16c |
-(define_insn "setb_signed"
|
|
|
8de16c |
- [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
|
|
|
8de16c |
- (if_then_else:SI (lt (match_operand:CC 1 "cc_reg_operand" "y")
|
|
|
8de16c |
- (const_int 0))
|
|
|
8de16c |
- (const_int -1)
|
|
|
8de16c |
- (if_then_else (gt (match_dup 1)
|
|
|
8de16c |
- (const_int 0))
|
|
|
8de16c |
- (const_int 1)
|
|
|
8de16c |
- (const_int 0))))]
|
|
|
8de16c |
- "TARGET_P9_MISC"
|
|
|
8de16c |
- "setb %0,%1"
|
|
|
8de16c |
- [(set_attr "type" "logical")])
|
|
|
8de16c |
-
|
|
|
8de16c |
-(define_insn "setb_unsigned"
|
|
|
8de16c |
- [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
|
|
|
8de16c |
- (if_then_else:SI (ltu (match_operand:CCUNS 1 "cc_reg_operand" "y")
|
|
|
8de16c |
- (const_int 0))
|
|
|
8de16c |
- (const_int -1)
|
|
|
8de16c |
- (if_then_else (gtu (match_dup 1)
|
|
|
8de16c |
- (const_int 0))
|
|
|
8de16c |
- (const_int 1)
|
|
|
8de16c |
- (const_int 0))))]
|
|
|
8de16c |
- "TARGET_P9_MISC"
|
|
|
8de16c |
- "setb %0,%1"
|
|
|
8de16c |
- [(set_attr "type" "logical")])
|
|
|
8de16c |
-
|
|
|
8de16c |
-;; Test byte within two ranges.
|
|
|
8de16c |
-;;
|
|
|
8de16c |
-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
|
|
|
8de16c |
-;; represents a byte whose value is ignored in this context and
|
|
|
8de16c |
-;; vv, the least significant byte, holds the byte value that is to
|
|
|
8de16c |
-;; be tested for membership within the range specified by operand 2.
|
|
|
8de16c |
-;; The bytes of operand 2 are organized as hi_1:lo_1:hi_2:lo_2.
|
|
|
8de16c |
-;;
|
|
|
8de16c |
-;; Return in target register operand 0 a value of 1 if (lo_1 <= vv and
|
|
|
8de16c |
-;; vv <= hi_1) or if (lo_2 <= vv and vv <= hi_2). Otherwise, set register
|
|
|
8de16c |
-;; operand 0 to 0.
|
|
|
8de16c |
-;;
|
|
|
8de16c |
-;; Though the instructions to which this expansion maps operate on
|
|
|
8de16c |
-;; 64-bit registers, the current implementation only operates on
|
|
|
8de16c |
-;; SI-mode operands as the high-order bits provide no information
|
|
|
8de16c |
-;; that is not already available in the low-order bits. To avoid the
|
|
|
8de16c |
-;; costs of data widening operations, future enhancements might allow
|
|
|
8de16c |
-;; DI mode for operand 0 and/or might allow operand 1 to be QI mode.
|
|
|
8de16c |
-(define_expand "cmprb2"
|
|
|
8de16c |
- [(set (match_dup 3)
|
|
|
8de16c |
- (unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
|
|
|
8de16c |
- (match_operand:SI 2 "gpc_reg_operand" "r")]
|
|
|
8de16c |
- UNSPEC_CMPRB2))
|
|
|
8de16c |
- (set (match_operand:SI 0 "gpc_reg_operand" "=r")
|
|
|
8de16c |
- (if_then_else:SI (lt (match_dup 3)
|
|
|
8de16c |
- (const_int 0))
|
|
|
8de16c |
- (const_int -1)
|
|
|
8de16c |
- (if_then_else (gt (match_dup 3)
|
|
|
8de16c |
- (const_int 0))
|
|
|
8de16c |
- (const_int 1)
|
|
|
8de16c |
- (const_int 0))))]
|
|
|
8de16c |
- "TARGET_P9_MISC"
|
|
|
8de16c |
-{
|
|
|
8de16c |
- operands[3] = gen_reg_rtx (CCmode);
|
|
|
8de16c |
-})
|
|
|
8de16c |
-
|
|
|
8de16c |
-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
|
|
|
8de16c |
-;; represents a byte whose value is ignored in this context and
|
|
|
8de16c |
-;; vv, the least significant byte, holds the byte value that is to
|
|
|
8de16c |
-;; be tested for membership within the ranges specified by operand 2.
|
|
|
8de16c |
-;; The bytes of operand 2 are organized as hi_1:lo_1:hi_2:lo_2.
|
|
|
8de16c |
-;;
|
|
|
8de16c |
-;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if
|
|
|
8de16c |
-;; (lo_1 <= vv and vv <= hi_1) or if (lo_2 <= vv and vv <= hi_2).
|
|
|
8de16c |
-;; Otherwise, set the GT bit to 0. The other 3 bits of the target
|
|
|
8de16c |
-;; CR register are all set to 0.
|
|
|
8de16c |
-(define_insn "*cmprb2_internal"
|
|
|
8de16c |
- [(set (match_operand:CC 0 "cc_reg_operand" "=y")
|
|
|
8de16c |
- (unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
|
|
|
8de16c |
- (match_operand:SI 2 "gpc_reg_operand" "r")]
|
|
|
8de16c |
- UNSPEC_CMPRB2))]
|
|
|
8de16c |
- "TARGET_P9_MISC"
|
|
|
8de16c |
- "cmprb %0,1,%1,%2"
|
|
|
8de16c |
- [(set_attr "type" "logical")])
|
|
|
8de16c |
-
|
|
|
8de16c |
-;; Test byte membership within set of 8 bytes.
|
|
|
8de16c |
-;;
|
|
|
8de16c |
-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
|
|
|
8de16c |
-;; represents a byte whose value is ignored in this context and
|
|
|
8de16c |
-;; vv, the least significant byte, holds the byte value that is to
|
|
|
8de16c |
-;; be tested for membership within the set specified by operand 2.
|
|
|
8de16c |
-;; The bytes of operand 2 are organized as e0:e1:e2:e3:e4:e5:e6:e7.
|
|
|
8de16c |
-;;
|
|
|
8de16c |
-;; Return in target register operand 0 a value of 1 if vv equals one
|
|
|
8de16c |
-;; of the values e0, e1, e2, e3, e4, e5, e6, or e7. Otherwise, set
|
|
|
8de16c |
-;; register operand 0 to 0. Note that the 8 byte values held within
|
|
|
8de16c |
-;; operand 2 need not be unique.
|
|
|
8de16c |
-;;
|
|
|
8de16c |
-;; Though the instructions to which this expansion maps operate on
|
|
|
8de16c |
-;; 64-bit registers, the current implementation requires that operands
|
|
|
8de16c |
-;; 0 and 1 have mode SI as the high-order bits provide no information
|
|
|
8de16c |
-;; that is not already available in the low-order bits. To avoid the
|
|
|
8de16c |
-;; costs of data widening operations, future enhancements might allow
|
|
|
8de16c |
-;; DI mode for operand 0 and/or might allow operand 1 to be QI mode.
|
|
|
8de16c |
-(define_expand "cmpeqb"
|
|
|
8de16c |
- [(set (match_dup 3)
|
|
|
8de16c |
- (unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
|
|
|
8de16c |
- (match_operand:DI 2 "gpc_reg_operand" "r")]
|
|
|
8de16c |
- UNSPEC_CMPEQB))
|
|
|
8de16c |
- (set (match_operand:SI 0 "gpc_reg_operand" "=r")
|
|
|
8de16c |
- (if_then_else:SI (lt (match_dup 3)
|
|
|
8de16c |
- (const_int 0))
|
|
|
8de16c |
- (const_int -1)
|
|
|
8de16c |
- (if_then_else (gt (match_dup 3)
|
|
|
8de16c |
- (const_int 0))
|
|
|
8de16c |
- (const_int 1)
|
|
|
8de16c |
- (const_int 0))))]
|
|
|
8de16c |
- "TARGET_P9_MISC && TARGET_64BIT"
|
|
|
8de16c |
-{
|
|
|
8de16c |
- operands[3] = gen_reg_rtx (CCmode);
|
|
|
8de16c |
-})
|
|
|
8de16c |
-
|
|
|
8de16c |
-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
|
|
|
8de16c |
-;; represents a byte whose value is ignored in this context and
|
|
|
8de16c |
-;; vv, the least significant byte, holds the byte value that is to
|
|
|
8de16c |
-;; be tested for membership within the set specified by operand 2.
|
|
|
8de16c |
-;; The bytes of operand 2 are organized as e0:e1:e2:e3:e4:e5:e6:e7.
|
|
|
8de16c |
-;;
|
|
|
8de16c |
-;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if vv
|
|
|
8de16c |
-;; equals one of the values e0, e1, e2, e3, e4, e5, e6, or e7. Otherwise,
|
|
|
8de16c |
-;; set the GT bit to zero. The other 3 bits of the target CR register
|
|
|
8de16c |
-;; are all set to 0.
|
|
|
8de16c |
-(define_insn "*cmpeqb_internal"
|
|
|
8de16c |
- [(set (match_operand:CC 0 "cc_reg_operand" "=y")
|
|
|
8de16c |
- (unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
|
|
|
8de16c |
- (match_operand:DI 2 "gpc_reg_operand" "r")]
|
|
|
8de16c |
- UNSPEC_CMPEQB))]
|
|
|
8de16c |
- "TARGET_P9_MISC && TARGET_64BIT"
|
|
|
8de16c |
- "cmpeqb %0,%1,%2"
|
|
|
8de16c |
- [(set_attr "type" "logical")])
|
|
|
8de16c |
-
|
|
|
8de16c |
(define_expand "bcd<bcd_add_sub>_"
|
|
|
8de16c |
[(parallel [(set (reg:CCFP CR6_REGNO)
|
|
|
8de16c |
(compare:CCFP
|
|
|
8de16c |
--- gcc/config/rs6000/rs6000.md
|
|
|
8de16c |
+++ gcc/config/rs6000/rs6000.md
|
|
|
8de16c |
@@ -136,6 +136,12 @@
|
|
|
8de16c |
UNSPEC_LSQ
|
|
|
8de16c |
UNSPEC_FUSION_GPR
|
|
|
8de16c |
UNSPEC_STACK_CHECK
|
|
|
8de16c |
+ UNSPEC_DARN
|
|
|
8de16c |
+ UNSPEC_DARN_32
|
|
|
8de16c |
+ UNSPEC_DARN_RAW
|
|
|
8de16c |
+ UNSPEC_CMPRB
|
|
|
8de16c |
+ UNSPEC_CMPRB2
|
|
|
8de16c |
+ UNSPEC_CMPEQB
|
|
|
8de16c |
UNSPEC_FUSION_P9
|
|
|
8de16c |
UNSPEC_FUSION_ADDIS
|
|
|
8de16c |
UNSPEC_ADD_ROUND_TO_ODD
|
|
|
8de16c |
@@ -14600,7 +14606,225 @@
|
|
|
8de16c |
"xscmpuqp %0,%1,%2"
|
|
|
8de16c |
[(set_attr "type" "veccmp")
|
|
|
8de16c |
(set_attr "size" "128")])
|
|
|
8de16c |
+
|
|
|
8de16c |
+;; Miscellaneous ISA 3.0 (power9) instructions
|
|
|
8de16c |
+
|
|
|
8de16c |
+(define_insn "darn_32"
|
|
|
8de16c |
+ [(set (match_operand:SI 0 "register_operand" "=r")
|
|
|
8de16c |
+ (unspec:SI [(const_int 0)] UNSPEC_DARN_32))]
|
|
|
8de16c |
+ "TARGET_P9_MISC"
|
|
|
8de16c |
+ "darn %0,0"
|
|
|
8de16c |
+ [(set_attr "type" "integer")])
|
|
|
8de16c |
+
|
|
|
8de16c |
+(define_insn "darn_raw"
|
|
|
8de16c |
+ [(set (match_operand:DI 0 "register_operand" "=r")
|
|
|
8de16c |
+ (unspec:DI [(const_int 0)] UNSPEC_DARN_RAW))]
|
|
|
8de16c |
+ "TARGET_P9_MISC && TARGET_64BIT"
|
|
|
8de16c |
+ "darn %0,2"
|
|
|
8de16c |
+ [(set_attr "type" "integer")])
|
|
|
8de16c |
+
|
|
|
8de16c |
+(define_insn "darn"
|
|
|
8de16c |
+ [(set (match_operand:DI 0 "register_operand" "=r")
|
|
|
8de16c |
+ (unspec:DI [(const_int 0)] UNSPEC_DARN))]
|
|
|
8de16c |
+ "TARGET_P9_MISC && TARGET_64BIT"
|
|
|
8de16c |
+ "darn %0,1"
|
|
|
8de16c |
+ [(set_attr "type" "integer")])
|
|
|
8de16c |
+
|
|
|
8de16c |
+;; Test byte within range.
|
|
|
8de16c |
+;;
|
|
|
8de16c |
+;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
|
|
|
8de16c |
+;; represents a byte whose value is ignored in this context and
|
|
|
8de16c |
+;; vv, the least significant byte, holds the byte value that is to
|
|
|
8de16c |
+;; be tested for membership within the range specified by operand 2.
|
|
|
8de16c |
+;; The bytes of operand 2 are organized as xx:xx:hi:lo.
|
|
|
8de16c |
+;;
|
|
|
8de16c |
+;; Return in target register operand 0 a value of 1 if lo <= vv and
|
|
|
8de16c |
+;; vv <= hi. Otherwise, set register operand 0 to 0.
|
|
|
8de16c |
+;;
|
|
|
8de16c |
+;; Though the instructions to which this expansion maps operate on
|
|
|
8de16c |
+;; 64-bit registers, the current implementation only operates on
|
|
|
8de16c |
+;; SI-mode operands as the high-order bits provide no information
|
|
|
8de16c |
+;; that is not already available in the low-order bits. To avoid the
|
|
|
8de16c |
+;; costs of data widening operations, future enhancements might allow
|
|
|
8de16c |
+;; DI mode for operand 0 and/or might allow operand 1 to be QI mode.
|
|
|
8de16c |
+(define_expand "cmprb"
|
|
|
8de16c |
+ [(set (match_dup 3)
|
|
|
8de16c |
+ (unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
|
|
|
8de16c |
+ (match_operand:SI 2 "gpc_reg_operand" "r")]
|
|
|
8de16c |
+ UNSPEC_CMPRB))
|
|
|
8de16c |
+ (set (match_operand:SI 0 "gpc_reg_operand" "=r")
|
|
|
8de16c |
+ (if_then_else:SI (lt (match_dup 3)
|
|
|
8de16c |
+ (const_int 0))
|
|
|
8de16c |
+ (const_int -1)
|
|
|
8de16c |
+ (if_then_else (gt (match_dup 3)
|
|
|
8de16c |
+ (const_int 0))
|
|
|
8de16c |
+ (const_int 1)
|
|
|
8de16c |
+ (const_int 0))))]
|
|
|
8de16c |
+ "TARGET_P9_MISC"
|
|
|
8de16c |
+{
|
|
|
8de16c |
+ operands[3] = gen_reg_rtx (CCmode);
|
|
|
8de16c |
+})
|
|
|
8de16c |
+
|
|
|
8de16c |
+;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
|
|
|
8de16c |
+;; represents a byte whose value is ignored in this context and
|
|
|
8de16c |
+;; vv, the least significant byte, holds the byte value that is to
|
|
|
8de16c |
+;; be tested for membership within the range specified by operand 2.
|
|
|
8de16c |
+;; The bytes of operand 2 are organized as xx:xx:hi:lo.
|
|
|
8de16c |
+;;
|
|
|
8de16c |
+;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if
|
|
|
8de16c |
+;; lo <= vv and vv <= hi. Otherwise, set the GT bit to 0. The other
|
|
|
8de16c |
+;; 3 bits of the target CR register are all set to 0.
|
|
|
8de16c |
+(define_insn "*cmprb_internal"
|
|
|
8de16c |
+ [(set (match_operand:CC 0 "cc_reg_operand" "=y")
|
|
|
8de16c |
+ (unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
|
|
|
8de16c |
+ (match_operand:SI 2 "gpc_reg_operand" "r")]
|
|
|
8de16c |
+ UNSPEC_CMPRB))]
|
|
|
8de16c |
+ "TARGET_P9_MISC"
|
|
|
8de16c |
+ "cmprb %0,0,%1,%2"
|
|
|
8de16c |
+ [(set_attr "type" "logical")])
|
|
|
8de16c |
+
|
|
|
8de16c |
+;; Set operand 0 register to -1 if the LT bit (0x8) of condition
|
|
|
8de16c |
+;; register operand 1 is on. Otherwise, set operand 0 register to 1
|
|
|
8de16c |
+;; if the GT bit (0x4) of condition register operand 1 is on.
|
|
|
8de16c |
+;; Otherwise, set operand 0 to 0. Note that the result stored into
|
|
|
8de16c |
+;; register operand 0 is non-zero iff either the LT or GT bits are on
|
|
|
8de16c |
+;; within condition register operand 1.
|
|
|
8de16c |
+(define_insn "setb_signed"
|
|
|
8de16c |
+ [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
|
|
|
8de16c |
+ (if_then_else:SI (lt (match_operand:CC 1 "cc_reg_operand" "y")
|
|
|
8de16c |
+ (const_int 0))
|
|
|
8de16c |
+ (const_int -1)
|
|
|
8de16c |
+ (if_then_else (gt (match_dup 1)
|
|
|
8de16c |
+ (const_int 0))
|
|
|
8de16c |
+ (const_int 1)
|
|
|
8de16c |
+ (const_int 0))))]
|
|
|
8de16c |
+ "TARGET_P9_MISC"
|
|
|
8de16c |
+ "setb %0,%1"
|
|
|
8de16c |
+ [(set_attr "type" "logical")])
|
|
|
8de16c |
+
|
|
|
8de16c |
+(define_insn "setb_unsigned"
|
|
|
8de16c |
+ [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
|
|
|
8de16c |
+ (if_then_else:SI (ltu (match_operand:CCUNS 1 "cc_reg_operand" "y")
|
|
|
8de16c |
+ (const_int 0))
|
|
|
8de16c |
+ (const_int -1)
|
|
|
8de16c |
+ (if_then_else (gtu (match_dup 1)
|
|
|
8de16c |
+ (const_int 0))
|
|
|
8de16c |
+ (const_int 1)
|
|
|
8de16c |
+ (const_int 0))))]
|
|
|
8de16c |
+ "TARGET_P9_MISC"
|
|
|
8de16c |
+ "setb %0,%1"
|
|
|
8de16c |
+ [(set_attr "type" "logical")])
|
|
|
8de16c |
+
|
|
|
8de16c |
+;; Test byte within two ranges.
|
|
|
8de16c |
+;;
|
|
|
8de16c |
+;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
|
|
|
8de16c |
+;; represents a byte whose value is ignored in this context and
|
|
|
8de16c |
+;; vv, the least significant byte, holds the byte value that is to
|
|
|
8de16c |
+;; be tested for membership within the range specified by operand 2.
|
|
|
8de16c |
+;; The bytes of operand 2 are organized as hi_1:lo_1:hi_2:lo_2.
|
|
|
8de16c |
+;;
|
|
|
8de16c |
+;; Return in target register operand 0 a value of 1 if (lo_1 <= vv and
|
|
|
8de16c |
+;; vv <= hi_1) or if (lo_2 <= vv and vv <= hi_2). Otherwise, set register
|
|
|
8de16c |
+;; operand 0 to 0.
|
|
|
8de16c |
+;;
|
|
|
8de16c |
+;; Though the instructions to which this expansion maps operate on
|
|
|
8de16c |
+;; 64-bit registers, the current implementation only operates on
|
|
|
8de16c |
+;; SI-mode operands as the high-order bits provide no information
|
|
|
8de16c |
+;; that is not already available in the low-order bits. To avoid the
|
|
|
8de16c |
+;; costs of data widening operations, future enhancements might allow
|
|
|
8de16c |
+;; DI mode for operand 0 and/or might allow operand 1 to be QI mode.
|
|
|
8de16c |
+(define_expand "cmprb2"
|
|
|
8de16c |
+ [(set (match_dup 3)
|
|
|
8de16c |
+ (unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
|
|
|
8de16c |
+ (match_operand:SI 2 "gpc_reg_operand" "r")]
|
|
|
8de16c |
+ UNSPEC_CMPRB2))
|
|
|
8de16c |
+ (set (match_operand:SI 0 "gpc_reg_operand" "=r")
|
|
|
8de16c |
+ (if_then_else:SI (lt (match_dup 3)
|
|
|
8de16c |
+ (const_int 0))
|
|
|
8de16c |
+ (const_int -1)
|
|
|
8de16c |
+ (if_then_else (gt (match_dup 3)
|
|
|
8de16c |
+ (const_int 0))
|
|
|
8de16c |
+ (const_int 1)
|
|
|
8de16c |
+ (const_int 0))))]
|
|
|
8de16c |
+ "TARGET_P9_MISC"
|
|
|
8de16c |
+{
|
|
|
8de16c |
+ operands[3] = gen_reg_rtx (CCmode);
|
|
|
8de16c |
+})
|
|
|
8de16c |
+
|
|
|
8de16c |
+;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
|
|
|
8de16c |
+;; represents a byte whose value is ignored in this context and
|
|
|
8de16c |
+;; vv, the least significant byte, holds the byte value that is to
|
|
|
8de16c |
+;; be tested for membership within the ranges specified by operand 2.
|
|
|
8de16c |
+;; The bytes of operand 2 are organized as hi_1:lo_1:hi_2:lo_2.
|
|
|
8de16c |
+;;
|
|
|
8de16c |
+;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if
|
|
|
8de16c |
+;; (lo_1 <= vv and vv <= hi_1) or if (lo_2 <= vv and vv <= hi_2).
|
|
|
8de16c |
+;; Otherwise, set the GT bit to 0. The other 3 bits of the target
|
|
|
8de16c |
+;; CR register are all set to 0.
|
|
|
8de16c |
+(define_insn "*cmprb2_internal"
|
|
|
8de16c |
+ [(set (match_operand:CC 0 "cc_reg_operand" "=y")
|
|
|
8de16c |
+ (unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
|
|
|
8de16c |
+ (match_operand:SI 2 "gpc_reg_operand" "r")]
|
|
|
8de16c |
+ UNSPEC_CMPRB2))]
|
|
|
8de16c |
+ "TARGET_P9_MISC"
|
|
|
8de16c |
+ "cmprb %0,1,%1,%2"
|
|
|
8de16c |
+ [(set_attr "type" "logical")])
|
|
|
8de16c |
|
|
|
8de16c |
+;; Test byte membership within set of 8 bytes.
|
|
|
8de16c |
+;;
|
|
|
8de16c |
+;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
|
|
|
8de16c |
+;; represents a byte whose value is ignored in this context and
|
|
|
8de16c |
+;; vv, the least significant byte, holds the byte value that is to
|
|
|
8de16c |
+;; be tested for membership within the set specified by operand 2.
|
|
|
8de16c |
+;; The bytes of operand 2 are organized as e0:e1:e2:e3:e4:e5:e6:e7.
|
|
|
8de16c |
+;;
|
|
|
8de16c |
+;; Return in target register operand 0 a value of 1 if vv equals one
|
|
|
8de16c |
+;; of the values e0, e1, e2, e3, e4, e5, e6, or e7. Otherwise, set
|
|
|
8de16c |
+;; register operand 0 to 0. Note that the 8 byte values held within
|
|
|
8de16c |
+;; operand 2 need not be unique.
|
|
|
8de16c |
+;;
|
|
|
8de16c |
+;; Though the instructions to which this expansion maps operate on
|
|
|
8de16c |
+;; 64-bit registers, the current implementation requires that operands
|
|
|
8de16c |
+;; 0 and 1 have mode SI as the high-order bits provide no information
|
|
|
8de16c |
+;; that is not already available in the low-order bits. To avoid the
|
|
|
8de16c |
+;; costs of data widening operations, future enhancements might allow
|
|
|
8de16c |
+;; DI mode for operand 0 and/or might allow operand 1 to be QI mode.
|
|
|
8de16c |
+(define_expand "cmpeqb"
|
|
|
8de16c |
+ [(set (match_dup 3)
|
|
|
8de16c |
+ (unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
|
|
|
8de16c |
+ (match_operand:DI 2 "gpc_reg_operand" "r")]
|
|
|
8de16c |
+ UNSPEC_CMPEQB))
|
|
|
8de16c |
+ (set (match_operand:SI 0 "gpc_reg_operand" "=r")
|
|
|
8de16c |
+ (if_then_else:SI (lt (match_dup 3)
|
|
|
8de16c |
+ (const_int 0))
|
|
|
8de16c |
+ (const_int -1)
|
|
|
8de16c |
+ (if_then_else (gt (match_dup 3)
|
|
|
8de16c |
+ (const_int 0))
|
|
|
8de16c |
+ (const_int 1)
|
|
|
8de16c |
+ (const_int 0))))]
|
|
|
8de16c |
+ "TARGET_P9_MISC && TARGET_64BIT"
|
|
|
8de16c |
+{
|
|
|
8de16c |
+ operands[3] = gen_reg_rtx (CCmode);
|
|
|
8de16c |
+})
|
|
|
8de16c |
+
|
|
|
8de16c |
+;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
|
|
|
8de16c |
+;; represents a byte whose value is ignored in this context and
|
|
|
8de16c |
+;; vv, the least significant byte, holds the byte value that is to
|
|
|
8de16c |
+;; be tested for membership within the set specified by operand 2.
|
|
|
8de16c |
+;; The bytes of operand 2 are organized as e0:e1:e2:e3:e4:e5:e6:e7.
|
|
|
8de16c |
+;;
|
|
|
8de16c |
+;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if vv
|
|
|
8de16c |
+;; equals one of the values e0, e1, e2, e3, e4, e5, e6, or e7. Otherwise,
|
|
|
8de16c |
+;; set the GT bit to zero. The other 3 bits of the target CR register
|
|
|
8de16c |
+;; are all set to 0.
|
|
|
8de16c |
+(define_insn "*cmpeqb_internal"
|
|
|
8de16c |
+ [(set (match_operand:CC 0 "cc_reg_operand" "=y")
|
|
|
8de16c |
+ (unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
|
|
|
8de16c |
+ (match_operand:DI 2 "gpc_reg_operand" "r")]
|
|
|
8de16c |
+ UNSPEC_CMPEQB))]
|
|
|
8de16c |
+ "TARGET_P9_MISC && TARGET_64BIT"
|
|
|
8de16c |
+ "cmpeqb %0,%1,%2"
|
|
|
8de16c |
+ [(set_attr "type" "logical")])
|
|
|
8de16c |
|
|
|
8de16c |
|
|
|
8de16c |
(include "sync.md")
|