From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-x532.google.com (mail-ed1-x532.google.com [IPv6:2a00:1450:4864:20::532]) by sourceware.org (Postfix) with ESMTPS id 063633857B97 for ; Tue, 19 Dec 2023 09:01:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 063633857B97 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 063633857B97 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::532 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702976512; cv=none; b=B05lE8iEJXO9DU2ItYRE7OcoBGFp5nLG/t3PXH4YaSo088dw0g+7cDhZR7lgwxfCJ5ubME0Mc6zL5lw6gEO68mI+sciPds9bYWvm7h8hRh+FxGWI9Zqmn6g6VsrMpE9W6yNxHiXmUDYgB6MvjYqlhXSZuRlGGdjqzdsmelX5AeQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702976512; c=relaxed/simple; bh=VRDvnWZHgUXIeIArCX5tAdoBr0VQ6ZOKx7EvT6OOxTA=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=dvU/jA8iKBvbKF1VsVvg9i3i52EPSqDB6eqk3US5DbKJ3C/7fYLgIvs+GWUxDkXipp/rf8rpF3vSwaoVNbILZsCpoG4X6sddpH3BrckOkksJiUyRhhogitfw/RThoIdoDu5Gi2ieaVrNL4A42ASlifisIOOaKf8OxCsEhd41piQ= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-ed1-x532.google.com with SMTP id 4fb4d7f45d1cf-55114c073b8so5213619a12.1 for ; Tue, 19 Dec 2023 01:01:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702976506; x=1703581306; darn=gcc.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=6sD0CYJf4uWwSDgcI+ViVXviWqkkZFQzacSIjkKCIEY=; b=Qs5E//+CcKUsFQlnHC4TwCOos6ZedXfaLlE6q7C4lt9IwqY5TrEuaOfiPGFt+dQ1Jr tSrzC35PPLmizRumJaPv4NoW7KiqwU4uP1Vc/B48aax5zimMngLRzSQKe8eciVGDaVL6 34Ytp4dxUOpelF/eeglQJJBmjhhyEKUA6J5lQnsZTbSenO2qU+xHGBN2aSzWD6vAvEBz dKIdVN149Vo4F2kcwLcxcnmVTTrLKjHbdfbswbRtmy3L26G3As2AbyQpP70iGHFRtPIz 6liucPziYw0EtbVsRcAAJBSZk4qY4v+lQM+5BOjXbElCCq3ebyghRVB2ICKUdFGr2PQB NWtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702976506; x=1703581306; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6sD0CYJf4uWwSDgcI+ViVXviWqkkZFQzacSIjkKCIEY=; b=oz25Mn9wON+wjL2vAlLu0kcfUb4dduj0bSo9HaWXJj6SQabkIa705ros08GHBndxQE 3u3/x2T7zZIuKVHliSi4BSCzVvw9frWjL3P/3WRhBp5fgXV+/Ve1Dvw+HTqv2NL1omWh zyKVCkMwDoa8W+bnTwQUXTtLEoza3yFlVH9PaqUlAZfLLwrh8UYs7vGOtO8wes3JigoF m8Bo42OXzdm+FSEGWzjWzByC7ae9QtIns2MjTXZIBtBaTtfUTjTAux7jeWVIUtLDWxN4 9F/Uy+RZ55ScO8rOTtZ3KeV7agYCuua3H2xT176pkbnyRSTTOAncpOHloLe82M5GD2DR CPeg== X-Gm-Message-State: AOJu0YwBxg+ZO9Cmsx8NueUdgMiMXEKX9GxkDMQMGSTnJvh+YCyKJkZ0 4e5WQ8hfN92ghv9PZQnzd+X8IJZp1qCC0ia+UCeuTTowGjA= X-Google-Smtp-Source: AGHT+IHj8ILoP+il9WQobJYGsK8BPBS0vZD+TC9t53I3WRCEYQv6PbYc9VJfkIjW1OttrEiWWeRsfoAVpODDAGGQOuk= X-Received: by 2002:a50:9fe9:0:b0:553:309d:f1e5 with SMTP id c96-20020a509fe9000000b00553309df1e5mr1666153edf.69.1702976506333; Tue, 19 Dec 2023 01:01:46 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Uros Bizjak Date: Tue, 19 Dec 2023 10:01:35 +0100 Message-ID: Subject: Re: [PATCH] i386: Fix mmx.md signbit expanders [PR112816] To: Jakub Jelinek Cc: gcc-patches@gcc.gnu.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=0.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,KAM_SHORT,MEDICAL_SUBJECT,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Tue, Dec 19, 2023 at 10:00=E2=80=AFAM Jakub Jelinek w= rote: > > Hi! > > Apparently when looking for "signbit2" vector expanders, I've only > looked at sse.md and forgot mmx.md, which has two further ones and the > following patch still ICEd. > > Fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux, > ok for trunk? > > 2023-12-19 Jakub Jelinek > > PR target/112816 > * config/i386/mmx.md (signbitv2sf2, signbit2): Force operan= ds[1] > into a REG. > > * gcc.target/i386/sse2-pr112816-2.c: New test. OK. Thanks, Uros. > > --- gcc/config/i386/mmx.md.jj 2023-12-11 08:31:58.825941145 +0100 > +++ gcc/config/i386/mmx.md 2023-12-18 20:55:53.899326034 +0100 > @@ -1339,7 +1339,10 @@ (define_expand "signbitv2sf2" > (match_operand:V2SF 1 "register_operand") 0) > (match_dup 2)))] > "TARGET_MMX_WITH_SSE" > - "operands[2] =3D GEN_INT (GET_MODE_UNIT_BITSIZE (V2SFmode)-1);") > +{ > + operands[1] =3D force_reg (V2SFmode, operands[1]); > + operands[2] =3D GEN_INT (GET_MODE_UNIT_BITSIZE (V2SFmode)-1); > +}) > > ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; > ;; > @@ -2482,7 +2485,10 @@ (define_expand "signbit2" > (match_operand:VHF_32_64 1 "register_operand") 0) > (match_dup 2)))] > "TARGET_SSE2" > - "operands[2] =3D GEN_INT (GET_MODE_UNIT_BITSIZE (mode)-1);") > +{ > + operands[1] =3D force_reg (mode, operands[1]); > + operands[2] =3D GEN_INT (GET_MODE_UNIT_BITSIZE (mode)-1); > +}) > > ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; > ;; > --- gcc/testsuite/gcc.target/i386/sse2-pr112816-2.c.jj 2023-12-18 20:57:= 16.313175688 +0100 > +++ gcc/testsuite/gcc.target/i386/sse2-pr112816-2.c 2023-12-18 20:52:= 22.006283681 +0100 > @@ -0,0 +1,16 @@ > +/* PR target/112816 */ > +/* { dg-do compile } */ > +/* { dg-options "-O2 -msse2" } */ > + > +#define N 2 > +struct S { float x[N]; }; > +struct T { int x[N]; }; > + > +struct T > +foo (struct S x) > +{ > + struct T res; > + for (int i =3D 0; i < N; ++i) > + res.x[i] =3D __builtin_signbit (x.x[i]) ? -1 : 0; > + return res; > +} > > Jakub >