summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorMikael Eiman <mikael@eiman.tv>2014-01-04 20:15:04 +0100
committerMikael Eiman <mikael@eiman.tv>2014-01-04 20:15:04 +0100
commit5d02e2d6fa3afcd8aa9ecb475b0c4599da6ca03d (patch)
tree9ab510905823de42c2a23bc667037c68cc427046
parente9906ac3d771a312b05d76e42aee8e806dd0d128 (diff)
downloadmicropython-5d02e2d6fa3afcd8aa9ecb475b0c4599da6ca03d.tar.gz
micropython-5d02e2d6fa3afcd8aa9ecb475b0c4599da6ca03d.zip
OSX: fixes to make nlrx64.S with Apple's clang
-rw-r--r--py/nlrx64.S23
1 files changed, 21 insertions, 2 deletions
diff --git a/py/nlrx64.S b/py/nlrx64.S
index 6d0e2118f7..37d3137785 100644
--- a/py/nlrx64.S
+++ b/py/nlrx64.S
@@ -5,9 +5,14 @@
.text
/* uint nlr_push(rdi=nlr_buf_t *nlr) */
+#ifndef __llvm__
.globl nlr_push
.type nlr_push, @function
nlr_push:
+#else
+ .globl _nlr_push
+_nlr_push:
+#endif
movq (%rsp), %rax # load return %rip
movq %rax, 16(%rdi) # store %rip into nlr_buf
movq %rbp, 24(%rdi) # store %rbp into nlr_buf
@@ -22,22 +27,32 @@ nlr_push:
movq %rdi, nlr_top(%rip) # stor new nlr_buf (to make linked list)
xorq %rax, %rax # return 0, normal return
ret # return
- .size nlr_push, .-nlr_push
+// .size nlr_push, .-nlr_push
/* void nlr_pop() */
+#ifndef __llvm__
.globl nlr_pop
.type nlr_pop, @function
nlr_pop:
+#else
+ .globl _nlr_pop
+_nlr_pop:
+#endif
movq nlr_top(%rip), %rax # get nlr_top into %rax
movq (%rax), %rax # load prev nlr_buf
movq %rax, nlr_top(%rip) # store prev nlr_buf (to unlink list)
ret # return
- .size nlr_pop, .-nlr_pop
+// .size nlr_pop, .-nlr_pop
/* void nlr_jump(rdi=uint val) */
+#ifndef __llvm__
.globl nlr_jump
.type nlr_jump, @function
nlr_jump:
+#else
+ .globl _nlr_jump
+ _nlr_jump:
+#endif
movq %rdi, %rax # put return value in %rax
movq nlr_top(%rip), %rdi # get nlr_top into %rdi
movq %rax, 8(%rdi) # store return value
@@ -55,8 +70,12 @@ nlr_jump:
xorq %rax, %rax # clear return register
inc %al # increase to make 1, non-local return
ret # return
+#ifndef __llvm__
.size nlr_jump, .-nlr_jump
+#endif
+#ifndef __llvm__
.local nlr_top
+#endif
.comm nlr_top,8,8
#endif