From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 63AE738768BB for ; Fri, 30 Jun 2023 15:54:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 63AE738768BB Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1688140452; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eq7wnQVp/dJsVfrQ+OY8vGJUQhg2M0yO5F/QULFNC+A=; b=bXjulp1TJgETt0KBtkMQWpd2BEm1EHmsvi6ahdB10T6L6poZwwfVxft/VcUhmk3BAzYWRh fP8BRxSzQg4Ttrs7CeJi8bOAwutpT8tyOuYSF7BYgBI9jiCsw8OLP6xlAPDKVB3yRKQwjd 3OTzUrjPMhAuBXorV/AlJ8XgaQ+5ZGU= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-512-LZ640T3EOwGn70b66aiIgA-1; Fri, 30 Jun 2023 11:54:10 -0400 X-MC-Unique: LZ640T3EOwGn70b66aiIgA-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6DD1F185A7A8 for ; Fri, 30 Jun 2023 15:54:10 +0000 (UTC) Received: from t14s.localdomain.com (unknown [10.22.18.231]) by smtp.corp.redhat.com (Postfix) with ESMTP id 38D0D1400C35; Fri, 30 Jun 2023 15:54:10 +0000 (UTC) From: David Malcolm To: gcc-patches@gcc.gnu.org Cc: David Malcolm , Marek Polacek Subject: [pushed 1/2] jit: avoid using __vector in testcase [PR110466] Date: Fri, 30 Jun 2023 11:54:08 -0400 Message-Id: <20230630155409.183039-1-dmalcolm@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-Spam-Status: No, score=-11.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: r13-4531-gd2e782cb99c311 added test coverage to libgccjit's vector support, but used __vector, which doesn't work on Power. Additionally the size param to gcc_jit_type_get_vector was wrong. Fixed thusly. Successfully regrtested on x86_64-pc-linux-gnu. Verified fix on powerpc64le-unknown-linux-gnu (gcc112 in Compile Farm). Pushed to trunk as r14-2222-g6735d660839533. gcc/testsuite/ChangeLog: PR jit/110466 * jit.dg/test-expressions.c (run_test_of_comparison): Fix size param to gcc_jit_type_get_vector. (verify_comparisons): Use a typedef rather than __vector. Co-authored-by: Marek Polacek --- gcc/testsuite/jit.dg/test-expressions.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/gcc/testsuite/jit.dg/test-expressions.c b/gcc/testsuite/jit.dg/test-expressions.c index 13b3baf79ea..2337b01907e 100644 --- a/gcc/testsuite/jit.dg/test-expressions.c +++ b/gcc/testsuite/jit.dg/test-expressions.c @@ -417,7 +417,7 @@ static void run_test_of_comparison(gcc_jit_context *ctxt, const char *expected) { gcc_jit_type *vec_type = - gcc_jit_type_get_vector (type, 4); + gcc_jit_type_get_vector (type, 2); CHECK_STRING_VALUE ( make_test_of_comparison (ctxt, @@ -560,17 +560,17 @@ verify_comparisons (gcc_jit_result *result) CHECK_VALUE (test_COMPARISON_GE_on_int (1, 2), 0); CHECK_VALUE (test_COMPARISON_GE_on_int (2, 1), 1); - typedef int __vector __attribute__ ((__vector_size__ (sizeof(int) * 2))); - typedef __vector (*test_vec_fn) (__vector, __vector); + typedef int v2si __attribute__ ((__vector_size__ (sizeof(int) * 2))); + typedef v2si (*test_vec_fn) (v2si, v2si); - __vector zero_zero = {0, 0}; - __vector zero_one = {0, 1}; - __vector one_zero = {1, 0}; + v2si zero_zero = {0, 0}; + v2si zero_one = {0, 1}; + v2si one_zero = {1, 0}; - __vector true_true = {-1, -1}; - __vector false_true = {0, -1}; - __vector true_false = {-1, 0}; - __vector false_false = {0, 0}; + v2si true_true = {-1, -1}; + v2si false_true = {0, -1}; + v2si true_false = {-1, 0}; + v2si false_false = {0, 0}; test_vec_fn test_COMPARISON_EQ_on_vec_int = (test_vec_fn)gcc_jit_result_get_code (result, @@ -615,7 +615,7 @@ verify_comparisons (gcc_jit_result *result) CHECK_VECTOR_VALUE (2, test_COMPARISON_GE_on_vec_int (zero_one, one_zero), false_true); typedef float __vector_f __attribute__ ((__vector_size__ (sizeof(float) * 2))); - typedef __vector (*test_vec_f_fn) (__vector_f, __vector_f); + typedef v2si (*test_vec_f_fn) (__vector_f, __vector_f); __vector_f zero_zero_f = {0, 0}; __vector_f zero_one_f = {0, 1}; -- 2.26.3