From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x102a.google.com (mail-pj1-x102a.google.com [IPv6:2607:f8b0:4864:20::102a]) by sourceware.org (Postfix) with ESMTPS id 503203858D1E for ; Mon, 6 May 2024 13:58:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 503203858D1E Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=sifive.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=sifive.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 503203858D1E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::102a ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1715003911; cv=none; b=tZbwYutXRIwpV18fA2lXyD4CWZiMHQU6GeLMwRZnh+YWMohwAYlFZ3Vp/w+4w1CKu2UMUYIY/RnySiLk/H1SI66poh+QFG2Saw6fkrxAC9kHmaP+tilvFfOU2g3P5no7TsH12qs4L4/2n0iCvhs6Sr2WgbvjENZIsPYz3XzcSds= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1715003911; c=relaxed/simple; bh=rnI/QsUXjejEiwV6xcEpKSqab2fluIQIw/8i+MP4WFo=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=K4EWdFiZBTyUflTLtcTnsZ83l3tUgA9gIs1MNukulAwxE04iUX1sKIJe9ZyOElKJ1TnSe6wrtHYyJG8Kvt6Tm/we8Qb24+YnO76qzbjPbBcFNXPxOJ2+8NrWSmQoX77CxfRYsKyuG/4P2wd0GNqsrkL7445KTeAGMwfATQgxPLQ= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pj1-x102a.google.com with SMTP id 98e67ed59e1d1-2a78c2e253aso1372516a91.3 for ; Mon, 06 May 2024 06:58:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; t=1715003909; x=1715608709; darn=sourceware.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=vv7Bs93hX1BL6xi1xAnGEY9MHNGnkuofIjGpPOfmuS4=; b=TVzF2eHAT9/MuLIGxoUZNLTAjUSPMMkJtZR5vsf7fe33nWoolcnXYyZaRyR8o1Q5TQ 1cyYl8NU/2/IxdgA5xuuUBQyiHeVbAH7XINAfoRRs33bpl5STN/WTy4mWm/k9Yba/7WK neKhhI5tRXhbKoEOfjjRQXXWTnegk4h/xJFTfSsXKNclHdlPFhC8nWqQYtS1uKhUUfcf JMfbQEw0U7aeV6Sz8YTPc4a25sYSxO+FWuKl3eIG5902tYMN0xsjlxjZRY/Rk1DJ8FpP 9IdGBqWzMHvKH5Y+yCzgB12wE3MHPE+rrgTNnlJRpGyf2bYsBI7FZ8sg0BshTYK8zv8B GJSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715003909; x=1715608709; h=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=vv7Bs93hX1BL6xi1xAnGEY9MHNGnkuofIjGpPOfmuS4=; b=d1EuqELHXd1EXiM2R9OryJNIgRhhizMHYKnzjAqWm61DEvCsAwJjoQxi5F9NMnDIxi Pp+MS3cQvhgxth6gsq6hRMISGGZjL6cZYmLhtAe3EdrSv66EVoC2WFIIzMcGExaWMwd+ YqPn9Ddt/UJZkytEzhy5p2fJ4EBrNN8FPA0iYsl3Go5xcIAqe9VIwtUX7UYH9LEi/UM9 2n9miUOiOEBbpwiUup3ZBONucFrZpQXliqX9+9aIlj/K13bUVvNse5w1IuZG317jjtPz ndsMNYPb9S+sYl0v7qwG/iwEElsjgtpkfKbPUveeEFJVRDg+CWTWx/8viXFLuj+Am/jn QuhA== X-Forwarded-Encrypted: i=1; AJvYcCW5WDLfHp4/PDIRxUHeJa9UMCZQmpN3QcXSWo+rwMLpYbPdPIGRSP01hLhnvGzgQwfnVbvFbIhNcn6SmCugTTqBBcNY8tVPxdTK X-Gm-Message-State: AOJu0YxYcE4VK5YIgdEUrxL+iIsKl2WDBM3MWkmzOrJbnF+Nvi2yW8m0 6x8oEWrIjriUNoHeR2D3b63HNddcoilqrzb7ACeCmXOvYHlfi6Nsen674z/a8sLYxrRCrlAqrgU HVN5c2GYyB47xcWd1RlDdIiEYbFy237TxsvF9aQ== X-Google-Smtp-Source: AGHT+IGE2abNrDqkB6/EQ2ixHeLOyW7CO8srFXJLv4hDRlR1fXUhF3MzL4P06t67w4rB/MfoJiEAAHXVpTs0wTLZtTk= X-Received: by 2002:a17:90a:4891:b0:2b1:b6f:e297 with SMTP id b17-20020a17090a489100b002b10b6fe297mr8380365pjh.36.1715003909160; Mon, 06 May 2024 06:58:29 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Kito Cheng Date: Mon, 6 May 2024 21:58:17 +0800 Message-ID: Subject: Re: [PATCH 2/7] RISC-V: Add Zbb optimized memchr as ifunc To: =?UTF-8?Q?Christoph_M=C3=BCllner?= Cc: Palmer Dabbelt , adhemerval.zanella@linaro.org, libc-alpha@sourceware.org, Darius Rad , Andrew Waterman , philipp.tomsich@vrull.eu, Evan Green , DJ Delorie , Vineet Gupta , jeffreyalaw@gmail.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP 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: > > `target` attribute is provided by GCC 14, and `-march=+ext` will at > > least require GCC 15 (if we add), > > also we relaxed the canonical order requirement for `-march=`, that > > means we can relatively easy to manipulate the ISA > > string by just concat that? so I don't really think we need `-march=+ext`. > > Then we require the Makefile author to: > 1) parse if the current compiler flags include march (repeat for all > variables that may be used) > 2a) if so, then amend to that > 2b) if not, parse if there is a configured default ISA (via "gcc -v") > 2ba) if so, then create -march accordingly > 2bb) if not, then > > Bonus problem: > If there are multiple variables that might set -march=... this gets > even trickier because > the order how these variables are integrated in the compiler > invocation command is unknown. > > Using "-march=+zfoo" seems simpler and cleaner. I agree it will require the compiler to parse the gcc -v to obtain the default -march, it might be a burden, but AArch64 also does not allow -march=+ext only it requires -march=arch{+[no]feature}*, so I am wondering why do we need that to resolve/improve ifunc implementation but not `target` attribute and `.option arch, +ext`?