From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com [IPv6:2a00:1450:4864:20::530]) by sourceware.org (Postfix) with ESMTPS id 129F33858D35 for ; Sun, 7 Jan 2024 16:14:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 129F33858D35 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 129F33858D35 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::530 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1704644091; cv=none; b=O9ePu0doe9KC65pmvoPmbiaJAAIzmIVrGhlqSeEUj/iR40pFiUGilGyEqJUrErUrf2j5uYx1Yi+Xcn7NrbNi189gKDyFx+C7dal6rX4L8hh/5PDbbjhwRflSr6WP1FDrs5BLJkLtIU9c6jmqPhGIOE6iFEi5P1JUpvhxHRKlIPg= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1704644091; c=relaxed/simple; bh=UO5/kQHN3Yziy30szE5LarTNqphwvdmH94YRtzaxiwE=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=Z1wSSQTZp6QZtDKQCkmbzKCk2biygPJA03nnNrkL4e8WPapYRETHcjS3yHNw1/hDvKLSExajlaFmDvIx1HW1EtBqj2zQT08ySpQfOJZ/tTmYLOmUsqk7sdFPqSL2sPqHAZoaz4oVh0/thddU4FMJNM7bHSaaxd1YSvwXSxj9e94= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-ed1-x530.google.com with SMTP id 4fb4d7f45d1cf-5570bef7cb8so1104674a12.2 for ; Sun, 07 Jan 2024 08:14:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1704644089; x=1705248889; 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=0mMqwCU2M3o9laeuxkMU/Glu3K/rQIcgjIuQinSAeyY=; b=Ssv/5UBIf5Yl8yZqFL5c/zxoFPPE61G6tRwxKpu4b7kAeRrU65gJb+Xr01HDlyPltR Jiw02blRbJ2LIfMMV6joxDFE4TPi7shwLMbl2OCOspDJDCwkjJBbZ3bOrXGRG6E+0NEn 0BpmeL91eACP9c2MxIaCMn0vr+Fx/OATasuucZZdWrod0v1LEGNPDiQKosxk9kwdw+uW 7jFYlSxkMj56yRvnHfTRel/Qcx1gwnbqqz692PXcQo8e1WLBxgoddkisHbUpfXPSjXvV s2A7gPA9itw2PQetylmpJHme+A6RSDQY0fdKCU1pFEW7njX3clmEorfxWRc3FN/ppX+H VFUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704644089; x=1705248889; 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=0mMqwCU2M3o9laeuxkMU/Glu3K/rQIcgjIuQinSAeyY=; b=dk16G7dNTZjKy/1Ot5I6246/fvXoC/hPCD8DqSILXjcbdFrvcJGb5r7ys9OGVMDFTy J7Pp70EwG1djgEowrSv0QvGwBoptqc8mOFijyCsU2LWTqGXTjgf/D+4aT4W9B5662TIX UvsgqzGma28ibn66aE76z9aUXizS83CfFSRDJosJjCfFOVYjR7hOJ/xaF5PC2tOEJK4l hVrGER2nnxcC4120Pq7U8X7ysqTEpBAlp5YlYApjnNVq925vWiVr1L5D+KaiMXd1UuFi ivwLJep94ZaiTLIuExPTRXxlIzbVgRy4tXy0hNYV0WHTDEqPP1JRWAWAGm45/qvETpDj +Bcw== X-Gm-Message-State: AOJu0YyWF6naxm294FgyGrTk7Kf3vgv0EhmIZeaWRORjaboAYqYXHWdX HqzDdaJ8xBLLuhpHt5LN3yUaJKh9K9a56Ux2ICgpYf7WAYc= X-Google-Smtp-Source: AGHT+IFgcczvWNSnBy7mmXccsSj1cvOM0Oe/HY75G6ZygSIVx9VkonEEVpXuzTMQLmwKSEZ/RuhmbhBEjJtHH3iCMvk= X-Received: by 2002:aa7:da01:0:b0:556:71fa:35e9 with SMTP id r1-20020aa7da01000000b0055671fa35e9mr1403601eds.56.1704644088462; Sun, 07 Jan 2024 08:14:48 -0800 (PST) MIME-Version: 1.0 References: <03c401da40a4$8819fe30$984dfa90$@nextmovesoftware.com> In-Reply-To: <03c401da40a4$8819fe30$984dfa90$@nextmovesoftware.com> From: Uros Bizjak Date: Sun, 7 Jan 2024 17:14:37 +0100 Message-ID: Subject: Re: [x86 PATCH] PR target/113231: Improved costs in Scalar-To-Vector (STV) pass. To: Roger Sayle Cc: gcc-patches@gcc.gnu.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,KAM_SHORT,LIKELY_SPAM_BODY,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 Sat, Jan 6, 2024 at 2:30=E2=80=AFPM Roger Sayle wrote: > > > This patch improves the cost/gain calculation used during the i386 backen= d's > SImode/DImode scalar-to-vector (STV) conversion pass. The current code > handles loads and stores, but doesn't consider that converting other > scalar operations with a memory destination, requires an explicit load > before and an explicit store after the vector equivalent. > > To ease the review, the significant change looks like: > > /* For operations on memory operands, include the overhead > of explicit load and store instructions. */ > if (MEM_P (dst)) > igain +=3D !optimize_insn_for_size_p () > ? (m * (ix86_cost->int_load[2] > + ix86_cost->int_store[2]) > - (ix86_cost->sse_load[sse_cost_idx] + > ix86_cost->sse_store[sse_cost_idx])) > : -COSTS_N_BYTES (8); Please just swap true and false statements to avoid negative test. > however the patch itself is complicated by a change in indentation > which leads to a number of lines with only whitespace changes. 'git diff -w' to the rescue ;) > For architectures where integer load/store costs are the same as > vector load/store costs, there should be no change without -Os/-Oz. > > This patch has been tested on x86_64-pc-linux-gnu with make bootstrap > and make -k check, both with and without --target_board=3Dunix{-m32} > with no new failures. Ok for mainline? > > > 2024-01-06 Roger Sayle > > gcc/ChangeLog > PR target/113231 > * config/i386/i386-features.cc (compute_convert_gain): Include > the overhead of explicit load and store (movd) instructions when > converting non-store scalar operations with memory destinations. > > gcc/testsuite/ChangeLog > PR target/113231 > * gcc.target/i386/pr113231.c: New test case. OK with the above proposed change. Thanks, Uros.