From patchwork Tue Feb 20 12:52:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Georg-Johann Lay X-Patchwork-Id: 86031 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5A21F3858C42 for ; Tue, 20 Feb 2024 12:52:31 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mo4-p00-ob.smtp.rzone.de (mo4-p00-ob.smtp.rzone.de [81.169.146.161]) by sourceware.org (Postfix) with ESMTPS id 8B40E3858D28 for ; Tue, 20 Feb 2024 12:52:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8B40E3858D28 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=gjlay.de Authentication-Results: sourceware.org; spf=none smtp.mailfrom=gjlay.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 8B40E3858D28 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=81.169.146.161 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1708433526; cv=pass; b=lBxPId9MurhhhQD+XNrJldmpvCUH+ggp8WRJkjgwqA7N935H+G6+0qhDvBnnSvI8iNNE5pK4ezqn7uEalldDklx27x3s45ivKXeyiMSDS1MgbeBvmkAKYIsWyI0tFwtsEs4GGG2puBapfwpb2fWADKR2sgzuTK4dYKXYPn3Mjac= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1708433526; c=relaxed/simple; bh=yDxmCiBd++mAK2cBDGoU6Me1Knp0Ot9CKahMzwJh/bM=; h=DKIM-Signature:DKIM-Signature:Message-ID:Date:MIME-Version:From: To:Subject; b=l+hSDxj3c52aQYq3icgOOyieqwvA7HHaihb3Ha8BL6FjY64vG9en8b/rYoOli3KNzSv6WaTY/nazjnFmpXpLUnufwRJaR+0Takh7lQi+YlkHoPGHTPlbI8XjG1WszOM+CBiuY1dQZtW9BxX+27bssOMSwlNdXE3QMwAXBvcwVA0= ARC-Authentication-Results: i=2; server2.sourceware.org ARC-Seal: i=1; a=rsa-sha256; t=1708433522; cv=none; d=strato.com; s=strato-dkim-0002; b=abG2vTXumAZlDw5xvukqzgP02yvPuBK7Bbty4HtQDKfyA/d66LNyrZqOdNBMn+SQ11 M+OxfrHDiCaSIEeIvR25KG28/nt3IsFySoUKf0gTcPITYHbTlkSEvnm6VORrO5r2fUcS hIFsPzzPntbsMFaMuRjXINVBrt95zXelXHZbya5e1LGIn4s++G41Uo8TbqfilxW5QiXL Kk6filhAfw+7G97bTGB6TCyFtfBtwOHelqVDdj99E6jIN5GMIdrSwjr0Ol72oPlx82+2 sGTfZGxJ/sFOBvpFXWaZZqG2/cmfTGpilgSEtWj93njSHb88r6jNohPkODMXrlYNKZdJ EM9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1708433522; s=strato-dkim-0002; d=strato.com; h=Subject:To:From:Date:Message-ID:Cc:Date:From:Subject:Sender; bh=RALU281L1GTcHHt34jrxdokjd/E8mmRUaXvD6j6x0yw=; b=j/0X2qmxajOv/RGCYQX5DQoXtAsems0yT9e87X9ycAPnJO7FZ1Kyi/Qcws6s/KJtDi HfMWxxteB8o0if4E+s8xp5iQbC7MPoPWERiVE6I9tyE2jTnRfp6nKXcqkbMWbor4Jnow cKrl10o8h2rZ2rZQdvI/X/1q9B0OIhL68Kt/WVBwd3EvUJSwDooV1dPyeQyOyG5xNUuL 8V6q6k3oDNzaerL2WCr2LTZ7e/+JH1rkrOlDoSmMx6yZHzwSWXiGx2mcKRchYvyvhNYS bFbiL+bQ1lBK8kSgWmWL2RJXZbyHsBaaKPilwHUuZgx3sHJBR1h3FwufgSToYr1jNkLt 3G8A== ARC-Authentication-Results: i=1; strato.com; arc=none; dkim=none X-RZG-CLASS-ID: mo00 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1708433522; s=strato-dkim-0002; d=gjlay.de; h=Subject:To:From:Date:Message-ID:Cc:Date:From:Subject:Sender; bh=RALU281L1GTcHHt34jrxdokjd/E8mmRUaXvD6j6x0yw=; b=n7zeRbrSpDStTbILivNu/OkmLBm1n9fof+PYxgapstWpjEIl5Hf5NIZOQbjvk6ihEn NVjYbLQ0kbDxfP0TBq+B1UmO5rSdBmXp2se7EnbGeE+mzRVe/d+gVsuZn9EqknkVWJ5E 7lCfROgfvbkjsQt/stzDXyhJH5OxhJtcLRgv8hWxYNw1EDGL7SQICP/+SwyS9yuyhO8k gqaDaoLPbBv0WLjM3WVzwELv2blw2RHw1SPT5D7wEkQUwrlF+xq5fxCT/blfwzvzOEUI UlBwNDEigO177cI3fiyXthULToEWb+So8+q/AK2jHw1ObXQFliUEeUpKQS/vr0RUX4Wv 0EVw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; t=1708433522; s=strato-dkim-0003; d=gjlay.de; h=Subject:To:From:Date:Message-ID:Cc:Date:From:Subject:Sender; bh=RALU281L1GTcHHt34jrxdokjd/E8mmRUaXvD6j6x0yw=; b=DsXVkoyZD87LXEkb7rztDg1mS76G7vWkSN+QQmWDc7nnO3xcgM0BL5LIHiKXzmHp96 M/G0zwrbDpyJDnE9NnDA== X-RZG-AUTH: ":LXoWVUeid/7A29J/hMvvT3koxZnKT7Qq0xotTetVnKkSgcSjpmy9KwoMJ/K0VA==" Received: from [192.168.2.102] by smtp.strato.de (RZmta 49.11.2 DYNA|AUTH) with ESMTPSA id Lb68c601KCq1dzd (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate) for ; Tue, 20 Feb 2024 13:52:01 +0100 (CET) Message-ID: <27362617-eb61-4bd7-99d6-896c5ac5eecb@gjlay.de> Date: Tue, 20 Feb 2024 13:52:01 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US From: Georg-Johann Lay To: gcc-patches@gcc.gnu.org Subject: [patch,avr,applied] Use @defbuiltin to document built-ins. X-Spam-Status: No, score=-11.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_NONE, 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 X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org This patch uses @defbuiltin to document built-in functions so that the functions are listed in the index. Previously, @table @code was used. Johann --- AVR: extend.texi - Use @defbuiltin to document built-ins. gcc/ * doc/extend.texi (AVR Built-in Functions): Use @defbuiltin instead of @table. diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi index e048404dffe..b2383b55666 100644 --- a/gcc/doc/extend.texi +++ b/gcc/doc/extend.texi @@ -16782,37 +16782,41 @@ or if not a specific built-in is implemented or not. For example, if @code{__builtin_avr_nop} is available the macro @code{__BUILTIN_AVR_NOP} is defined to @code{1} and undefined otherwise. -@table @code +@defbuiltin{void __builtin_avr_nop (void)} +@defbuiltinx{void __builtin_avr_nop (void)} +@defbuiltinx{void __builtin_avr_sei (void)} +@defbuiltinx{void __builtin_avr_cli (void)} +@defbuiltinx{void __builtin_avr_sleep (void)} +@defbuiltinx{void __builtin_avr_wdr (void)} +@defbuiltinx{{unsigned char} __builtin_avr_swap (unsigned char)} +@defbuiltinx{{unsigned int} __builtin_avr_fmul (unsigned char, unsigned char)} +@defbuiltinx{int __builtin_avr_fmuls (char, char)} +@defbuiltinx{int __builtin_avr_fmulsu (char, unsigned char)} -@item void __builtin_avr_nop (void) -@itemx void __builtin_avr_sei (void) -@itemx void __builtin_avr_cli (void) -@itemx void __builtin_avr_sleep (void) -@itemx void __builtin_avr_wdr (void) -@itemx unsigned char __builtin_avr_swap (unsigned char) -@itemx unsigned int __builtin_avr_fmul (unsigned char, unsigned char) -@itemx int __builtin_avr_fmuls (char, char) -@itemx int __builtin_avr_fmulsu (char, unsigned char) These built-in functions map to the respective machine instruction, i.e.@: @code{nop}, @code{sei}, @code{cli}, @code{sleep}, @code{wdr}, @code{swap}, @code{fmul}, @code{fmuls} resp. @code{fmulsu}. The three @code{fmul*} built-ins are implemented as library call if no hardware multiplier is available. -@item void __builtin_avr_delay_cycles (unsigned long ticks) +@enddefbuiltin + +@defbuiltin{void __builtin_avr_delay_cycles (unsigned long @var{ticks})} Delay execution for @var{ticks} cycles. Note that this built-in does not take into account the effect of interrupts that might increase delay time. @var{ticks} must be a compile-time integer constant; delays with a variable number of cycles are not supported. +@enddefbuiltin -@item char __builtin_avr_flash_segment (const __memx void*) +@defbuiltin{char __builtin_avr_flash_segment (const __memx void*)} This built-in takes a byte address to the 24-bit @ref{AVR Named Address Spaces,address space} @code{__memx} and returns the number of the flash segment (the 64 KiB chunk) where the address points to. Counting starts at @code{0}. If the address does not point to flash memory, return @code{-1}. +@enddefbuiltin -@item uint8_t __builtin_avr_insert_bits (uint32_t map, uint8_t bits, uint8_t val) +@defbuiltin{uint8_t __builtin_avr_insert_bits (uint32_t @var{map}, uint8_t @var{bits}, uint8_t @var{val})} Insert bits from @var{bits} into @var{val} and return the resulting value. The nibbles of @var{map} determine how the insertion is performed: Let @var{X} be the @var{n}-th nibble of @var{map} @@ -16856,12 +16860,12 @@ __builtin_avr_insert_bits (0xffff3210, bits, val); // reverse the bit order of bits __builtin_avr_insert_bits (0x01234567, bits, 0); @end smallexample +@enddefbuiltin -@item void __builtin_avr_nops (unsigned count) +@defbuiltin{void __builtin_avr_nops (unsigned @var{count})} Insert @var{count} @code{NOP} instructions. The number of instructions must be a compile-time integer constant. - -@end table +@enddefbuiltin @noindent There are many more AVR-specific built-in functions that are used to