diff options
Diffstat (limited to 'openmp/runtime/test')
| -rwxr-xr-x | openmp/runtime/test/ompt/callback.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/openmp/runtime/test/ompt/callback.h b/openmp/runtime/test/ompt/callback.h index dfb8a172cb4..ed8ef60200a 100755 --- a/openmp/runtime/test/ompt/callback.h +++ b/openmp/runtime/test/ompt/callback.h @@ -168,6 +168,26 @@ ompt_label_##id: #define print_possible_return_addresses(addr) \ printf("%" PRIu64 ": current_address=%p or %p\n", ompt_get_thread_data()->value, \ ((char *)addr) - 4, ((char *)addr) - 8) +#elif KMP_ARCH_RISCV64 +#if __riscv_compressed +// On RV64GC the C.NOP instruction is 2 byte long. In addition, the compiler +// inserts a J instruction (targeting the successor basic block), which +// accounts for another 4 bytes. Finally, an additional J instruction may +// appear (adding 4 more bytes) when the C.NOP is referenced elsewhere (ie. +// another branch). +#define print_possible_return_addresses(addr) \ + printf("%" PRIu64 ": current_address=%p or %p\n", \ + ompt_get_thread_data()->value, ((char *)addr) - 6, ((char *)addr) - 10) +#else +// On RV64G the NOP instruction is 4 byte long. In addition, the compiler +// inserts a J instruction (targeting the successor basic block), which +// accounts for another 4 bytes. Finally, an additional J instruction may +// appear (adding 4 more bytes) when the NOP is referenced elsewhere (ie. +// another branch). +#define print_possible_return_addresses(addr) \ + printf("%" PRIu64 ": current_address=%p or %p\n", \ + ompt_get_thread_data()->value, ((char *)addr) - 8, ((char *)addr) - 12) +#endif #else #error Unsupported target architecture, cannot determine address offset! #endif |

