From 04c99d0d0267f574fa60044c96933b0dd3846aa1 Mon Sep 17 00:00:00 2001 From: Alice Zhang Date: Thu, 7 Jan 2021 16:55:05 -0500 Subject: [PATCH] PR13838: - modified dwflpp.cxx so that $fp syntax will be supported - runtme/loc2c-runtime.h: extended x64_64 register to 24 to allow access of xmm0-xmm7 register. - testsuite/systemtap.examples/general: update examples, using $fp instead of user_long($fpointer) --- dwflpp.cxx | 10 ---------- main.cxx | 8 ++++---- runtime/loc2c-runtime.h | 10 +++++++++- testsuite/buildok/floatingpoint.stp | 6 ++++-- testsuite/systemtap.examples/general/floatingpoint.stp | 2 +- 5 files changed, 18 insertions(+), 18 deletions(-) diff --git a/dwflpp.cxx b/dwflpp.cxx index c0107bff7..dcd227523 100644 --- a/dwflpp.cxx +++ b/dwflpp.cxx @@ -3969,16 +3969,6 @@ dwflpp::translate_final_fetch_or_store (location_context &ctx, dwarf_type_name(typedie).c_str()), e->tok)); } - if (encoding == DW_ATE_float - || encoding == DW_ATE_complex_float - /* XXX || many others? */) - { - throw (SEMANTIC_ERROR - (_F("unsupported type (encoding %s) for %s", - lex_cast(encoding).c_str(), - dwarf_type_name(typedie).c_str()), e->tok)); - } - signed_p = (encoding == DW_ATE_signed || encoding == DW_ATE_signed_char); } diff --git a/main.cxx b/main.cxx index f3a0d9830..d8c91f912 100644 --- a/main.cxx +++ b/main.cxx @@ -375,11 +375,11 @@ setup_signals (sighandler_t handler) static void -sdt_benchmark_thread(unsigned long i, double *fpointer, float *fpointer2) +sdt_benchmark_thread(unsigned long i, double fp1, float fp2) { PROBE(stap, benchmark__thread__start); - *fpointer += 0.0; - *fpointer2 += 0.0; + fp1 += 0.0; + fp2 += 0.0; while (i--) PROBE1(stap, benchmark, i); PROBE(stap, benchmark__thread__end); @@ -408,7 +408,7 @@ run_sdt_benchmark(systemtap_session& s) double f = 2.71828; float f2 = 1.41421; for (unsigned long i = 0; i < threads; ++i) - handles.push_back(thread(sdt_benchmark_thread, loops, &f, &f2)); + handles.push_back(thread(sdt_benchmark_thread, loops, f, f2)); for (unsigned long i = 0; i < threads; ++i) handles[i].join(); } diff --git a/runtime/loc2c-runtime.h b/runtime/loc2c-runtime.h index 0502d5a07..5709e831d 100644 --- a/runtime/loc2c-runtime.h +++ b/runtime/loc2c-runtime.h @@ -98,7 +98,15 @@ #define pt_dwarf_register_13(regs) regs->r13 #define pt_dwarf_register_14(regs) regs->r14 #define pt_dwarf_register_15(regs) regs->r15 -#define pt_regs_maxno 15 +#define pt_dwarf_register_17(regs) ({uint64_t v; __asm__ __volatile__("movq %%xmm0, %0" : "=r"(v)); v;}) +#define pt_dwarf_register_18(regs) ({uint64_t v; __asm__ __volatile__("movq %%xmm1, %0" : "=r"(v)); v;}) +#define pt_dwarf_register_19(regs) ({uint64_t v; __asm__ __volatile__("movq %%xmm2, %0" : "=r"(v)); v;}) +#define pt_dwarf_register_20(regs) ({uint64_t v; __asm__ __volatile__("movq %%xmm3, %0" : "=r"(v)); v;}) +#define pt_dwarf_register_21(regs) ({uint64_t v; __asm__ __volatile__("movq %%xmm4, %0" : "=r"(v)); v;}) +#define pt_dwarf_register_22(regs) ({uint64_t v; __asm__ __volatile__("movq %%xmm5, %0" : "=r"(v)); v;}) +#define pt_dwarf_register_23(regs) ({uint64_t v; __asm__ __volatile__("movq %%xmm6, %0" : "=r"(v)); v;}) +#define pt_dwarf_register_24(regs) ({uint64_t v; __asm__ __volatile__("movq %%xmm7, %0" : "=r"(v)); v;}) +#define pt_regs_maxno 24 #elif defined __i386__ diff --git a/testsuite/buildok/floatingpoint.stp b/testsuite/buildok/floatingpoint.stp index 30907f8ac..0178a6d12 100755 --- a/testsuite/buildok/floatingpoint.stp +++ b/testsuite/buildok/floatingpoint.stp @@ -5,9 +5,11 @@ function printlnfp(a) { println(fp_to_string(a,5)) } probe process("stap").function("sdt_benchmark_thread") { - fp = user_long($fpointer) + //i_temp = $i_temp + //println(i_temp) + fp = $fp1 printlnfp(fp) - fp32 = user_int($fpointer2) + fp32 = $fp2 printlnfp(fp32_to_fp64(fp32)) exit() } diff --git a/testsuite/systemtap.examples/general/floatingpoint.stp b/testsuite/systemtap.examples/general/floatingpoint.stp index 3a5df8e63..949ce84e4 100644 --- a/testsuite/systemtap.examples/general/floatingpoint.stp +++ b/testsuite/systemtap.examples/general/floatingpoint.stp @@ -3,7 +3,7 @@ function printlnfp(a) { println(fp_to_string(a,5)) } probe process("stap").function("sdt_benchmark_thread") { - a = user_long($fpointer) + a = $fp1 b = string_to_fp("3.14") c = long_to_fp(2) -- 2.43.5