Skip to content

Commit

Permalink
Fix some more ARM64 and AMD64 build issues.
Browse files Browse the repository at this point in the history
- ImageDecoder: Default parameter for the SSE2-only version isn't needed.

- byteswap.h: Check for i386/amd64 before using the non-inline functions.
  • Loading branch information
GerbilSoft committed Jul 12, 2020
1 parent 8b7db70 commit 1a7d919
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
7 changes: 7 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
rom-properties (1.6-1ppa1~xenial4) xenial; urgency=medium

* ImageDecoder: Fix ARM64 linkage and AMD64 compile errors as a result of
the IFUNC fixes.

-- David Korth <gerbilsoft@gerbilsoft.com> Sun, 12 Jul 2020 15:54:10 -0400

rom-properties (1.6-1ppa1~xenial3) xenial; urgency=medium

* ImageDecoder: Another attempt to fix ARM64 IFUNC build issues...
Expand Down
6 changes: 3 additions & 3 deletions src/librpcpu/byteswap.h
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ void __byte_swap_16_array_ssse3(uint16_t *ptr, size_t n);
void __byte_swap_32_array_ssse3(uint32_t *ptr, size_t n);
#endif /* BYTESWAP_HAS_SSSE3 */

#if defined(RP_HAS_IFUNC)
#if defined(RP_HAS_IFUNC) && (defined(RP_CPU_I386) || defined(RP_CPU_AMD64))
/* System has IFUNC. Use it for dispatching. */

/**
Expand All @@ -203,7 +203,7 @@ void __byte_swap_16_array(uint16_t *ptr, size_t n);
*/
void __byte_swap_32_array(uint32_t *ptr, size_t n);

#else /* !RP_HAS_IFUNC */
#else /* !RP_HAS_IFUNC && !(defined(RP_CPU_I386) || defined(RP_CPU_AMD64)) */
/* System does not have IFUNC. Use inline dispatch functions. */

/**
Expand Down Expand Up @@ -275,7 +275,7 @@ static inline void __byte_swap_32_array(uint32_t *ptr, size_t n)
# endif /* !BYTESWAP_ALWAYS_HAS_SSE2 */
}

#endif /* RP_HAS_IFUNC */
#endif /* RP_HAS_IFUNC && (defined(RP_CPU_I386) || defined(RP_CPU_AMD64)) */

#ifdef __cplusplus
}
Expand Down
6 changes: 3 additions & 3 deletions src/librptexture/decoder/ImageDecoder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -783,13 +783,13 @@ rp_image *fromBC7(int width, int height,
*/
static inline rp_image *fromLinear16(PixelFormat px_format,
int width, int height,
const uint16_t *img_buf, int img_siz, int stride = 0)
const uint16_t *img_buf, int img_siz, int stride)
{
// amd64 always has SSE2.
return fromLinear16_sse2(px_format, width, height, img_buf, img_siz, stride);
}

#endif /* defined(RP_HAS_IFUNC) && defined(IMAGEDECODER_ALWAYS_HAS_SSE2) */
#endif /* RP_HAS_IFUNC && IMAGEDECODER_ALWAYS_HAS_SSE2 */

#if !defined(RP_HAS_IFUNC) || (!defined(RP_CPU_I386) && !defined(RP_CPU_AMD64))

Expand Down Expand Up @@ -874,7 +874,7 @@ static rp_image *fromLinear32(PixelFormat px_format,
}
}

#endif /* !defined(RP_HAS_IFUNC) || (!defined(RP_CPU_I386) && !defined(RP_CPU_AMD64)) */
#endif /* !RP_HAS_IFUNC || (!RP_CPU_I386 && !RP_CPU_AMD64) */

} }

Expand Down

0 comments on commit 1a7d919

Please sign in to comment.