diff mbox series

[v3,5/9] S/390: Implement vcond expander for V1TI,V1TF

Message ID 20190905111019.8951-6-iii@linux.ibm.com
State New
Headers show
Series S/390: Use signaling FP comparison instructions | expand

Commit Message

Ilya Leoshkevich Sept. 5, 2019, 11:10 a.m. UTC
Currently gcc does not emit wf{c,k}* instructions when comparing long
double values.  Middle-end actually adds them in the first place, but
then veclower pass replaces them with floating point register pair
operations, because the corresponding expander is missing.

gcc/ChangeLog:

2019-08-09  Ilya Leoshkevich  <iii@linux.ibm.com>

	PR target/77918
	* config/s390/vector.md (vcondv1tiv1tf): New variant of
	vcond$a$b expander.
---
 gcc/config/s390/vector.md | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

Comments

Andreas Krebbel Sept. 30, 2019, 2:51 p.m. UTC | #1
On 05.09.19 13:10, Ilya Leoshkevich wrote:
> Currently gcc does not emit wf{c,k}* instructions when comparing long
> double values.  Middle-end actually adds them in the first place, but
> then veclower pass replaces them with floating point register pair
> operations, because the corresponding expander is missing.
> 
> gcc/ChangeLog:
> 
> 2019-08-09  Ilya Leoshkevich  <iii@linux.ibm.com>
> 
> 	PR target/77918
> 	* config/s390/vector.md (vcondv1tiv1tf): New variant of
> 	vcond$a$b expander.

Couldn't you just add V1TI to V_HW and V_HW2 instead?

Andreas

> ---
>  gcc/config/s390/vector.md | 15 +++++++++++++++
>  1 file changed, 15 insertions(+)
> 
> diff --git a/gcc/config/s390/vector.md b/gcc/config/s390/vector.md
> index d7a266c5605..ca5ec0dd3b0 100644
> --- a/gcc/config/s390/vector.md
> +++ b/gcc/config/s390/vector.md
> @@ -649,6 +649,21 @@
>    DONE;
>  })
>  
> +(define_expand "vcondv1tiv1tf"
> +  [(set (match_operand:V1TI 0 "register_operand" "")
> +	(if_then_else:V1TI
> +	 (match_operator 3 "vcond_comparison_operator"
> +			 [(match_operand:V1TF 4 "register_operand" "")
> +			  (match_operand:V1TF 5 "nonmemory_operand" "")])
> +	 (match_operand:V1TI 1 "nonmemory_operand" "")
> +	 (match_operand:V1TI 2 "nonmemory_operand" "")))]
> +  "TARGET_VXE"
> +{
> +  s390_expand_vcond (operands[0], operands[1], operands[2],
> +		     GET_CODE (operands[3]), operands[4], operands[5]);
> +  DONE;
> +})
> +
>  (define_expand "vcondu<V_HW:mode><V_HW2:mode>"
>    [(set (match_operand:V_HW 0 "register_operand" "")
>  	(if_then_else:V_HW
>
diff mbox series

Patch

diff --git a/gcc/config/s390/vector.md b/gcc/config/s390/vector.md
index d7a266c5605..ca5ec0dd3b0 100644
--- a/gcc/config/s390/vector.md
+++ b/gcc/config/s390/vector.md
@@ -649,6 +649,21 @@ 
   DONE;
 })
 
+(define_expand "vcondv1tiv1tf"
+  [(set (match_operand:V1TI 0 "register_operand" "")
+	(if_then_else:V1TI
+	 (match_operator 3 "vcond_comparison_operator"
+			 [(match_operand:V1TF 4 "register_operand" "")
+			  (match_operand:V1TF 5 "nonmemory_operand" "")])
+	 (match_operand:V1TI 1 "nonmemory_operand" "")
+	 (match_operand:V1TI 2 "nonmemory_operand" "")))]
+  "TARGET_VXE"
+{
+  s390_expand_vcond (operands[0], operands[1], operands[2],
+		     GET_CODE (operands[3]), operands[4], operands[5]);
+  DONE;
+})
+
 (define_expand "vcondu<V_HW:mode><V_HW2:mode>"
   [(set (match_operand:V_HW 0 "register_operand" "")
 	(if_then_else:V_HW