From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com [IPv6:2a00:1450:4864:20::12f]) by sourceware.org (Postfix) with ESMTPS id 2C4B53858C33 for ; Mon, 27 May 2024 11:19:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2C4B53858C33 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=vrull.eu Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=vrull.eu ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 2C4B53858C33 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::12f ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1716808766; cv=none; b=t2OxiKoXWANK6oSx1O+eOjyciE+FhHExzVc901q1kLT/fKGTQbe0JEUOeE2P/sAFED7kOPuq1I/yuvHsATidezOinq9VaQdQiA6d/petLypwo+35yGTl0YQhyrXZy/FStwtIm0VhR7c9cPh61S+e3/ej6DVQnFveKjqgAbpMAHA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1716808766; c=relaxed/simple; bh=TZ0iKjR1+7J+uXkN92wievmaSNxW9Qhx0GUcK7olV88=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=Q1JmKrHqqBcDIdTlm6IyTlVktiTXBl+CeTJ6AfAWNhT4LsAkw/mq78hVrPjz9EGSzknFEJGtyBZ9l7AKB5G2BZyc5HLWh/Td7o75j5KTaH82YC5AGjn7M1OZiBgl92D0tlJ9NduKz70LKzr/mDy7TsmpZ4CCg+Mw5bAazaX/hrQ= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-lf1-x12f.google.com with SMTP id 2adb3069b0e04-5238b5c07efso10646451e87.3 for ; Mon, 27 May 2024 04:19:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vrull.eu; s=google; t=1716808762; x=1717413562; darn=sourceware.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=CQOAgolGAU+5nf6pEbcDaqXBaYckR/gEOsP4SkgrlBQ=; b=aVboslurnn6TfHJ5WILTFtgBQ0QZUSSPJHfiqA9SDaa0OObheoPyqBl37F65mDtQJy p0/KIYKdnGukbJBJXRm0NjcablI/6d+AORbIEYmCY/6i9nl0uYTR2cEwGACiGcpAKB2C Nf99jcgbuqiEKUIp/fDC/NwTZCnMeahWdzXrknyePqGELdQQayGLhjVI18p6C7mT4iEx TNQWz5Bjlt4zc3FR8ip2UBUaTExXftLGEsBFZzc7Ez0O3n3WwXhn/1GAkZ4MNCvKig9O YhFKqjvuZSWeZ+M/dWTLfbkWYstg0cle3w2f8qrbNvGnMBlF/it63Rijzpf2duMPuH/r j/2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716808762; x=1717413562; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=CQOAgolGAU+5nf6pEbcDaqXBaYckR/gEOsP4SkgrlBQ=; b=D6+jAbegkg+tD4kmmVjjc6X4Sij1/hbrTAvSdnTMCA6FWkTQimZHffWnOMMxNMsTix vll4MwAZOMnENM3xChNhGVvlg6zL0Dp9LgyjP0ND3vK/4Fe9w+AMe+6WaiedEW7Kr2XB r27ysbqhdCihlMXqv26miFub5B64rs0gqTBQp66Ekqh8B08btCrqpLLZeouL4pcZc6ay m2UgzoSS9o4vwXGuEBpXq1v5HrPfA2TLKOeyDmy9xu2kMy6hbW19T9xfaehKwtf5b6VE nbM1L+HziokuzsTRVb5d+yiAdE8+UE2In/YN5dM5BJrMnjw7+uy8X5wF4ENSwjlf786n 8lSQ== X-Gm-Message-State: AOJu0YxoKT89wEz4n1e9RuREM0r+t/9GNt18b2fP1sFjxE9CASkO41SF VodlO/og49hUxlXxZXuUmkh9S5aBGnfDruAMfm6rqdkRpGzeDKkoBrx6YVGFTa6s+ODsux17ZGb pcZr44w== X-Google-Smtp-Source: AGHT+IHQTA3XHWEYfD0ij4xSrO3iwBsHB0U7ETbYiRgAwDYo5yOwk9tBqyfacVuW1OfSMo/Jk58QsQ== X-Received: by 2002:ac2:5edb:0:b0:51b:58c7:d04d with SMTP id 2adb3069b0e04-529613c3539mr6097617e87.0.1716808762223; Mon, 27 May 2024 04:19:22 -0700 (PDT) Received: from beast.fritz.box (static.239.130.217.95.clients.your-server.de. [95.217.130.239]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-5296e887b1asm519861e87.32.2024.05.27.04.19.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 04:19:21 -0700 (PDT) From: =?UTF-8?q?Christoph=20M=C3=BCllner?= To: libc-alpha@sourceware.org, Adhemerval Zanella , Palmer Dabbelt , Darius Rad , Andrew Waterman , Philipp Tomsich , Evan Green , DJ Delorie , Vineet Gupta , Kito Cheng , Jeff Law Cc: =?UTF-8?q?Christoph=20M=C3=BCllner?= Subject: [PATCH v2 07/15] string/strncmp: Add mechanism to set function attributes Date: Mon, 27 May 2024 13:18:52 +0200 Message-ID: <20240527111900.1060546-8-christoph.muellner@vrull.eu> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240527111900.1060546-1-christoph.muellner@vrull.eu> References: <20240527111900.1060546-1-christoph.muellner@vrull.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,KAM_MANYTO,RCVD_IN_DNSWL_NONE,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 List-Id: This patch introduces the __CODEGEN_ATTRIBUTES macro which can be used to set function attributes when building the code. Signed-off-by: Christoph Müllner --- string/strncmp.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/string/strncmp.c b/string/strncmp.c index 67cc97542a..13c656dc2e 100644 --- a/string/strncmp.c +++ b/string/strncmp.c @@ -29,6 +29,11 @@ #define STRNCMP strncmp #endif +#ifndef __CODEGEN_ATTRIBUTES +# define __CODEGEN_ATTRIBUTES +#endif + +__CODEGEN_ATTRIBUTES static inline int final_cmp (const op_t w1, const op_t w2, size_t n) { @@ -40,6 +45,7 @@ final_cmp (const op_t w1, const op_t w2, size_t n) /* Aligned loop: if a difference is found, exit to compare the bytes. Else if a zero is found we have equal strings. */ +__CODEGEN_ATTRIBUTES static inline int strncmp_aligned_loop (const op_t *x1, const op_t *x2, op_t w1, size_t n) { @@ -64,6 +70,7 @@ strncmp_aligned_loop (const op_t *x1, const op_t *x2, op_t w1, size_t n) the bytes so that we can also apply the has_zero test to see if we have already reached EOS. If we have, then we can simply fall through to the final comparison. */ +__CODEGEN_ATTRIBUTES static inline int strncmp_unaligned_loop (const op_t *x1, const op_t *x2, op_t w1, uintptr_t ofs, size_t n) @@ -110,6 +117,7 @@ strncmp_unaligned_loop (const op_t *x1, const op_t *x2, op_t w1, uintptr_t ofs, returning less than, equal to or greater than zero if S1 is lexicographically less than, equal to or greater than S2. */ +__CODEGEN_ATTRIBUTES int STRNCMP (const char *p1, const char *p2, size_t n) { -- 2.45.1