tcg.c (92ab8e7d621e11df559fc2427ff08df6c3a5a6de) tcg.c (755bf9e514e3f60ffa3f0495e6bc524fca74f3be)
1/*
2 * Tiny Code Generator for QEMU
3 *
4 * Copyright (c) 2008 Fabrice Bellard
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to deal
8 * in the Software without restriction, including without limitation the rights

--- 83 unchanged lines hidden (view full) ---

92 uintptr_t func_len;
93} DebugFrameFDEHeader;
94
95typedef struct QEMU_PACKED {
96 DebugFrameCIE cie;
97 DebugFrameFDEHeader fde;
98} DebugFrameHeader;
99
1/*
2 * Tiny Code Generator for QEMU
3 *
4 * Copyright (c) 2008 Fabrice Bellard
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to deal
8 * in the Software without restriction, including without limitation the rights

--- 83 unchanged lines hidden (view full) ---

92 uintptr_t func_len;
93} DebugFrameFDEHeader;
94
95typedef struct QEMU_PACKED {
96 DebugFrameCIE cie;
97 DebugFrameFDEHeader fde;
98} DebugFrameHeader;
99
100static void tcg_register_jit_int(void *buf, size_t size,
100static void tcg_register_jit_int(const void *buf, size_t size,
101 const void *debug_frame,
102 size_t debug_frame_size)
103 __attribute__((unused));
104
105/* Forward declarations for functions declared and used in tcg-target.c.inc. */
106static const char *target_parse_constraint(TCGArgConstraint *ct,
107 const char *ct_str, TCGType type);
108static void tcg_out_ld(TCGContext *s, TCGType type, TCGReg ret, TCGReg arg1,

--- 1023 unchanged lines hidden (view full) ---

1132 /* Deduct the prologue from the buffer. */
1133 prologue_size = tcg_current_code_size(s);
1134 s->code_gen_ptr = buf1;
1135 s->code_gen_buffer = buf1;
1136 s->code_buf = buf1;
1137 total_size -= prologue_size;
1138 s->code_gen_buffer_size = total_size;
1139
101 const void *debug_frame,
102 size_t debug_frame_size)
103 __attribute__((unused));
104
105/* Forward declarations for functions declared and used in tcg-target.c.inc. */
106static const char *target_parse_constraint(TCGArgConstraint *ct,
107 const char *ct_str, TCGType type);
108static void tcg_out_ld(TCGContext *s, TCGType type, TCGReg ret, TCGReg arg1,

--- 1023 unchanged lines hidden (view full) ---

1132 /* Deduct the prologue from the buffer. */
1133 prologue_size = tcg_current_code_size(s);
1134 s->code_gen_ptr = buf1;
1135 s->code_gen_buffer = buf1;
1136 s->code_buf = buf1;
1137 total_size -= prologue_size;
1138 s->code_gen_buffer_size = total_size;
1139
1140 tcg_register_jit(s->code_gen_buffer, total_size);
1140 tcg_register_jit(tcg_splitwx_to_rx(s->code_gen_buffer), total_size);
1141
1142#ifdef DEBUG_DISAS
1143 if (qemu_loglevel_mask(CPU_LOG_TB_OUT_ASM)) {
1144 FILE *logfile = qemu_log_lock();
1145 qemu_log("PROLOGUE: [size=%zu]\n", prologue_size);
1146 if (s->data_gen_ptr) {
1147 size_t code_size = s->data_gen_ptr - buf0;
1148 size_t data_size = prologue_size - code_size;

--- 3357 unchanged lines hidden (view full) ---

4506 while (1) {
4507 if (strcmp(p, str) == 0) {
4508 return p - strtab;
4509 }
4510 p += strlen(p) + 1;
4511 }
4512}
4513
1141
1142#ifdef DEBUG_DISAS
1143 if (qemu_loglevel_mask(CPU_LOG_TB_OUT_ASM)) {
1144 FILE *logfile = qemu_log_lock();
1145 qemu_log("PROLOGUE: [size=%zu]\n", prologue_size);
1146 if (s->data_gen_ptr) {
1147 size_t code_size = s->data_gen_ptr - buf0;
1148 size_t data_size = prologue_size - code_size;

--- 3357 unchanged lines hidden (view full) ---

4506 while (1) {
4507 if (strcmp(p, str) == 0) {
4508 return p - strtab;
4509 }
4510 p += strlen(p) + 1;
4511 }
4512}
4513
4514static void tcg_register_jit_int(void *buf_ptr, size_t buf_size,
4514static void tcg_register_jit_int(const void *buf_ptr, size_t buf_size,
4515 const void *debug_frame,
4516 size_t debug_frame_size)
4517{
4518 struct __attribute__((packed)) DebugInfo {
4519 uint32_t len;
4520 uint16_t version;
4521 uint32_t abbrev;
4522 uint8_t ptr_size;

--- 185 unchanged lines hidden (view full) ---

4708 __jit_debug_descriptor.relevant_entry = &one_entry;
4709 __jit_debug_descriptor.first_entry = &one_entry;
4710 __jit_debug_register_code();
4711}
4712#else
4713/* No support for the feature. Provide the entry point expected by exec.c,
4714 and implement the internal function we declared earlier. */
4715
4515 const void *debug_frame,
4516 size_t debug_frame_size)
4517{
4518 struct __attribute__((packed)) DebugInfo {
4519 uint32_t len;
4520 uint16_t version;
4521 uint32_t abbrev;
4522 uint8_t ptr_size;

--- 185 unchanged lines hidden (view full) ---

4708 __jit_debug_descriptor.relevant_entry = &one_entry;
4709 __jit_debug_descriptor.first_entry = &one_entry;
4710 __jit_debug_register_code();
4711}
4712#else
4713/* No support for the feature. Provide the entry point expected by exec.c,
4714 and implement the internal function we declared earlier. */
4715
4716static void tcg_register_jit_int(void *buf, size_t size,
4716static void tcg_register_jit_int(const void *buf, size_t size,
4717 const void *debug_frame,
4718 size_t debug_frame_size)
4719{
4720}
4721
4717 const void *debug_frame,
4718 size_t debug_frame_size)
4719{
4720}
4721
4722void tcg_register_jit(void *buf, size_t buf_size)
4722void tcg_register_jit(const void *buf, size_t buf_size)
4723{
4724}
4725#endif /* ELF_HOST_MACHINE */
4726
4727#if !TCG_TARGET_MAYBE_vec
4728void tcg_expand_vec_op(TCGOpcode o, TCGType t, unsigned e, TCGArg a0, ...)
4729{
4730 g_assert_not_reached();
4731}
4732#endif
4723{
4724}
4725#endif /* ELF_HOST_MACHINE */
4726
4727#if !TCG_TARGET_MAYBE_vec
4728void tcg_expand_vec_op(TCGOpcode o, TCGType t, unsigned e, TCGArg a0, ...)
4729{
4730 g_assert_not_reached();
4731}
4732#endif