-static const char *node_const_to_str(ir_node *n) {
- char buffer[SNPRINTF_BUF_LEN];
-
- if ( is_immediate_node(n) ) {
- long longvalue = get_tarval_long(get_arm_value(n));
- char *str;
- assert(longvalue < 0x1000 && "constant doesn't fit in shifter_operand");
- snprintf(buffer, SNPRINTF_BUF_LEN - 1, "#%ld << %ld", longvalue & 0xff, (longvalue >> 8) << 1 );
- str = xmalloc(strlen(buffer) * sizeof(char));
- strcpy(str, buffer);
- return str;
- }
- if ( is_arm_Const(n) || is_arm_Const_Neg(n) ) {
- tarval *tv = get_arm_value(n);
- if ( mode_is_int(get_tarval_mode(tv)) ) {
- long longvalue = get_tarval_long(get_arm_value(n));
- char *str;
- assert(longvalue < 0x1000 && "constant doesn't fit in shifter_operand");
- snprintf(buffer, SNPRINTF_BUF_LEN - 1, "#%ld << %ld", longvalue & 0xff, (longvalue >> 8) << 1 );
- str = xmalloc(strlen(buffer) * sizeof(char));
- strcpy(str, buffer);
- return str;
- } else {
- return "found something else in arm_const";
- }
- } else if ( is_arm_SymConst(n) ) {
- return get_arm_symconst_label(n);
- } else {
- assert( 0 && "das ist gar keine Konstante");
- return NULL;
+static const char *node_const_to_str(ir_node *n, char *buf, int buflen) {
+ if (is_immediate_node(n)) {
+ snprintf(buf, buflen, "#0x%X", arm_decode_imm_w_shift(get_arm_value(n)));
+ return buf;