You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by he...@apache.org on 2023/03/23 03:09:07 UTC

[hadoop] branch trunk updated: HADOOP-18644. Add bswap support for LoongArch64. (#5453). Contributed by zhaixiaojuan.

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

hexiaoqiao pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/hadoop.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 028cde0006a HADOOP-18644. Add bswap support for LoongArch64. (#5453). Contributed by zhaixiaojuan.
028cde0006a is described below

commit 028cde0006a433c926f973bfb8f3fff8ac8c63cc
Author: zhaixiaojuan@loongson.cn <67...@users.noreply.github.com>
AuthorDate: Thu Mar 23 11:08:59 2023 +0800

    HADOOP-18644. Add bswap support for LoongArch64. (#5453). Contributed by zhaixiaojuan.
    
    Reviewed-by: He Xiaoqiao <he...@apache.org>
---
 .../src/main/native/src/lib/primitives.h                              | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-nativetask/src/main/native/src/lib/primitives.h b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-nativetask/src/main/native/src/lib/primitives.h
index 000c4b91fd9..6d454e1dfc5 100644
--- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-nativetask/src/main/native/src/lib/primitives.h
+++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-nativetask/src/main/native/src/lib/primitives.h
@@ -99,7 +99,7 @@ inline void simple_memcpy(void * dest, const void * src, size_t len) {
 inline uint32_t bswap(uint32_t val) {
 #ifdef __aarch64__
   __asm__("rev %w[dst], %w[src]" : [dst]"=r"(val) : [src]"r"(val));
-#elif defined(__ppc64__)||(__PPC64__)||(__powerpc64__)
+#elif defined(__ppc64__)||(__PPC64__)||(__powerpc64__)||(__loongarch64)
   return  __builtin_bswap32(val);
 #else
   __asm__("bswap %0" : "=r" (val) : "0" (val));
@@ -110,7 +110,7 @@ inline uint32_t bswap(uint32_t val) {
 inline uint64_t bswap64(uint64_t val) {
 #ifdef __aarch64__
   __asm__("rev %[dst], %[src]" : [dst]"=r"(val) : [src]"r"(val));
-#elif defined(__ppc64__)||(__PPC64__)||(__powerpc64__)
+#elif defined(__ppc64__)||(__PPC64__)||(__powerpc64__)||(__loongarch64)
   return __builtin_bswap64(val);
 #else
 #ifdef __X64


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org