summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkx <kx@radix-linux.su>2026-09-02 23:12:09 +0300
committerkx <kx@radix-linux.su>2026-09-02 23:12:09 +0300
commit277724a781aa587e03c288d667581668db6cdd3a (patch)
treea2fc4d90267e19ecba6a1c3c92644ca8dc89850b
parent7cb2774c5fb9f4c6803a33d6d8e35958c67dde68 (diff)
downloadlibmpu-277724a781aa587e03c288d667581668db6cdd3a.tar.xz
Thread Safe real arithmetic operations
-rw-r--r--mpu/mpu-real.c20
-rw-r--r--mpu/mpu-real.h2
2 files changed, 11 insertions, 11 deletions
diff --git a/mpu/mpu-real.c b/mpu/mpu-real.c
index c52a339..3a0cb0a 100644
--- a/mpu/mpu-real.c
+++ b/mpu/mpu-real.c
@@ -7696,17 +7696,17 @@ int ei_mulm( EMUSHORT *prodi, EMUSHORT *numi, EMUSHORT *muli, int nb )
= == = = =
регистр управления параметрами ОКРУГЛЕНИЯ.
***************************************************************/
-int rndprc = NSBITS_DEFAULT;
+__thread int rndprc = NSBITS_DEFAULT;
-static int nsbits = NSBITS_DEFAULT; /* текущее NSBITS(nb) */
-static int nslast = -1; /* предыдущее NSBITS(nb) */
+static __thread int nsbits = NSBITS_DEFAULT; /* текущее NSBITS(nb) */
+static __thread int nslast = -1; /* предыдущее NSBITS(nb) */
-static int rlast = -1;
-static int rw = 0; /* rounding word */
-static EMUSHORT rm_mask = 0;
-static EMUSHORT rm_bit = 0;
-static EMUSHORT re_bit = 0;
-static int re = 0;
+static __thread int rlast = -1;
+static __thread int rw = 0; /* rounding word */
+static __thread EMUSHORT rm_mask = 0;
+static __thread EMUSHORT rm_bit = 0;
+static __thread EMUSHORT re_bit = 0;
+static __thread int re = 0;
void ei_mdenorm( EMUSHORT *si, int lost, int subflag, EMUSHORT *exp, int rcontrol, int nb )
@@ -10081,7 +10081,7 @@ void ei_convert( EMUSHORT *eia, EMUSHORT *eib, int nba, int nbb )
-static int subflag = 0;
+static __thread int subflag = 0;
static void ei_add1( EMUSHORT *eic, EMUSHORT *eia, EMUSHORT *eib, int nb )
/***************************************************************
diff --git a/mpu/mpu-real.h b/mpu/mpu-real.h
index 5983c46..feaf0e9 100644
--- a/mpu/mpu-real.h
+++ b/mpu/mpu-real.h
@@ -282,7 +282,7 @@ extern int ei_mulm ( EMUSHORT *prodi, EMUSHORT *numi, EMUSHORT *muli, in
регистр управления параметрами ОКРУГЛЕНИЯ.
***************************************************************/
#define NSBITS_DEFAULT 96 /* = NSBITS( NBR_128 ); */
-extern int rndprc;
+extern __thread int rndprc;
extern void ei_mdenorm ( EMUSHORT *si, int lost, int subflag, EMUSHORT *exp, int rcontrol, int nb );