add WIP lrsc mdwn for stbcx
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sun, 3 Dec 2023 18:42:57 +0000 (18:42 +0000)
committerJacob Lifshay <programmerjake@gmail.com>
Mon, 4 Dec 2023 06:32:30 +0000 (22:32 -0800)
openpower/isa/lrsc.txt [new file with mode: 0644]

diff --git a/openpower/isa/lrsc.txt b/openpower/isa/lrsc.txt
new file mode 100644 (file)
index 0000000..b3fdea9
--- /dev/null
@@ -0,0 +1,29 @@
+EA <- (RA|0) + (RB)
+undefined_case <- 0
+store_performed <- 0
+if RESERVE then
+  if RESERVE_LENGTH = 1 &
+      RESERVE_ADDR = real_addr(EA) then
+       MEM(EA, 1) <- (RS)56:63
+       undefined_case <- 0
+       store_performed <- 1
+   else
+       z <- 4096 # smallest implementation's real page size 
+       if RESERVE_ADDR / z = real_addr(EA) / z then
+          undefined_case <- 1
+       else
+         undefined_case <- 0
+         store_performed <- 0
+else
+  undefined_case <- 0
+  store_performed <- 0
+if undefined_case then
+  u1 <- undefined(0b1)
+  if u1 then
+     MEM(EA, 1) <- (RS)56:63
+  u2 <- undefined(0b0)
+  CR0 <- 0b00 || u2 || XERSO
+else
+  CR0 <- 0b00 || store_performed || XER[SO]
+RESERVE  0
+