Commit f7438c49 authored by Matthias Braun's avatar Matthias Braun
Browse files

tarval: allow or/eor/and/andnot on references

parent 50b724a8
......@@ -1186,6 +1186,7 @@ ir_tarval *tarval_and(ir_tarval *a, ir_tarval *b)
case irms_internal_boolean:
return (a == tarval_b_false) ? a : b;
case irms_reference:
case irms_int_number:
sc_and(a->value, b->value, NULL);
return get_tarval(sc_get_buffer(), sc_get_buffer_length(), a->mode);
......@@ -1206,6 +1207,7 @@ ir_tarval *tarval_andnot(ir_tarval *a, ir_tarval *b)
case irms_internal_boolean:
return a == tarval_b_true && b == tarval_b_false ? tarval_b_true : tarval_b_false;
case irms_reference:
case irms_int_number:
sc_andnot(a->value, b->value, NULL);
return get_tarval(sc_get_buffer(), sc_get_buffer_length(), a->mode);
......@@ -1229,6 +1231,7 @@ ir_tarval *tarval_or(ir_tarval *a, ir_tarval *b)
case irms_internal_boolean:
return (a == tarval_b_true) ? a : b;
case irms_reference:
case irms_int_number:
sc_or(a->value, b->value, NULL);
return get_tarval(sc_get_buffer(), sc_get_buffer_length(), a->mode);
......@@ -1252,6 +1255,7 @@ ir_tarval *tarval_eor(ir_tarval *a, ir_tarval *b)
case irms_internal_boolean:
return (a == b)? tarval_b_false : tarval_b_true;
case irms_reference:
case irms_int_number:
sc_xor(a->value, b->value, NULL);
return get_tarval(sc_get_buffer(), sc_get_buffer_length(), a->mode);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment