Skip to content

Commit b8ab9f3

Browse files
authored
Revert "add fenv cache to task struct (#51288)" (#56982)
This reverts commit 12aa9de. un-fixes #51277 Alternatively, we could add a flag for whether the state is non-default so we know whether `fesetenv` is necessary, if this behavior is considered desireable.
1 parent 3c7bc45 commit b8ab9f3

File tree

2 files changed

+0
-8
lines changed

2 files changed

+0
-8
lines changed

src/julia.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
#include "libsupport.h"
2121
#include <stdint.h>
2222
#include <string.h>
23-
#include <fenv.h>
2423

2524
#include "htable.h"
2625
#include "arraylist.h"
@@ -2314,9 +2313,6 @@ typedef struct _jl_task_t {
23142313
_Atomic(uint64_t) finished_at;
23152314

23162315
// hidden state:
2317-
// cached floating point environment
2318-
// only updated at task switch
2319-
fenv_t fenv;
23202316

23212317
// id of owning thread - does not need to be defined until the task runs
23222318
_Atomic(int16_t) tid;

src/task.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,6 @@ JL_NO_ASAN static void ctx_switch(jl_task_t *lastt)
541541
jl_set_pgcstack(&t->gcstack);
542542
jl_signal_fence();
543543
lastt->ptls = NULL;
544-
fegetenv(&lastt->fenv);
545544
#ifdef MIGRATE_TASKS
546545
ptls->previous_task = lastt;
547546
#endif
@@ -734,7 +733,6 @@ JL_DLLEXPORT void jl_switch(void) JL_NOTSAFEPOINT_LEAVE JL_NOTSAFEPOINT_ENTER
734733
0 == ptls->finalizers_inhibited);
735734
ptls->finalizers_inhibited = finalizers_inhibited;
736735
jl_timing_block_task_enter(ct, ptls, blk); (void)blk;
737-
fesetenv(&ct->fenv);
738736

739737
sig_atomic_t other_defer_signal = ptls->defer_signal;
740738
ptls->defer_signal = defer_signal;
@@ -1147,7 +1145,6 @@ JL_DLLEXPORT jl_task_t *jl_new_task(jl_function_t *start, jl_value_t *completion
11471145
t->excstack = NULL;
11481146
t->ctx.started = 0;
11491147
t->priority = 0;
1150-
fegetenv(&t->fenv);
11511148
jl_atomic_store_relaxed(&t->tid, -1);
11521149
t->threadpoolid = ct->threadpoolid;
11531150
t->ptls = NULL;
@@ -1254,7 +1251,6 @@ CFI_NORETURN
12541251
if (!pt->sticky && !pt->ctx.copy_stack)
12551252
jl_atomic_store_release(&pt->tid, -1);
12561253
#endif
1257-
fesetenv(&ct->fenv);
12581254

12591255
ct->ctx.started = 1;
12601256
if (ct->metrics_enabled) {

0 commit comments

Comments
 (0)