summaryrefslogtreecommitdiff
path: root/bench/many-memcpy.myr
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2015-10-02 23:27:11 -0700
committerOri Bernstein <ori@eigenstate.org>2015-10-02 23:27:11 -0700
commit08442dd9c3426e2dbe598ef1f6fb10f2f67638aa (patch)
treef8a9d3092248258e5a33bb17fe3a985868ae2ef8 /bench/many-memcpy.myr
parent76086513de9efd7a000d0bc229c3e990f0af5a2f (diff)
downloadmc-08442dd9c3426e2dbe598ef1f6fb10f2f67638aa.tar.gz
Implement some asm optimized memcpy/memmove checks.
TODO: memcmp
Diffstat (limited to 'bench/many-memcpy.myr')
-rw-r--r--bench/many-memcpy.myr27
1 files changed, 27 insertions, 0 deletions
diff --git a/bench/many-memcpy.myr b/bench/many-memcpy.myr
new file mode 100644
index 0000000..94a5486
--- /dev/null
+++ b/bench/many-memcpy.myr
@@ -0,0 +1,27 @@
+use std
+
+const main = {
+ var a : uint64[100000]
+
+ for var j = 0; j < 100; j++
+ /* independent copies forward */
+ for var i = 0; i < 10; i++
+ std.slcp(a[:a.len/2-1], a[a.len/2+1:])
+ ;;
+ /* independent copies backward */
+ for var i = 0; i < 10; i++
+ std.slcp(a[:a.len/2-1], a[a.len/2+1:])
+ ;;
+
+ /* dependent copies forward */
+ for var i = 0; i < 10; i++
+ std.slcp(a[:a.len/2+1000], a[a.len/2-1000:])
+ ;;
+ /* dependent copies backward */
+ for var i = 0; i < 10; i++
+ std.slcp(a[a.len/2-1000:], a[:a.len/2+1000])
+ ;;
+ ;;
+}
+
+