- get_tarval_overflow(): when in warp mode, the strcalc module expects that ALL
bits are set (and this includes the HIGH bits)
[r8132]
* Do sign extension if the mode is signed, expects all upper bits
* cleared.
*/
-static void sign_extend(char *calc_buffer, ir_mode *mode) {
+void sign_extend(char *calc_buffer, ir_mode *mode) {
if (mode_is_signed(mode)) {
int bits = get_mode_size_bits(mode) - 1;
int ofs = bits >> 2;
const void *sc_get_buffer(void);
int sc_get_buffer_length(void);
+void sign_extend(char *calc_buffer, ir_mode *mode);
+
/** create an value form a string representation */
void sc_val_from_str(const char *str, unsigned int len, void *buffer, ir_mode *mode);
char *temp = alloca(sc_get_buffer_length());
sc_val_from_ulong(-1, temp);
sc_and(temp, value, temp);
+ /* the sc_ module expects that all bits are set ... */
+ sign_extend(temp, mode);
return get_tarval(temp, length, mode);
}
case TV_OVERFLOW_BAD: