Front page | perl.perl6.internals |
Postings from February 2002
[PATCH] Zero register
From:
Melvin Smith
Date:
February 28, 2002 00:50
Subject:
[PATCH] Zero register
Message ID:
5.1.0.14.0.20020228034145.01f4d5e8@pop.mindspring.com
Boredom + insomnia = ....
This is just a simple zero op for numeric registers. Its minutely
faster than set $REG, 0 and on intel at least, and I don't know how it
maps to JIT.
I won't commit this myself because I'm still unsure the minor speed is
worth it, however I feel compiler freaks might like having it.
-Melvin
Index: core.ops
===================================================================
RCS file: /cvs/public/parrot/core.ops,v
retrieving revision 1.96
diff -u -r1.96 core.ops
--- core.ops 18 Feb 2002 08:26:03 -0000 1.96
+++ core.ops 28 Feb 2002 08:42:45 -0000
@@ -537,6 +537,29 @@
goto NEXT();
}
+########################################
+
+=item B<zero>(in INT)
+
+=item B<zero>(in NUM)
+
+ Zero out register $1
+ Faster than set, $1, 0 (we hope)
+
+=cut
+
+inline op zero(in INT) {
+ $1 = 0;
+ goto NEXT();
+}
+
+inline op zero(in NUM) {
+ $1 = 0;
+ goto NEXT();
+}
+
+########################################
+
=item B<set_keyed>(out PMC, out PMC, in PMC, in PMC)
$1[$2] = $3[$4];
-
[PATCH] Zero register
by Melvin Smith