From 8ac162d44a8a28c8d4d776ccccd4be2d46749854 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20M=C3=BCllner?= Date: Tue, 25 Jun 2024 17:17:45 +0200 Subject: [PATCH] riscv-cc: Reference FP standards for FP types MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As reported in #430, we define the sizes and alignments of all floating-point types, but we don't reference the underlying standards. This change fills this gap. Fixes: #430. Signed-off-by: Christoph Müllner --- riscv-cc.adoc | 74 +++++++++++++++++++++++++-------------------------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/riscv-cc.adoc b/riscv-cc.adoc index 16c6967..f6ab188 100644 --- a/riscv-cc.adoc +++ b/riscv-cc.adoc @@ -536,53 +536,53 @@ ILP32, ILP32F, ILP32D, and ILP32E:: Use the following type sizes and alignments (based on the ILP32 convention): + .C/{Cpp} type sizes and alignments for RV32 -[cols="4,>2,>3"] +[cols="4,>2,>3,4"] [width=60%] |=== -| Type | Size (Bytes) | Alignment (Bytes) - -| bool/_Bool | 1 | 1 -| char | 1 | 1 -| short | 2 | 2 -| int | 4 | 4 -| long | 4 | 4 -| long long | 8 | 8 -| void * | 4 | 4 -| +++__bf16+++ | 2 | 2 -| _Float16 | 2 | 2 -| float | 4 | 4 -| double | 8 | 8 -| long double | 16 | 16 -| float _Complex | 8 | 4 -| double _Complex | 16 | 8 -| long double _Complex | 32 | 16 +| Type | Size (Bytes) | Alignment (Bytes) | Note + +| bool/_Bool | 1 | 1 | +| char | 1 | 1 | +| short | 2 | 2 | +| int | 4 | 4 | +| long | 4 | 4 | +| long long | 8 | 8 | +| void * | 4 | 4 | +| +++__bf16+++ | 2 | 2 | Half precision floating point (bfloat16) +| _Float16 | 2 | 2 | Half precision floating point (binary16 in IEEE 754-2008) +| float | 4 | 4 | Single precision floating point (binary32 in IEEE 754-2008) +| double | 8 | 8 | Double precision floating point (binary64 in IEEE 754-2008) +| long double | 16 | 16 | Quadruple precision floating point (binary128 in IEEE 754-2008) +| float _Complex | 8 | 4 | +| double _Complex | 16 | 8 | +| long double _Complex | 32 | 16 | |=== LP64, LP64F, LP64D, and LP64Q:: Use the following type sizes and alignments (based on the LP64 convention): + .C/{Cpp} type sizes and alignments for RV64 -[cols="4,>2,>3"] +[cols="4,>2,>3,4"] [width=60%] |=== -| Type | Size (Bytes) | Alignment (Bytes) - -| bool/_Bool | 1 | 1 -| char | 1 | 1 -| short | 2 | 2 -| int | 4 | 4 -| long | 8 | 8 -| long long | 8 | 8 -| +++__int128+++ | 16 | 16 -| void * | 8 | 8 -| +++__bf16+++ | 2 | 2 -| _Float16 | 2 | 2 -| float | 4 | 4 -| double | 8 | 8 -| long double | 16 | 16 -| float _Complex | 8 | 4 -| double _Complex | 16 | 8 -| long double _Complex | 32 | 16 +| Type | Size (Bytes) | Alignment (Bytes) | Note + +| bool/_Bool | 1 | 1 | +| char | 1 | 1 | +| short | 2 | 2 | +| int | 4 | 4 | +| long | 8 | 8 | +| long long | 8 | 8 | +| +++__int128+++ | 16 | 16 | +| void * | 8 | 8 | +| +++__bf16+++ | 2 | 2 | Half precision floating point (bfloat16) +| _Float16 | 2 | 2 | Half precision floating point (binary16 in IEEE 754-2008) +| float | 4 | 4 | Single precision floating point (binary32 in IEEE 754-2008) +| double | 8 | 8 | Double precision floating point (binary64 in IEEE 754-2008) +| long double | 16 | 16 | Quadruple precision floating point (binary128 in IEEE 754-2008) +| float _Complex | 8 | 4 | +| double _Complex | 16 | 8 | +| long double _Complex | 32 | 16 | |=== The alignment of `max_align_t` is 16.