All of lore.kernel.org
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <geert@linux-m68k.org>
To: dri-devel@lists.freedesktop.org
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Subject: [PATCH libdrm v2 01/10] intel: Improve checks for big-endian
Date: Fri,  8 Jul 2022 20:21:40 +0200	[thread overview]
Message-ID: <289528263127053c7d683a582f77927e7acd4d8c.1657302103.git.geert@linux-m68k.org> (raw)
In-Reply-To: <cover.1657302103.git.geert@linux-m68k.org>

  - sparc64-linux-gnu-gcc does not define __BIG_ENDIAN__ or SPARC, but
    does define __sparc__, hence replace the check for SPARC by a check
    for __sparc__,
  - powerpc{,64,64}-linux-gnu-gcc does not define __ppc__ or __ppc64__,
    but does define __BIG_ENDIAN__.
    powerpc64le-linux-gnu-gcc does not define __ppc__ or __ppc64__, but
    does define __LITTLE_ENDIAN__.
    Hence remove the checks for __ppc__ and __ppc64__.
  - arm-linux-gnueabi-gcc and aarch64-linux-gnu-gcc do not define
    __BIG_ENDIAN__ for targets in big-endian mode, but do define
    __ARM_BIG_ENDIAN, so add a check for the latter,
  - m68k-linux-gnu-gcc does not define __BIG_ENDIAN__, but does define
    __mc68000__, so add a check for the latter,
  - mips{,64}-linux-gnu{,abi64}-gcc does not define __BIG_ENDIAN__, but
    does define __MIPSEB__, so add a check for the latter,
  - s390x-linux-gnu-gcc does not define __BIG_ENDIAN__, but does define
    __s390__, so add a check for the latter,
  - hppa{,64}-linux-gnu-gcc, microblaze-linux-gcc, and sh4-linux-gnu-gcc
    in big-endian mode do define __BIG_ENDIAN__, and thus should work
    out-of-the-box.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
Untested due to lack of hardware.

v2:
  - Add arm, aarch64, microblaze, s390, and sh.
---
 intel/uthash.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/intel/uthash.h b/intel/uthash.h
index 45d1f9fc12a1d6f9..a8465f23ff9fbcac 100644
--- a/intel/uthash.h
+++ b/intel/uthash.h
@@ -648,7 +648,7 @@ do {
 #define MUR_PLUS2_ALIGNED(p) (((unsigned long)p & 3UL) == 2UL)
 #define MUR_PLUS3_ALIGNED(p) (((unsigned long)p & 3UL) == 3UL)
 #define WP(p) ((uint32_t*)((unsigned long)(p) & ~3UL))
-#if (defined(__BIG_ENDIAN__) || defined(SPARC) || defined(__ppc__) || defined(__ppc64__))
+#if (defined(__BIG_ENDIAN__) || defined(__ARM_BIG_ENDIAN) || defined(__mc68000__) || defined(__MIPSEB__) || defined(__s390__) || defined(__sparc__))
 #define MUR_THREE_ONE(p) ((((*WP(p))&0x00ffffff) << 8) | (((*(WP(p)+1))&0xff000000) >> 24))
 #define MUR_TWO_TWO(p)   ((((*WP(p))&0x0000ffff) <<16) | (((*(WP(p)+1))&0xffff0000) >> 16))
 #define MUR_ONE_THREE(p) ((((*WP(p))&0x000000ff) <<24) | (((*(WP(p)+1))&0xffffff00) >>  8))
-- 
2.25.1


  reply	other threads:[~2022-07-08 18:22 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-08 18:21 [PATCH libdrm v2 00/10] Big-endian fixes Geert Uytterhoeven
2022-07-08 18:21 ` Geert Uytterhoeven [this message]
2022-07-08 18:21 ` [PATCH libdrm v2 02/10] util: Fix 32 bpp patterns on big-endian Geert Uytterhoeven
2022-07-08 18:21 ` [PATCH libdrm v2 03/10] util: Fix 16 " Geert Uytterhoeven
2022-07-08 18:21 ` [PATCH libdrm v2 04/10] util: Add missing big-endian RGB16 frame buffer formats Geert Uytterhoeven
2022-07-11 12:17   ` Ville Syrjälä
2022-07-11 12:34     ` Geert Uytterhoeven
2022-07-12 10:20       ` Michel Dänzer
2023-07-05 16:08       ` Geert Uytterhoeven
2022-07-08 18:21 ` [PATCH libdrm v2 05/10] modetest: Fix printing of big-endian fourcc values Geert Uytterhoeven
2022-07-08 18:21 ` [PATCH libdrm v2 06/10] modetest: Add support for parsing big-endian formats Geert Uytterhoeven
2022-07-08 18:21 ` [PATCH libdrm v2 07/10] util: Add test pattern support for big-endian XRGB1555/RGB565 Geert Uytterhoeven
2022-07-08 18:21 ` [PATCH libdrm v2 08/10] util: Fix pwetty on big-endian Geert Uytterhoeven
2022-07-08 18:21 ` [PATCH libdrm v2 09/10] util: Add pwetty support for big-endian RGB565 Geert Uytterhoeven
2022-07-08 18:21 ` [PATCH libdrm v2 10/10] modetest: Add support for big-endian XRGB1555/RGB565 Geert Uytterhoeven

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=289528263127053c7d683a582f77927e7acd4d8c.1657302103.git.geert@linux-m68k.org \
    --to=geert@linux-m68k.org \
    --cc=dri-devel@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.