aboutsummaryrefslogtreecommitdiff
path: root/include/intops.s
diff options
context:
space:
mode:
Diffstat (limited to 'include/intops.s')
-rw-r--r--include/intops.s25
1 files changed, 25 insertions, 0 deletions
diff --git a/include/intops.s b/include/intops.s
new file mode 100644
index 0000000..dbadb37
--- /dev/null
+++ b/include/intops.s
@@ -0,0 +1,25 @@
+
+.ifndef _intops_s_file
+_intops_s_file:
+
+.include "include/primops.s"
+
+.primop2 plus
+ mov 010(%rsi), %rax # arg 2
+ mov 020(%rbp), %rsi # location of arg1
+ add 010(%rsi), %rax # arg 1
+ primop2_ret_int %rax
+
+.primop2 mul
+ mov 010(%rsi), %rax # arg 2
+ mov 020(%rbp), %rsi # location of arg1
+ mulq 010(%rsi) # arg 1 (goes to %rax and %rdx)
+ primop2_ret_int %rax
+
+.primop2 sub
+ mov 020(%rbp), %rdi # location of arg1
+ mov 010(%rdx), %rax # arg 1
+ sub 010(%rsi), %rax # arg 2
+ primop2_ret_int %rax
+
+.endif # _intops_s_file