Fix for vcmpequt builtin

Message ID 15d285ea0c083e390c81877374fc937a111d87d3.camel@us.ibm.com
State New
Headers show
Series
  • Fix for vcmpequt builtin
Related show

Commit Message

Xionghu Luo via Gcc-patches June 14, 2021, 8:50 p.m.
GCC Maintainers:

The following patch removes some unused BU_P10_OVERLOAD_2 entries. 
Also, it fixes the builtin definition to use the altivec_eqv1ti
instruction definition for the compare instruction.

The patch has been tested on powerpc64le-linux (Power 10 LE)

Please let me know if the patch is acceptable for mainline. 

                    Carl Love

-----------------------------------------------------------

The vcmpequt builtin define eqvv1ti3 points to the eqv define instruction for
the eqv instruction.  The vcmpequt builtin define should point to the altivec_eqv1ti
instruction definition for the vcmpequq instruction.

2021-06-14  Carl Love  <cel@us.ibm.com>

gcc/testsuite/ChangeLog
	PR target/101022
	* config/rs6000/rs6000-builtin.def (VCMPEQUT): Fix the ICODE for the
	enum definition.
	(VRLQ, VSLQ, VSRQ, VSRAQ): Remove unused BU_P10_OVERLOAD_2 definitions.
---
 gcc/config/rs6000/rs6000-builtin.def | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

-- 
2.27.0

Comments

Segher Boessenkool June 14, 2021, 9:35 p.m. | #1
Hi!

On Mon, Jun 14, 2021 at 01:50:57PM -0700, Carl Love wrote:
> The following patch removes some unused BU_P10_OVERLOAD_2 entries. 

> Also, it fixes the builtin definition to use the altivec_eqv1ti

> instruction definition for the compare instruction.


>  BU_P10V_AV_2 (VCMPGTUT,		"vcmpgtut",	CONST,	vector_gtuv1ti)

>  BU_P10V_AV_2 (VCMPGTST,		"vcmpgtst",	CONST,	vector_gtv1ti)

> -BU_P10V_AV_2 (VCMPEQUT,		"vcmpequt",	CONST,	eqvv1ti3)

> +BU_P10V_AV_2 (VCMPEQUT,		"vcmpequt",	CONST,	altivec_eqv1ti)


Could / should this use vector_eqv1ti instead?

Do you perhaps have a testcase for the eq/eqv mixup thing?  Don't spend
too much time on it, but maybe you have something.

Okay for trunk with that vector_eqv1ti change if that works (and is a
good idea etc.), and without it otherwise.  Thanks!


Segher

Patch

diff --git a/gcc/config/rs6000/rs6000-builtin.def b/gcc/config/rs6000/rs6000-builtin.def
index 231e7c9d420..615ec1ede55 100644
--- a/gcc/config/rs6000/rs6000-builtin.def
+++ b/gcc/config/rs6000/rs6000-builtin.def
@@ -2924,7 +2924,7 @@  BU_P10V_VSX_2 (XXGENPCVM_V4SI, "xxgenpcvm_v4si", CONST, xxgenpcvm_v4si)
 BU_P10V_VSX_2 (XXGENPCVM_V2DI, "xxgenpcvm_v2di", CONST, xxgenpcvm_v2di)
 BU_P10V_AV_2 (VCMPGTUT,		"vcmpgtut",	CONST,	vector_gtuv1ti)
 BU_P10V_AV_2 (VCMPGTST,		"vcmpgtst",	CONST,	vector_gtv1ti)
-BU_P10V_AV_2 (VCMPEQUT,		"vcmpequt",	CONST,	eqvv1ti3)
+BU_P10V_AV_2 (VCMPEQUT,		"vcmpequt",	CONST,	altivec_eqv1ti)
 BU_P10V_AV_2 (CMPNET,		"vcmpnet",	CONST,	vcmpnet)
 BU_P10V_AV_2 (CMPGE_1TI,	"cmpge_1ti",    CONST,  vector_nltv1ti)
 BU_P10V_AV_2 (CMPGE_U1TI,	"cmpge_u1ti",   CONST,  vector_nltuv1ti)
@@ -3078,10 +3078,6 @@  BU_P10_OVERLOAD_2 (CLRR, "clrr")
 BU_P10_OVERLOAD_2 (GNB, "gnb")
 BU_P10_OVERLOAD_4 (XXEVAL, "xxeval")
 BU_P10_OVERLOAD_2 (XXGENPCVM, "xxgenpcvm")
-BU_P10_OVERLOAD_2 (VRLQ, "vrlq")
-BU_P10_OVERLOAD_2 (VSLQ, "vslq")
-BU_P10_OVERLOAD_2 (VSRQ, "vsrq")
-BU_P10_OVERLOAD_2 (VSRAQ, "vsraq")
 
 BU_P10_OVERLOAD_3 (EXTRACTL, "extractl")
 BU_P10_OVERLOAD_3 (EXTRACTH, "extracth")