This is an automated email from the ASF dual-hosted git repository.

alexey pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kudu.git


The following commit(s) were added to refs/heads/master by this push:
     new 8d48f9396 [codegen] use "BLR" instead of "RET" for ppc64le
8d48f9396 is described below

commit 8d48f9396b3cf3a6f0c20e949a506e95c4f2754d
Author: harinreddy <hnre...@us.ibm.com>
AuthorDate: Sun Sep 18 22:34:58 2022 -0500

    [codegen] use "BLR" instead of "RET" for ppc64le
    
    ppc64le does not have the assembler instruction "RET".
    This patch updates the codegen to handle the "BLR" instruction
    (Branch to Link Register) for ppc64 which is equivalent to "RET"
    in x86_64.
    
    Change-Id: Ia40f902b14c899a2efc0bed3d3fc31376d516db7
    Reviewed-on: http://gerrit.cloudera.org:8080/19016
    Tested-by: Alexey Serbin <ale...@apache.org>
    Reviewed-by: Alexey Serbin <ale...@apache.org>
---
 src/kudu/codegen/code_generator.cc | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/kudu/codegen/code_generator.cc 
b/src/kudu/codegen/code_generator.cc
index 642b84172..9b0d42968 100644
--- a/src/kudu/codegen/code_generator.cc
+++ b/src/kudu/codegen/code_generator.cc
@@ -180,7 +180,15 @@ int DumpAsm(FuncPtr fptr, const TargetMachine& tm, 
std::ostream* out, int max_in
       // http://llvm.org/docs/Packaging.html#c-features).
       string opname = printer->getOpcodeName(inst.getOpcode()).str();
       std::transform(opname.begin(), opname.end(), opname.begin(), ::toupper);
-      if (opname.find("RET") != string::npos) return i + 1;
+#if defined(__powerpc64__)
+      if (opname.find("BLR") != string::npos) {
+        return i + 1;
+      }
+#else
+      if (opname.find("RET") != string::npos) {
+        return i + 1;
+      }
+#endif  // #if defined(__powerpc64__) ... #else ...
     }
     addr += size;
   }

Reply via email to