From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id CED76383A31E for ; Mon, 25 Jul 2022 13:15:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org CED76383A31E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.cz Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id D383734BCC; Mon, 25 Jul 2022 13:15:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1658754918; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: resent-to:resent-cc:resent-from:resent-message-id: in-reply-to:in-reply-to:references:references; bh=nhYC0Sd6QtcEHM1ZmqS2jxljvp6Irp/iwNdn/hhYjMs=; b=HygXkEJxSEXHVQHxyilLACBNeXrhVmsZf8XtwsOWECzRAe1Xc/iu/Z57QIs5lMLtSihg54 PlW11KxRDg3oknyVZmKn7Wthe7+o85blDz/3sHEgza2apArDJ0zraYBzXJtdS5pMVJeA3B 2MEe46zzmj07fY99FZ7Jvi+QdXDDk+Q= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1658754918; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: resent-to:resent-cc:resent-from:resent-message-id: in-reply-to:in-reply-to:references:references; bh=nhYC0Sd6QtcEHM1ZmqS2jxljvp6Irp/iwNdn/hhYjMs=; b=jWv/eJJrO71vxVERdM4nXdKhG7O1cTnN+aX/0JxA4EzvH+slMF8Zd7Kjjt3Ax+N5B5UsVg 0ZXlT4tO9EIdW3CA== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id B5F1913AD7; Mon, 25 Jul 2022 13:15:18 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id NnxpK2aX3mIMdgAAMHmgww (envelope-from ); Mon, 25 Jul 2022 13:15:18 +0000 Resent-From: =?UTF-8?Q?Martin_Li=c5=a1ka?= Resent-To: GCC Patches Resent-Cc: David Malcolm Resent-Date: Mon, 25 Jul 2022 15:15:18 +0200 Resent-Message-ID: <1a0bf230-3575-1428-1e9c-1c961fdce437@suse.cz> Message-Id: In-Reply-To: References: From: Martin Liska Date: Mon, 25 Jul 2022 12:35:26 +0200 Subject: [PATCH 5/7] jit,docs: use list-table instead of fixed table To: gcc-patches@gcc.gnu.org X-Spam-Status: No, score=-11.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_ASCII_DIVIDERS, 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 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: Mon, 25 Jul 2022 13:15:22 -0000 Use rather list-table that is easible to maintainer and one does not have to wrap lines. Moreover, it provides great attribute :widths: that correctly works (tested for HTML and PDF). gcc/jit/ChangeLog: * docs/cp/intro/tutorial04.rst: Use list-table. * docs/intro/tutorial04.rst: Likewise. * docs/intro/tutorial05.rst: Likewise. * docs/topics/compilation.rst: Likewise. * docs/topics/expressions.rst: Likewise. * docs/topics/types.rst: Likewise. --- gcc/jit/docs/cp/intro/tutorial04.rst | 73 ++++++++++++------ gcc/jit/docs/intro/tutorial04.rst | 73 ++++++++++++------ gcc/jit/docs/intro/tutorial05.rst | 37 +++++---- gcc/jit/docs/topics/compilation.rst | 22 ++++-- gcc/jit/docs/topics/expressions.rst | 97 ++++++++++++++--------- gcc/jit/docs/topics/types.rst | 111 +++++++++++++++++---------- 6 files changed, 270 insertions(+), 143 deletions(-) diff --git a/gcc/jit/docs/cp/intro/tutorial04.rst b/gcc/jit/docs/cp/intro/tutorial04.rst index 45198ce3d7a..66dcce903c6 100644 --- a/gcc/jit/docs/cp/intro/tutorial04.rst +++ b/gcc/jit/docs/cp/intro/tutorial04.rst @@ -50,30 +50,55 @@ Naturally, a real interpreter would be much more complicated that this. The following operations are supported: -====================== ======================== =============== ============== -Operation Meaning Old Stack New Stack -====================== ======================== =============== ============== -DUP Duplicate top of stack. ``[..., x]`` ``[..., x, x]`` -ROT Swap top two elements ``[..., x, y]`` ``[..., y, x]`` - of stack. -BINARY_ADD Add the top two elements ``[..., x, y]`` ``[..., (x+y)]`` - on the stack. -BINARY_SUBTRACT Likewise, but subtract. ``[..., x, y]`` ``[..., (x-y)]`` -BINARY_MULT Likewise, but multiply. ``[..., x, y]`` ``[..., (x*y)]`` -BINARY_COMPARE_LT Compare the top two ``[..., x, y]`` ``[..., (x`` ``idx += 1`` -``<`` ``idx -= 1`` -``+`` ``data[idx] += 1`` -``-`` ``data[idx] -= 1`` -``.`` ``output (data[idx])`` -``,`` ``data[idx] = input ()`` -``[`` loop until ``data[idx] == 0`` -``]`` end of loop -Anything else ignored -====================== ============================= +.. list-table:: + :header-rows: 1 + + * - Character + - Meaning + + * - ``>`` + - ``idx += 1`` + * - ``<`` + - ``idx -= 1`` + * - ``+`` + - ``data[idx] += 1`` + * - ``-`` + - ``data[idx] -= 1`` + * - ``.`` + - ``output (data[idx])`` + * - ``,`` + - ``data[idx] = input ()`` + * - ``[`` + - loop until ``data[idx] == 0`` + * - ``]`` + - end of loop + * - Anything else + - ignored Unlike the previous example, we'll implement an ahead-of-time compiler, which reads ``.bf`` scripts and outputs executables (though it would diff --git a/gcc/jit/docs/topics/compilation.rst b/gcc/jit/docs/topics/compilation.rst index 91b9c2533cf..adcde8d8eb9 100644 --- a/gcc/jit/docs/topics/compilation.rst +++ b/gcc/jit/docs/topics/compilation.rst @@ -169,14 +169,20 @@ For linking in object files, use :c:func:`gcc_jit_context_add_driver_option`. The available kinds of output are: -============================================== ============== -Output kind Typical suffix -============================================== ============== -:c:macro:`GCC_JIT_OUTPUT_KIND_ASSEMBLER` .s -:c:macro:`GCC_JIT_OUTPUT_KIND_OBJECT_FILE` .o -:c:macro:`GCC_JIT_OUTPUT_KIND_DYNAMIC_LIBRARY` .so or .dll -:c:macro:`GCC_JIT_OUTPUT_KIND_EXECUTABLE` None, or .exe -============================================== ============== +.. list-table:: + :header-rows: 1 + + * - Output kind + - Typical suffix + + * - :c:macro:`GCC_JIT_OUTPUT_KIND_ASSEMBLER` + - .s + * - :c:macro:`GCC_JIT_OUTPUT_KIND_OBJECT_FILE` + - .o + * - :c:macro:`GCC_JIT_OUTPUT_KIND_DYNAMIC_LIBRARY` + - .so or .dll + * - :c:macro:`GCC_JIT_OUTPUT_KIND_EXECUTABLE` + - None, or .exe .. c:macro:: GCC_JIT_OUTPUT_KIND_ASSEMBLER diff --git a/gcc/jit/docs/topics/expressions.rst b/gcc/jit/docs/topics/expressions.rst index 00e2ec8cfeb..ff1eec800ce 100644 --- a/gcc/jit/docs/topics/expressions.rst +++ b/gcc/jit/docs/topics/expressions.rst @@ -313,14 +313,20 @@ Unary Operations The available unary operations are: -========================================== ============ -Unary Operation C equivalent -========================================== ============ -:c:macro:`GCC_JIT_UNARY_OP_MINUS` `-(EXPR)` -:c:macro:`GCC_JIT_UNARY_OP_BITWISE_NEGATE` `~(EXPR)` -:c:macro:`GCC_JIT_UNARY_OP_LOGICAL_NEGATE` `!(EXPR)` -:c:macro:`GCC_JIT_UNARY_OP_ABS` `abs (EXPR)` -========================================== ============ +.. list-table:: + :header-rows: 1 + + * - Unary Operation + - C equivalent + + * - :c:macro:`GCC_JIT_UNARY_OP_MINUS` + - `-(EXPR)` + * - :c:macro:`GCC_JIT_UNARY_OP_BITWISE_NEGATE` + - `~(EXPR)` + * - :c:macro:`GCC_JIT_UNARY_OP_LOGICAL_NEGATE` + - `!(EXPR)` + * - :c:macro:`GCC_JIT_UNARY_OP_ABS` + - `abs (EXPR)` .. c:macro:: GCC_JIT_UNARY_OP_MINUS @@ -380,22 +386,36 @@ Binary Operations The available binary operations are: -======================================== ============ -Binary Operation C equivalent -======================================== ============ -:c:macro:`GCC_JIT_BINARY_OP_PLUS` `x + y` -:c:macro:`GCC_JIT_BINARY_OP_MINUS` `x - y` -:c:macro:`GCC_JIT_BINARY_OP_MULT` `x * y` -:c:macro:`GCC_JIT_BINARY_OP_DIVIDE` `x / y` -:c:macro:`GCC_JIT_BINARY_OP_MODULO` `x % y` -:c:macro:`GCC_JIT_BINARY_OP_BITWISE_AND` `x & y` -:c:macro:`GCC_JIT_BINARY_OP_BITWISE_XOR` `x ^ y` -:c:macro:`GCC_JIT_BINARY_OP_BITWISE_OR` `x | y` -:c:macro:`GCC_JIT_BINARY_OP_LOGICAL_AND` `x && y` -:c:macro:`GCC_JIT_BINARY_OP_LOGICAL_OR` `x || y` -:c:macro:`GCC_JIT_BINARY_OP_LSHIFT` `x << y` -:c:macro:`GCC_JIT_BINARY_OP_RSHIFT` `x >> y` -======================================== ============ +.. list-table:: + :header-rows: 1 + + * - Binary Operation + - C equivalent + + * - :c:macro:`GCC_JIT_BINARY_OP_PLUS` + - `x + y` + * - :c:macro:`GCC_JIT_BINARY_OP_MINUS` + - `x - y` + * - :c:macro:`GCC_JIT_BINARY_OP_MULT` + - `x * y` + * - :c:macro:`GCC_JIT_BINARY_OP_DIVIDE` + - `x / y` + * - :c:macro:`GCC_JIT_BINARY_OP_MODULO` + - `x % y` + * - :c:macro:`GCC_JIT_BINARY_OP_BITWISE_AND` + - `x & y` + * - :c:macro:`GCC_JIT_BINARY_OP_BITWISE_XOR` + - `x ^ y` + * - :c:macro:`GCC_JIT_BINARY_OP_BITWISE_OR` + - `x | y` + * - :c:macro:`GCC_JIT_BINARY_OP_LOGICAL_AND` + - `x && y` + * - :c:macro:`GCC_JIT_BINARY_OP_LOGICAL_OR` + - `x || y` + * - :c:macro:`GCC_JIT_BINARY_OP_LSHIFT` + - `x << y` + * - :c:macro:`GCC_JIT_BINARY_OP_RSHIFT` + - `x >> y` .. c:macro:: GCC_JIT_BINARY_OP_PLUS @@ -536,17 +556,24 @@ Comparisons .. enum:: gcc_jit_comparison -======================================= ============ -Comparison C equivalent -======================================= ============ -:c:macro:`GCC_JIT_COMPARISON_EQ` `x == y` -:c:macro:`GCC_JIT_COMPARISON_NE` `x != y` -:c:macro:`GCC_JIT_COMPARISON_LT` `x < y` -:c:macro:`GCC_JIT_COMPARISON_LE` `x <= y` -:c:macro:`GCC_JIT_COMPARISON_GT` `x > y` -:c:macro:`GCC_JIT_COMPARISON_GE` `x >= y` -======================================= ============ - +.. list-table:: + :header-rows: 1 + + * - Comparison + - C equivalent + + * - :c:macro:`GCC_JIT_COMPARISON_EQ` + - `x == y` + * - :c:macro:`GCC_JIT_COMPARISON_NE` + - `x != y` + * - :c:macro:`GCC_JIT_COMPARISON_LT` + - `x < y` + * - :c:macro:`GCC_JIT_COMPARISON_LE` + - `x <= y` + * - :c:macro:`GCC_JIT_COMPARISON_GT` + - `x > y` + * - :c:macro:`GCC_JIT_COMPARISON_GE` + - `x >= y` Function calls ************** diff --git a/gcc/jit/docs/topics/types.rst b/gcc/jit/docs/topics/types.rst index db7fac6b267..457b3623ec9 100644 --- a/gcc/jit/docs/topics/types.rst +++ b/gcc/jit/docs/topics/types.rst @@ -57,45 +57,78 @@ Standard types Access a specific type. The available types are: - ========================================== ================================ - `enum gcc_jit_types` value Meaning - ========================================== ================================ - :c:data:`GCC_JIT_TYPE_VOID` C's ``void`` type. - :c:data:`GCC_JIT_TYPE_VOID_PTR` C's ``void *``. - :c:data:`GCC_JIT_TYPE_BOOL` C++'s ``bool`` type; also C99's - ``_Bool`` type, aka ``bool`` if - using stdbool.h. - :c:data:`GCC_JIT_TYPE_CHAR` C's ``char`` (of some signedness) - :c:data:`GCC_JIT_TYPE_SIGNED_CHAR` C's ``signed char`` - :c:data:`GCC_JIT_TYPE_UNSIGNED_CHAR` C's ``unsigned char`` - :c:data:`GCC_JIT_TYPE_SHORT` C's ``short`` (signed) - :c:data:`GCC_JIT_TYPE_UNSIGNED_SHORT` C's ``unsigned short`` - :c:data:`GCC_JIT_TYPE_INT` C's ``int`` (signed) - :c:data:`GCC_JIT_TYPE_UNSIGNED_INT` C's ``unsigned int`` - :c:data:`GCC_JIT_TYPE_LONG` C's ``long`` (signed) - :c:data:`GCC_JIT_TYPE_UNSIGNED_LONG` C's ``unsigned long`` - :c:data:`GCC_JIT_TYPE_LONG_LONG` C99's ``long long`` (signed) - :c:data:`GCC_JIT_TYPE_UNSIGNED_LONG_LONG` C99's ``unsigned long long`` - :c:data:`GCC_JIT_TYPE_UINT8_T` C99's ``uint8_t`` - :c:data:`GCC_JIT_TYPE_UINT16_T` C99's ``uint16_t`` - :c:data:`GCC_JIT_TYPE_UINT32_T` C99's ``uint32_t`` - :c:data:`GCC_JIT_TYPE_UINT64_T` C99's ``uint64_t`` - :c:data:`GCC_JIT_TYPE_UINT128_T` C99's ``__uint128_t`` - :c:data:`GCC_JIT_TYPE_INT8_T` C99's ``int8_t`` - :c:data:`GCC_JIT_TYPE_INT16_T` C99's ``int16_t`` - :c:data:`GCC_JIT_TYPE_INT32_T` C99's ``int32_t`` - :c:data:`GCC_JIT_TYPE_INT64_T` C99's ``int64_t`` - :c:data:`GCC_JIT_TYPE_INT128_T` C99's ``__int128_t`` - :c:data:`GCC_JIT_TYPE_FLOAT` - :c:data:`GCC_JIT_TYPE_DOUBLE` - :c:data:`GCC_JIT_TYPE_LONG_DOUBLE` - :c:data:`GCC_JIT_TYPE_CONST_CHAR_PTR` C type: ``(const char *)`` - :c:data:`GCC_JIT_TYPE_SIZE_T` C's ``size_t`` type - :c:data:`GCC_JIT_TYPE_FILE_PTR` C type: ``(FILE *)`` - :c:data:`GCC_JIT_TYPE_COMPLEX_FLOAT` C99's ``_Complex float`` - :c:data:`GCC_JIT_TYPE_COMPLEX_DOUBLE` C99's ``_Complex double`` - :c:data:`GCC_JIT_TYPE_COMPLEX_LONG_DOUBLE` C99's ``_Complex long double`` - ========================================== ================================ + .. list-table:: + :header-rows: 1 + + * - `enum gcc_jit_types` value + - Meaning + + * - :c:data:`GCC_JIT_TYPE_VOID` + - C's ``void`` type. + * - :c:data:`GCC_JIT_TYPE_VOID_PTR` + - C's ``void *``. + * - :c:data:`GCC_JIT_TYPE_BOOL` + - C++'s ``bool`` type; also C99's ``_Bool`` type, aka ``bool`` if using stdbool.h. + * - :c:data:`GCC_JIT_TYPE_CHAR` + - C's ``char`` (of some signedness) + * - :c:data:`GCC_JIT_TYPE_SIGNED_CHAR` + - C's ``signed char`` + * - :c:data:`GCC_JIT_TYPE_UNSIGNED_CHAR` + - C's ``unsigned char`` + * - :c:data:`GCC_JIT_TYPE_SHORT` + - C's ``short`` (signed) + * - :c:data:`GCC_JIT_TYPE_UNSIGNED_SHORT` + - C's ``unsigned short`` + * - :c:data:`GCC_JIT_TYPE_INT` + - C's ``int`` (signed) + * - :c:data:`GCC_JIT_TYPE_UNSIGNED_INT` + - C's ``unsigned int`` + * - :c:data:`GCC_JIT_TYPE_LONG` + - C's ``long`` (signed) + * - :c:data:`GCC_JIT_TYPE_UNSIGNED_LONG` + - C's ``unsigned long`` + * - :c:data:`GCC_JIT_TYPE_LONG_LONG` + - C99's ``long long`` (signed) + * - :c:data:`GCC_JIT_TYPE_UNSIGNED_LONG_LONG` + - C99's ``unsigned long long`` + * - :c:data:`GCC_JIT_TYPE_UINT8_T` + - C99's ``uint8_t`` + * - :c:data:`GCC_JIT_TYPE_UINT16_T` + - C99's ``uint16_t`` + * - :c:data:`GCC_JIT_TYPE_UINT32_T` + - C99's ``uint32_t`` + * - :c:data:`GCC_JIT_TYPE_UINT64_T` + - C99's ``uint64_t`` + * - :c:data:`GCC_JIT_TYPE_UINT128_T` + - C99's ``__uint128_t`` + * - :c:data:`GCC_JIT_TYPE_INT8_T` + - C99's ``int8_t`` + * - :c:data:`GCC_JIT_TYPE_INT16_T` + - C99's ``int16_t`` + * - :c:data:`GCC_JIT_TYPE_INT32_T` + - C99's ``int32_t`` + * - :c:data:`GCC_JIT_TYPE_INT64_T` + - C99's ``int64_t`` + * - :c:data:`GCC_JIT_TYPE_INT128_T` + - C99's ``__int128_t`` + * - :c:data:`GCC_JIT_TYPE_FLOAT` + - + * - :c:data:`GCC_JIT_TYPE_DOUBLE` + - + * - :c:data:`GCC_JIT_TYPE_LONG_DOUBLE` + - + * - :c:data:`GCC_JIT_TYPE_CONST_CHAR_PTR` + - C type: ``(const char *)`` + * - :c:data:`GCC_JIT_TYPE_SIZE_T` + - C's ``size_t`` type + * - :c:data:`GCC_JIT_TYPE_FILE_PTR` + - C type: ``(FILE *)`` + * - :c:data:`GCC_JIT_TYPE_COMPLEX_FLOAT` + - C99's ``_Complex float`` + * - :c:data:`GCC_JIT_TYPE_COMPLEX_DOUBLE` + - C99's ``_Complex double`` + * - :c:data:`GCC_JIT_TYPE_COMPLEX_LONG_DOUBLE` + - C99's ``_Complex long double`` .. function:: gcc_jit_type *\ gcc_jit_context_get_int_type (gcc_jit_context *ctxt, \ -- 2.37.1