diff options
Diffstat (limited to 'gcc/dwarf2asm.c')
-rw-r--r-- | gcc/dwarf2asm.c | 74 |
1 files changed, 72 insertions, 2 deletions
diff --git a/gcc/dwarf2asm.c b/gcc/dwarf2asm.c index 43d57e9..9ae9420 100644 --- a/gcc/dwarf2asm.c +++ b/gcc/dwarf2asm.c @@ -62,6 +62,34 @@ dw2_assemble_integer (int size, rtx x) } +/* Output a value of a given size in target byte order. */ + +void +dw2_asm_output_data_raw (int size, unsigned HOST_WIDE_INT value) +{ + unsigned char bytes[8]; + int i; + + for (i = 0; i < 8; ++i) + { + bytes[i] = value & 0xff; + value >>= 8; + } + + if (BYTES_BIG_ENDIAN) + { + for (i = size - 1; i > 0; --i) + fprintf (asm_out_file, "0x%x,", bytes[i]); + fprintf (asm_out_file, "0x%x", bytes[0]); + } + else + { + for (i = 0; i < size - 1; ++i) + fprintf (asm_out_file, "0x%x,", bytes[i]); + fprintf (asm_out_file, "0x%x", bytes[i]); + } +} + /* Output an immediate constant in a given SIZE in bytes. */ void @@ -505,6 +533,26 @@ eh_data_format_name (int format) #endif } +/* Output an unsigned LEB128 quantity, but only the byte values. */ + +void +dw2_asm_output_data_uleb128_raw (unsigned HOST_WIDE_INT value) +{ + while (1) + { + int byte = (value & 0x7f); + value >>= 7; + if (value != 0) + /* More bytes to follow. */ + byte |= 0x80; + + fprintf (asm_out_file, "0x%x", byte); + if (value == 0) + break; + fputc (',', asm_out_file); + } +} + /* Output an unsigned LEB128 quantity. */ void @@ -566,6 +614,29 @@ dw2_asm_output_data_uleb128 (unsigned HOST_WIDE_INT value, va_end (ap); } +/* Output an signed LEB128 quantity, but only the byte values. */ + +void +dw2_asm_output_data_sleb128_raw (HOST_WIDE_INT value) +{ + int byte, more; + + while (1) + { + byte = (value & 0x7f); + value >>= 7; + more = !((value == 0 && (byte & 0x40) == 0) + || (value == -1 && (byte & 0x40) != 0)); + if (more) + byte |= 0x80; + + fprintf (asm_out_file, "0x%x", byte); + if (!more) + break; + fputc (',', asm_out_file); + } +} + /* Output a signed LEB128 quantity. */ void @@ -689,7 +760,6 @@ dw2_asm_output_delta_sleb128 (const char *lab1 ATTRIBUTE_UNUSED, } #endif /* 0 */ -static rtx dw2_force_const_mem (rtx, bool); static int dw2_output_indirect_constant_1 (splay_tree_node, void *); static GTY((param1_is (char *), param2_is (tree))) splay_tree indirect_pool; @@ -733,7 +803,7 @@ splay_tree_compare_strings (splay_tree_key k1, splay_tree_key k2) "near" the function in any interesting sense. IS_PUBLIC controls whether the symbol can be shared across the entire application (or DSO). */ -static rtx +rtx dw2_force_const_mem (rtx x, bool is_public) { splay_tree_node node; |