summaryrefslogtreecommitdiff
path: root/tb/sim/mult.c
diff options
context:
space:
mode:
authorAlejandro Soto <alejandro@34project.org>2022-11-07 13:29:23 -0600
committerAlejandro Soto <alejandro@34project.org>2022-11-07 13:31:15 -0600
commit0907d94bf1e71c5ec697db53933abc462e703c35 (patch)
tree5635979a29fa8c0428a70937fe751bad47434dc7 /tb/sim/mult.c
parentaaf02562e4d49fc93df1f619e3fbd6c85c0e7951 (diff)
Improve mult sim
Diffstat (limited to 'tb/sim/mult.c')
-rw-r--r--tb/sim/mult.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/tb/sim/mult.c b/tb/sim/mult.c
index 531a824..67158f0 100644
--- a/tb/sim/mult.c
+++ b/tb/sim/mult.c
@@ -1,4 +1,10 @@
-int reset(int a, int b, int c)
+long long __attribute__((noinline)) mla(long long a, long long b, long long c)
{
return a * b + c;
}
+
+long long reset(int a, int b, int c)
+{
+ long long la = a, lb = b;
+ return mla(la * la, la + 2 * lb, c);
+}