From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ot1-x330.google.com (mail-ot1-x330.google.com [IPv6:2607:f8b0:4864:20::330]) by sourceware.org (Postfix) with ESMTPS id 98047388E83F for ; Wed, 21 Apr 2021 13:48:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 98047388E83F Received: by mail-ot1-x330.google.com with SMTP id k14-20020a9d7dce0000b02901b866632f29so38987241otn.1 for ; Wed, 21 Apr 2021 06:48:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=lKOX9RK1mTb6K1LpqH9rOg6/o5GNpr2xzYyO2Vux7JY=; b=VbvEI4qXHAcT0OotB3f9dg6X/KT5TGOzNEbtHf4GavIJKULCu99kdtVZVrcFexuD6t xCt5McrpZe2GhsmyfxjOQA44FVI1bfPe8kxl6jYK6i8TziK1SI+aU2ZobIn78dQVQO3D FZ1yP6kB7iIr/Wmn2U6Kxi2mhxoH+IVCk/yC86oVF2kXKHzTLRR+DqBrJaKcHnqRHS+8 T7pd0DrTpI40uTGGcEfmlO5M/hItNzhh3hfRcD7FJIJxJMxdw1uplxeThCt1/O1TcgJr 9WZ7xJ+DTl2Xyo9l0KSc6/Dq5Qy/gbz7MiMt6JxKCKlYOaBss/fKpymeXQWDL770j1n/ 53Cw== X-Gm-Message-State: AOAM533wj8nUCoCQg4IJRQPnSxs6j/EYEw5wuI1vcRg4dXK271OxauY7 3yaXktmAPZAqCd+uJGn6H2hXs4cT/BHEAbCTX2U= X-Google-Smtp-Source: ABdhPJxKXcmgxLsZ3fZLvEaC6DJnW3lmdOb8Ku5aBmrfyZuDTZlJ4BwI6PGqcA48k4bjLxoBDWBilSSvf+Y9cm/4yy4= X-Received: by 2002:a05:6830:90c:: with SMTP id v12mr23143400ott.179.1619012913024; Wed, 21 Apr 2021 06:48:33 -0700 (PDT) MIME-Version: 1.0 References: <20210414223918.230495-1-hjl.tools@gmail.com> <20210414223918.230495-3-hjl.tools@gmail.com> In-Reply-To: From: "H.J. Lu" Date: Wed, 21 Apr 2021 06:47:57 -0700 Message-ID: Subject: Re: [PATCH v4 2/2] x86: Add general_regs_only function attribute To: Uros Bizjak Cc: "gcc-patches@gcc.gnu.org" , Jakub Jelinek , Bernhard Reutner-Fischer , Martin Sebor , Richard Biener Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-3028.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Apr 2021 13:48:36 -0000 On Wed, Apr 21, 2021 at 12:30 AM Uros Bizjak wrote: > > On Thu, Apr 15, 2021 at 12:39 AM H.J. Lu wrote: > > > > commit 87c753ac241f25d222d46ba1ac66ceba89d6a200 > > Author: H.J. Lu > > Date: Fri Aug 21 09:42:49 2020 -0700 > > > > x86: Add target("general-regs-only") function attribute > > > > is incomplete since it is impossible to call integer intrinsics from > > a function with general-regs-only target attribute. > > > > 1. Add general_regs_only function attribute to inform the compiler that > > functions use only general purpose registers. When making inlining > > decisions on such functions, non-GPR compiler options are excluded. > > 2. Add general_regs_only attribute to x86 intrinsics which use only > > general purpose registers. > > I'd like to ask Richard and Jakub if they agree with the approach. Here is the v5 patch: https://gcc.gnu.org/pipermail/gcc-patches/2021-April/568407.html Richard, Jakub, do they look good to you? > On a related note, can we declare default attributes like clang does, e.g.: > > /* Define the default attributes for the functions. */ > #define __DEFAULT_FN_ATTRS __attribute__((__gnu_inline__, > __always_inline__, __artificial__)) This can be defined in x86intrin.h. > #define __DEFAULT_FN_ATTRS_GRO __attribute__((__gnu_inline__, > __always_inline__, __general_regs_only, __artificial__)) This can be defined in x86gprintrin.h. > and use these defines throughout header files? > > Uros. > Thanks. -- H.J.