aboutsummaryrefslogtreecommitdiffstats
path: root/runtime/kvx/vararg.s
diff options
context:
space:
mode:
authorDavid Monniaux <david.monniaux@univ-grenoble-alpes.fr>2020-05-26 22:04:20 +0200
committerDavid Monniaux <david.monniaux@univ-grenoble-alpes.fr>2020-05-26 22:04:20 +0200
commitb4a08d0815342b6238d307864f0823d0f07bb691 (patch)
tree85f48254ca79a6e2bc9d7359017a5731f98f897f /runtime/kvx/vararg.s
parent490a6caea1a95cfdbddf7aca244fa6a1c83aa9a2 (diff)
downloadcompcert-kvx-b4a08d0815342b6238d307864f0823d0f07bb691.tar.gz
compcert-kvx-b4a08d0815342b6238d307864f0823d0f07bb691.zip
k1c -> kvx changes
Diffstat (limited to 'runtime/kvx/vararg.s')
-rw-r--r--runtime/kvx/vararg.s54
1 files changed, 54 insertions, 0 deletions
diff --git a/runtime/kvx/vararg.s b/runtime/kvx/vararg.s
new file mode 100644
index 00000000..65c1eab8
--- /dev/null
+++ b/runtime/kvx/vararg.s
@@ -0,0 +1,54 @@
+
+# typedef void * va_list;
+# unsigned int __compcert_va_int32(va_list * ap);
+# unsigned long long __compcert_va_int64(va_list * ap);
+
+ .text
+ .balign 2
+ .globl __compcert_va_int32
+__compcert_va_int32:
+ ld $r32 = 0[$r0] # $r32 <- *ap
+;;
+ addd $r32 = $r32, 8 # $r32 <- $r32 + WORDSIZE
+;;
+ sd 0[$r0] = $r32 # *ap <- $r32
+;;
+ lws $r0 = -8[$r32] # retvalue <- 32-bits at *ap - WORDSIZE
+ ret
+;;
+
+ .text
+ .balign 2
+ .globl __compcert_va_int64
+ .globl __compcert_va_float64
+ .globl __compcert_va_composite
+__compcert_va_int64:
+__compcert_va_float64:
+# FIXME this assumes pass-by-reference
+__compcert_va_composite:
+# Prologue
+ ld $r32 = 0[$r0] # $r32 <- *ap
+;;
+ addd $r32 = $r32, 8 # $r32 <- $r32 + WORDSIZE
+;;
+ sd 0[$r0] = $r32 # *ap <- $r32
+;;
+ ld $r0 = -8[$r32] # retvalue <- 64-bits at *ap - WORDSIZE
+ ret
+;;
+
+# FIXME this assumes pass-by-reference
+ .globl __compcert_acswapd
+__compcert_acswapd:
+ acswapd 0[$r1] = $r2r3
+ ;;
+ sq 0[$r0] = $r2r3
+ ret
+ ;;
+ .globl __compcert_acswapw
+__compcert_acswapw:
+ acswapw 0[$r1] = $r2r3
+ ;;
+ sq 0[$r0] = $r2r3
+ ret
+ ;;