mirror of
https://github.com/Mercury-Language/mercury.git
synced 2025-12-17 23:05:21 +00:00
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:
@@ -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],
|
||||
|
||||
Reference in New Issue
Block a user