summaryrefslogtreecommitdiff
path: root/3/11_floating_point/53_funct1.c
diff options
context:
space:
mode:
Diffstat (limited to '3/11_floating_point/53_funct1.c')
-rw-r--r--3/11_floating_point/53_funct1.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/3/11_floating_point/53_funct1.c b/3/11_floating_point/53_funct1.c
new file mode 100644
index 0000000..8147b62
--- /dev/null
+++ b/3/11_floating_point/53_funct1.c
@@ -0,0 +1,29 @@
+typedef arg1_t int;
+typedef arg2_t double;
+typedef arg3_t double;
+
+typedef arg4_t double;
+double funct1(arg1_t p, arg2_t q, arg3_t r, double s)
+{
+ return p/(q+r) - s;
+}
+// funct 1:
+// vcvtsi2ssq %rsi, %xmm2, %xmm2 convert long to double?
+// vaddss %xmm0, %xmm2, %xmm0 xmm0 <- xmm2 + xmm0 (q+r)
+// vcvtsi2ss %edi, %xmm2, %xmm2 convert to float (p)
+// vdivss %xmm0, %xmm2, %xmm0 xmm0 <- xmm2 (p float) / xmm0 (q+r float)
+// vunpcklps %xmm0, %xmm0, %xmm0 convert float to double?
+// vcvtps2pd %xmm0, %xmm0 convert float to double?
+// vsubsd %xmm1, %xmm0, %xmm0 xmm0 <- xmm0 - (double) s?
+// ret
+
+// s must be in xmm1, it's only used at the end to subtract from xmm0, it must also be double since vsubsd is used
+//
+// p q r q+r p/(q+r)
+// rdi, int, since it's xmm0, float rsi, long float, xmm0 float, xmm0
+// converted
+// on line 3
+//
+// rdi, int, since it's rsi, long xmm0, float float, xmm0 float, xmm0
+// converted
+// on line 3