summaryrefslogtreecommitdiffstats
path: root/openmp/runtime/test
diff options
context:
space:
mode:
authorJonas Hahnfeld <hahnjo@hahnjo.de>2019-07-25 14:36:20 +0000
committerJonas Hahnfeld <hahnjo@hahnjo.de>2019-07-25 14:36:20 +0000
commit2488ae9df155cd66253512c42aba5daef1f076be (patch)
tree42a7de40bd8a48380384478161d50659efd3fff3 /openmp/runtime/test
parentd668260f1a8e85976e090207075545a2d97d39a1 (diff)
downloadbcm5719-llvm-2488ae9df155cd66253512c42aba5daef1f076be.tar.gz
bcm5719-llvm-2488ae9df155cd66253512c42aba5daef1f076be.zip
[OpenMP] RISCV64 port
This is a port of libomp for the RISC-V 64-bit Linux target. We have tested this port on a HiFive Unleashed development board using a downstream LLVM that has support for the missing bits in upstream. As of now, all tests are passing, including OMPT. Patch by Ferran Pallarès! Differential Revision: https://reviews.llvm.org/D59880 llvm-svn: 367021
Diffstat (limited to 'openmp/runtime/test')
-rwxr-xr-xopenmp/runtime/test/ompt/callback.h20
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
OpenPOWER on IntegriCloud