summaryrefslogtreecommitdiff
path: root/ia64.S
diff options
context:
space:
mode:
authorsamuel <samuel@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-11-24 11:35:29 +0000
committersamuel <samuel@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-11-24 11:35:29 +0000
commite64f71f812324d098bed12ed68c2bc1d6e780c90 (patch)
treeb47548dacef6f68c8f85fbfcd87cc984430243d3 /ia64.S
parent091422388e943de1e67ace6faac3d71ed08c14d2 (diff)
Change Makefile rule for assembly to use .S rather than .s
It is more conventional to use compiler to pre-process and assemble the `.S` file rather than forcing Makefile to use `.s`. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65952 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ia64.S')
-rw-r--r--ia64.S42
1 files changed, 42 insertions, 0 deletions
diff --git a/ia64.S b/ia64.S
new file mode 100644
index 0000000000..1087105585
--- /dev/null
+++ b/ia64.S
@@ -0,0 +1,42 @@
+// rb_ia64_flushrs and rb_ia64_bsp is written in IA64 assembly language
+// because Intel Compiler for IA64 doesn't support inline assembly.
+//
+// This file is based on following C program compiled by gcc.
+//
+// void rb_ia64_flushrs(void) { __builtin_ia64_flushrs(); }
+// void *rb_ia64_bsp(void) { return __builtin_ia64_bsp(); }
+//
+// Note that rb_ia64_flushrs and rb_ia64_bsp works in its own stack frame.
+// It's because BSP is updated by br.call/brl.call (not alloc instruction).
+// So rb_ia64_flushrs flushes stack frames including caller's one.
+// rb_ia64_bsp returns the address next to caller's register stack frame.
+//
+// See also
+// Intel Itanium Architecture Software Developer's Manual
+// Volume 2: System Architecture.
+//
+ .file "ia64.c"
+ .text
+ .align 16
+ .global rb_ia64_flushrs#
+ .proc rb_ia64_flushrs#
+rb_ia64_flushrs:
+ .prologue
+ .body
+ flushrs
+ ;;
+ nop.i 0
+ br.ret.sptk.many b0
+ .endp rb_ia64_flushrs#
+ .align 16
+ .global rb_ia64_bsp#
+ .proc rb_ia64_bsp#
+rb_ia64_bsp:
+ .prologue
+ .body
+ nop.m 0
+ ;;
+ mov r8 = ar.bsp
+ br.ret.sptk.many b0
+ .endp rb_ia64_bsp#
+ .ident "GCC: (GNU) 3.3.5 (Debian 1:3.3.5-13)"