case irms_reference:
/* addresses always wrap around */
temp = alloca(sc_get_buffer_length());
- sc_val_from_ulong(-1, temp);
- sc_and(temp, value, temp);
+ memcpy(temp, value, sc_get_buffer_length());
+ sc_truncate(get_mode_size_bits(mode), temp);
/* the sc_ module expects that all bits are set ... */
sign_extend(temp, mode);
return get_tarval(temp, length, mode);
return get_mode_max(mode);
case TV_OVERFLOW_WRAP:
temp = alloca(sc_get_buffer_length());
- sc_val_from_ulong(-1, temp);
- sc_and(temp, value, temp);
+ memcpy(temp, value, sc_get_buffer_length());
+ sc_truncate(get_mode_size_bits(mode), temp);
/* the sc_ module expects that all bits are set ... */
sign_extend(temp, mode);
return get_tarval(temp, length, mode);
return get_mode_min(mode);
case TV_OVERFLOW_WRAP: {
char *temp = alloca(sc_get_buffer_length());
- sc_val_from_ulong(-1, temp);
- sc_and(temp, value, temp);
+ memcpy(temp, value, sc_get_buffer_length());
+ sc_truncate(get_mode_size_bits(mode), temp);
return get_tarval(temp, length, mode);
}
case TV_OVERFLOW_BAD:
case irms_control_flow:
case irms_memory:
case irms_auxiliary:
- case irms_internal_boolean:
assert(0);
break;
case irms_float_number:
return new_tarval_from_double(0.0, mode);
+ case irms_internal_boolean:
case irms_int_number:
return new_tarval_from_long(0l, mode);