From patchwork Tue Jun 11 08:26:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Schulze Frielinghaus X-Patchwork-Id: 1946170 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256 header.s=pp1 header.b=j+DNkzJ0; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Vz1yk35ndz20KL for ; Tue, 11 Jun 2024 18:28:14 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 15C69385B510 for ; Tue, 11 Jun 2024 08:28:12 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id 1DCC03858C5F for ; Tue, 11 Jun 2024 08:26:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1DCC03858C5F Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linux.ibm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 1DCC03858C5F Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=148.163.156.1 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1718094415; cv=none; b=XQJLaPYJp6EQg+FlH5zWIXwKJehKF4kN2e1SW2g0KDw0bhXUxxl4cfulmvKX+rH86PkZFxGPlRFuBF1ThRX0Xl32DKQs7FL0bp6C10l2NYCjw3x5o/Qx4yXGUHTo+tORhV4DFUXU4DBivTJ3+7soxRjpAao7gsrj8dtnp7narTY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1718094415; c=relaxed/simple; bh=vxhthw1deAT+4BPkf4zLh9fyyIXOXQUgtuH0bhBhSwM=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=Ic2bnS46AQ7QBWvwK+bxwy68AYGPXFDXc+pq9FWKSBr0R/kIl3+svWgFafqQXwVyRGp27dP+/U+LTPArk6b7g8GthCMeuElhxlj8OFlPu8CnqpV6y63KXn4xgHHrOHlNqIfdFjZsHEuXVoWdJvpAyde2vfQKQwCb6kTtd6scSMI= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from pps.filterd (m0353726.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45B7QoeI012915 for ; Tue, 11 Jun 2024 08:26:50 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from :to:cc:subject:date:message-id:mime-version :content-transfer-encoding; s=pp1; bh=JiuW0sB23dSWYW7aTRMIA4RLpU GB5FWP8aOZgotEFHM=; b=j+DNkzJ0i1zijvFXPEgkx7kmqjorwTpIryaBEhx7vN mrWGU6mNo99+CC8z2y+39M98yZOOD847pteKX8rZ9D8p9t1/n7SpHFx33d4jGGN3 oiQFSUAd/pyKcs2t7kAgk4aNCgzvq64g6MZO3GfvbIJP70wnlXxaEol7jl+z7gux gpipDoc3tImaqXwbkbmrBuGFZHeYBH9sId6tYgE8SQs/hw3r2aauBDW5Jy3R4uwK ifo4jcnFqUhkAx3eDWF8JCJkG6mTaYRKxY9I1pg/VOJ9zU7R9P6142ba6BQnlRId KggHPNRV3V8agSMXdSubQZ87jUGTeLPjgXO2FvPSlF5w== Received: from ppma21.wdc07v.mail.ibm.com (5b.69.3da9.ip4.static.sl-reverse.com [169.61.105.91]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3yphspg7pw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 11 Jun 2024 08:26:49 +0000 (GMT) Received: from pps.filterd (ppma21.wdc07v.mail.ibm.com [127.0.0.1]) by ppma21.wdc07v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 45B77V6v003878 for ; Tue, 11 Jun 2024 08:26:48 GMT Received: from smtprelay07.fra02v.mail.ibm.com ([9.218.2.229]) by ppma21.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3yn2mpmrnc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 11 Jun 2024 08:26:48 +0000 Received: from smtpav06.fra02v.mail.ibm.com (smtpav06.fra02v.mail.ibm.com [10.20.54.105]) by smtprelay07.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 45B8Qhfx52756794 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 11 Jun 2024 08:26:45 GMT Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0A93B2004F; Tue, 11 Jun 2024 08:26:43 +0000 (GMT) Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E0F7A20040; Tue, 11 Jun 2024 08:26:42 +0000 (GMT) Received: from a8345010.lnxne.boe (unknown [9.152.108.100]) by smtpav06.fra02v.mail.ibm.com (Postfix) with ESMTPS; Tue, 11 Jun 2024 08:26:42 +0000 (GMT) From: Stefan Schulze Frielinghaus To: krebbel@linux.ibm.com, gcc-patches@gcc.gnu.org Cc: Stefan Schulze Frielinghaus Subject: [PATCH] s390: Extend two element float vector Date: Tue, 11 Jun 2024 10:26:33 +0200 Message-ID: <20240611082633.1414082-1-stefansf@linux.ibm.com> X-Mailer: git-send-email 2.45.1 MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: xZi5l1AFe7pzqIiHgYPVJm2YiQamIjRC X-Proofpoint-GUID: xZi5l1AFe7pzqIiHgYPVJm2YiQamIjRC X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-11_03,2024-06-11_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 mlxscore=0 priorityscore=1501 spamscore=0 lowpriorityscore=0 clxscore=1015 bulkscore=0 adultscore=0 phishscore=0 mlxlogscore=945 suspectscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2405170001 definitions=main-2406110059 X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, 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 X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org This implements a V2SF -> V2DF extend. gcc/ChangeLog: * config/s390/vector.md (*vmrhf): New. (extendv2sfv2df2): New. gcc/testsuite/ChangeLog: * gcc.target/s390/vector/vec-extend-3.c: New test. --- Bootstrap and regtested on s390. Ok for mainline? gcc/config/s390/vector.md | 28 +++++++++++++++++++ .../gcc.target/s390/vector/vec-extend-3.c | 18 ++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 gcc/testsuite/gcc.target/s390/vector/vec-extend-3.c diff --git a/gcc/config/s390/vector.md b/gcc/config/s390/vector.md index a931a4b1b17..d8657fae56d 100644 --- a/gcc/config/s390/vector.md +++ b/gcc/config/s390/vector.md @@ -895,6 +895,17 @@ "vmrhf\t%0,%1,%2"; [(set_attr "op_type" "VRR")]) +(define_insn "*vmrhf" + [(set (match_operand:V_HW_4 0 "register_operand" "=v") + (vec_select:V_HW_4 + (vec_concat:V_HW_4 (match_operand: 1 "register_operand" "v") + (match_operand: 2 "register_operand" "v")) + (parallel [(const_int 0) (const_int 2) + (const_int 1) (const_int 3)])))] + "TARGET_VX" + "vmrhf\t%0,%1,%2"; + [(set_attr "op_type" "VRR")]) + (define_insn "*vmrlf" [(set (match_operand:V_HW_4 0 "register_operand" "=v") (vec_select:V_HW_4 @@ -2394,6 +2405,23 @@ "vuph\t%0,%1" [(set_attr "op_type" "VRR")]) +(define_expand "extendv2sfv2df2" + [(set (match_dup 2) + (vec_select:V4SF + (vec_concat:V4SF (match_operand:V2SF 1 "register_operand") + (match_dup 1)) + (parallel [(const_int 0) (const_int 2) + (const_int 1) (const_int 3)]))) + (set (match_operand:V2DF 0 "register_operand") + (float_extend:V2DF + (vec_select:V2SF + (match_dup 2) + (parallel [(const_int 0) (const_int 2)]))))] + "TARGET_VX" +{ + operands[2] = gen_reg_rtx (V4SFmode); +}) + ;; vector unpack v16qi ; signed diff --git a/gcc/testsuite/gcc.target/s390/vector/vec-extend-3.c b/gcc/testsuite/gcc.target/s390/vector/vec-extend-3.c new file mode 100644 index 00000000000..2b02e7bf9f8 --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/vector/vec-extend-3.c @@ -0,0 +1,18 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -march=z13 -mzarch" } */ +/* { dg-final { check-function-bodies "**" "" "" } } */ + +typedef float v2sf __attribute__ ((vector_size (8))); +typedef double v2df __attribute__ ((vector_size (16))); + +/* +** extendv2sfv2df2: +** vmrhf %v24,%v24,%v24 +** vldeb %v24,%v24 +** br %r14 +*/ + +v2df extendv2sfv2df2 (v2sf x) +{ + return __builtin_convertvector (x, v2df); +}