[m-rev.] diff: make some libra functions builtins

Zoltan Somogyi zs at cs.mu.OZ.AU
Tue Sep 13 18:47:55 AEST 2005


compiler/builtin_ops.m:
	Make int.plus, int.minus and int.times builtin operations, with
	the same implementations as int.+, int.- and int.*.

Zoltan.

cvs diff: Diffing .
Index: builtin_ops.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/builtin_ops.m,v
retrieving revision 1.17
diff -u -b -r1.17 builtin_ops.m
--- builtin_ops.m	13 Sep 2005 04:55:58 -0000	1.17
+++ builtin_ops.m	13 Sep 2005 08:46:19 -0000
@@ -190,13 +190,19 @@
     assign(X, binary((-), leaf(Z), leaf(Y)))).
 builtin_translation("int", "+", 2, [X, Y, Z],
     assign(Y, binary((-), leaf(Z), leaf(X)))).
+builtin_translation("int", "plus", 0, [X, Y, Z],
+    assign(Z, binary((+), leaf(X), leaf(Y)))).
 builtin_translation("int", "-", 0, [X, Y, Z],
     assign(Z, binary((-), leaf(X), leaf(Y)))).
 builtin_translation("int", "-", 1, [X, Y, Z],
     assign(X, binary((+), leaf(Y), leaf(Z)))).
 builtin_translation("int", "-", 2, [X, Y, Z],
     assign(Y, binary((-), leaf(X), leaf(Z)))).
+builtin_translation("int", "minus", 0, [X, Y, Z],
+    assign(Z, binary((-), leaf(X), leaf(Y)))).
 builtin_translation("int", "*", 0, [X, Y, Z],
+    assign(Z, binary((*), leaf(X), leaf(Y)))).
+builtin_translation("int", "times", 0, [X, Y, Z],
     assign(Z, binary((*), leaf(X), leaf(Y)))).
 builtin_translation("int", "unchecked_quotient", 0, [X, Y, Z],
     assign(Z, binary((/), leaf(X), leaf(Y)))).
cvs diff: Diffing notes
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list