summaryrefslogtreecommitdiffstats
path: root/meta-microblaze/recipes-devtools/gcc/gcc-12/0009-Patch-microblaze-Fix-atomic-boolean-return-value.patch
blob: c7efbb07f1f8e98071b4b0a768181365491163d7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
From a1b8136a157c549f0f65c14d628e694310ca0d23 Mon Sep 17 00:00:00 2001
From: Mahesh Bodapati <mbodapat@xilinx.com>
Date: Thu, 12 Jan 2017 16:45:45 +0530
Subject: [PATCH 09/53] [Patch, microblaze]: Fix atomic boolean return value.
 In atomic_compare_and_swapsi, fix boolean return value. Previously, it
 contained zero if successful and non-zero if unsuccessful.

Signed-off-by: Kirk Meyer <kirk.meyer@sencore.com>
Signed-off-by: David Holsgrove <david.holsgrove@xilinx.com>
---
 gcc/config/microblaze/sync.md | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/gcc/config/microblaze/sync.md b/gcc/config/microblaze/sync.md
index 77c3ce8ff27..573ce4765a0 100644
--- a/gcc/config/microblaze/sync.md
+++ b/gcc/config/microblaze/sync.md
@@ -34,15 +34,16 @@
    (clobber (match_scratch:SI 8 "=&d"))]
   ""
   {
-    output_asm_insn ("addc \tr0,r0,r0", operands);
+    output_asm_insn ("add  \t%0,r0,r0", operands);
     output_asm_insn ("lwx  \t%1,%y2,r0", operands);
     output_asm_insn ("addic\t%8,r0,0", operands);
     output_asm_insn ("bnei \t%8,.-8", operands);
-    output_asm_insn ("cmp  \t%0,%1,%3", operands);
-    output_asm_insn ("bnei \t%0,.+16", operands);
+    output_asm_insn ("cmp  \t%8,%1,%3", operands);
+    output_asm_insn ("bnei \t%8,.+20", operands);
     output_asm_insn ("swx  \t%4,%y2,r0", operands);
     output_asm_insn ("addic\t%8,r0,0", operands);
     output_asm_insn ("bnei \t%8,.-28", operands);
+    output_asm_insn ("addi \t%0,r0,1", operands);
     return "";
   }
 )
-- 
2.37.1 (Apple Git-137.1)