Hi,

    I'm writing to ask that someone with write access to the git repo apply 
this patch, which provides the macro definition 
`_MM_FROUND_TO_NEAREST_TIES_EVEN`.

    Intrinsics such as `_mm512_add_round_ps` take a rounding mode argument to 
specify the floating point rounding mode. This and similar instructions do NOT 
round their result to an integer. Thus it is inappropriate for user code to 
specify the existing `_MM_FROUND_TO_NEAREST_INT` when desiring to round to the 
nearest floating point number. This patch adds a suitable macro definition.

    Note that some few instructions, e.g., `ROUNDPS`, do round to an integer, 
so the existing macro definition ought not be deprecated.

    Note that IEEE Std 754-2019 for floating-point arithmetic specifies two 
rounding direction attributes to nearest: `roundTiesToEven` and 
`roundTiesToAway`. Also, it specifies three directed rounding attributes: 
`roundTowardPositive`, `roundTowardNegative`, and `roundTowardZero`.

    Please note that I do not have write access to the git repo and that I am 
not a member of this email alias.  Your adding p...@hpkfft.com 
<mailto:p...@hpkfft.com> to any discussions would be appreciated.

Regards,
Paul

From d35d67cb9d333f2d99b4ee18ec2156ad1b973487 Mon Sep 17 00:00:00 2001
From: Paul Caprioli <p...@hpkfft.com>
Date: Sat, 20 Jul 2024 11:31:06 -0700
Subject: [PATCH] Add _MM_FROUND_TO_NEAREST_TIES_EVEN to smmintrin.h

---
 gcc/config/i386/smmintrin.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gcc/config/i386/smmintrin.h b/gcc/config/i386/smmintrin.h
index 4c315feec36..22ef9e966a7 100644
--- a/gcc/config/i386/smmintrin.h
+++ b/gcc/config/i386/smmintrin.h
@@ -39,6 +39,7 @@
 
 /* Rounding mode macros. */
 #define _MM_FROUND_TO_NEAREST_INT	0x00
+#define _MM_FROUND_TO_NEAREST_TIES_EVEN	0x00
 #define _MM_FROUND_TO_NEG_INF		0x01
 #define _MM_FROUND_TO_POS_INF		0x02
 #define _MM_FROUND_TO_ZERO		0x03
-- 
2.39.2

Reply via email to