Skip to content

Commit

Permalink
Revert "add fenv cache to task struct (#51288)" (#56982)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
JeffBezanson authored Jan 8, 2025
1 parent 3c7bc45 commit b8ab9f3
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 8 deletions.
4 changes: 0 additions & 4 deletions src/julia.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#include "libsupport.h"
#include <stdint.h>
#include <string.h>
#include <fenv.h>

#include "htable.h"
#include "arraylist.h"
Expand Down Expand Up @@ -2314,9 +2313,6 @@ typedef struct _jl_task_t {
_Atomic(uint64_t) finished_at;

// hidden state:
// cached floating point environment
// only updated at task switch
fenv_t fenv;

// id of owning thread - does not need to be defined until the task runs
_Atomic(int16_t) tid;
Expand Down
4 changes: 0 additions & 4 deletions src/task.c
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,6 @@ JL_NO_ASAN static void ctx_switch(jl_task_t *lastt)
jl_set_pgcstack(&t->gcstack);
jl_signal_fence();
lastt->ptls = NULL;
fegetenv(&lastt->fenv);
#ifdef MIGRATE_TASKS
ptls->previous_task = lastt;
#endif
Expand Down Expand Up @@ -734,7 +733,6 @@ JL_DLLEXPORT void jl_switch(void) JL_NOTSAFEPOINT_LEAVE JL_NOTSAFEPOINT_ENTER
0 == ptls->finalizers_inhibited);
ptls->finalizers_inhibited = finalizers_inhibited;
jl_timing_block_task_enter(ct, ptls, blk); (void)blk;
fesetenv(&ct->fenv);

sig_atomic_t other_defer_signal = ptls->defer_signal;
ptls->defer_signal = defer_signal;
Expand Down Expand Up @@ -1147,7 +1145,6 @@ JL_DLLEXPORT jl_task_t *jl_new_task(jl_function_t *start, jl_value_t *completion
t->excstack = NULL;
t->ctx.started = 0;
t->priority = 0;
fegetenv(&t->fenv);
jl_atomic_store_relaxed(&t->tid, -1);
t->threadpoolid = ct->threadpoolid;
t->ptls = NULL;
Expand Down Expand Up @@ -1254,7 +1251,6 @@ CFI_NORETURN
if (!pt->sticky && !pt->ctx.copy_stack)
jl_atomic_store_release(&pt->tid, -1);
#endif
fesetenv(&ct->fenv);

ct->ctx.started = 1;
if (ct->metrics_enabled) {
Expand Down

0 comments on commit b8ab9f3

Please sign in to comment.