Add reverse modes for int__xor, as suggested by

Estimated hours taken: 1

Add reverse modes for int__xor, as suggested by
Michael Roe <mroe@microsoft.com>.

library/int.m:
	Declare the new modes for int__xor.

library/Mmakefile:
	Compile int.m with `--no-halt-at-warn'.  This is needed
	because when compiling with the old compiler that doesn't
	know about these new modes, the old compiler gives a
	warning about the extra modes.

compiler/code_util.m:
compiler/ml_call_gen.m:
	Add code to implement the new modes for the builtin int__xor.

tests/general/arithmetic.m:
	Add a test of the new modes of int__xor.

NEWS:
	Document the change.
This commit is contained in:
Fergus Henderson
2000-03-13 04:00:43 +00:00
parent b61650251e
commit 00ffa8d3db
6 changed files with 33 additions and 2 deletions

View File

@@ -485,6 +485,10 @@ code_util__translate_builtin_2("int", "builtin_bit_xor", 0, [X, Y, Z],
no, yes(Z - binop((^), var(X), var(Y)))).
code_util__translate_builtin_2("int", "xor", 0, [X, Y, Z],
no, yes(Z - binop((^), var(X), var(Y)))).
code_util__translate_builtin_2("int", "xor", 1, [X, Y, Z],
no, yes(Y - binop((^), var(X), var(Z)))).
code_util__translate_builtin_2("int", "xor", 2, [X, Y, Z],
no, yes(X - binop((^), var(Y), var(Z)))).
code_util__translate_builtin_2("int", "builtin_unary_plus", 0, [X, Y],
no, yes(Y - var(X))).
code_util__translate_builtin_2("int", "+", 0, [X, Y],