[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 05/09: aarch64: Fix swap_atomic retry
From: |
Andy Wingo |
Subject: |
[Guile-commits] 05/09: aarch64: Fix swap_atomic retry |
Date: |
Mon, 22 Apr 2024 09:21:40 -0400 (EDT) |
wingo pushed a commit to branch main
in repository guile.
commit 2c0126e3ef23ed7962d8fe36b0249fb4256e8d0b
Author: Tony Garnock-Jones <tonyg@leastfixedpoint.com>
AuthorDate: Mon Apr 22 13:24:17 2024 +0200
aarch64: Fix swap_atomic retry
* lightening/aarch64-cpu.c (swap_atomic): If the swap fails, and the dst
register was the same as the val, we would stomple val during the retry.
Fixes https://github.com/wingo/fibers/issues/83#issuecomment-2068847127.
---
lightening/aarch64-cpu.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lightening/aarch64-cpu.c b/lightening/aarch64-cpu.c
index 13aa351e9..2eaf74406 100644
--- a/lightening/aarch64-cpu.c
+++ b/lightening/aarch64-cpu.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2013-2017, 2019 Free Software Foundation, Inc.
+ * Copyright (C) 2013-2017, 2019, 2024 Free Software Foundation, Inc.
*
* This file is part of GNU lightning.
*
@@ -2532,10 +2532,10 @@ str_atomic(jit_state_t *_jit, int32_t loc, int32_t val)
static void
swap_atomic(jit_state_t *_jit, int32_t dst, int32_t loc, int32_t val)
{
- void *retry = jit_address(_jit);
int32_t result = jit_gpr_regno(get_temp_gpr(_jit));
int32_t val_or_tmp = dst == val ? jit_gpr_regno(get_temp_gpr(_jit)) : val;
movr(_jit, val_or_tmp, val);
+ void *retry = jit_address(_jit);
LDAXR(_jit, dst, loc);
STLXR(_jit, val_or_tmp, loc, result);
jit_patch_there(_jit, bnei(_jit, result, 0), retry);
- [Guile-commits] branch main updated (112b617f5 -> e2fad2025), Andy Wingo, 2024/04/22
- [Guile-commits] 03/09: Merge branch 'topic/fix-reset-literal-pool' into 'main', Andy Wingo, 2024/04/22
- [Guile-commits] 01/09: replace use of uninitialized variable size in reset_literal_pool, Andy Wingo, 2024/04/22
- [Guile-commits] 08/09: Fix compilation when SCM_I_PTHREAD_ONCE_INIT is not aggregate, Andy Wingo, 2024/04/22
- [Guile-commits] 05/09: aarch64: Fix swap_atomic retry,
Andy Wingo <=
- [Guile-commits] 09/09: Merge Lightening update branch, Andy Wingo, 2024/04/22
- [Guile-commits] 06/09: aarch64: Add support for LSE atomics, Andy Wingo, 2024/04/22
- [Guile-commits] 04/09: Fix CI, Andy Wingo, 2024/04/22
- [Guile-commits] 02/09: set size to known value before init, Andy Wingo, 2024/04/22
- [Guile-commits] 07/09: Merge remote-tracking branch 'lightening/main', Andy Wingo, 2024/04/22