Skip to content

Commit ac96540

Browse files
committed
Restrict to WASM for now
1 parent eb4b9f5 commit ac96540

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/mono/mono/metadata/metadata.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1538,7 +1538,8 @@ decode_value_scalar (const guint8 *ptr, const guint8 **new_ptr)
15381538
MONO_ALWAYS_INLINE guint32
15391539
mono_metadata_decode_value_simd (const guint8 *ptr, const guint8 **new_ptr)
15401540
{
1541-
#if defined(__clang__) && (G_BYTE_ORDER == G_LITTLE_ENDIAN)
1541+
// FIXME: Determine whether it's safe to perform this optimization on non-wasm targets.
1542+
#if defined(__clang__) && (G_BYTE_ORDER == G_LITTLE_ENDIAN) && defined(HOST_WASM)
15421543
guint32 result;
15431544

15441545
typedef guint8 v64_u1 __attribute__ ((vector_size (8)));
@@ -1586,8 +1587,8 @@ mono_metadata_decode_value_simd (const guint8 *ptr, const guint8 **new_ptr)
15861587
// i don't know why the default case is necessary here, but without it the jump table has 5 entries.
15871588
default:
15881589
// (b * 0x80) != 0, and (b & 0x40) != 0
1589-
// for some reason on wasm the 'v.b[0]' load generates an '& 255',
1590-
// even if we cache it in a guint8 local
1590+
// on wasm the 'v.b[0]' load generates an '& 255', even if we cache it in a
1591+
// guint8 local. this is https://github.com/llvm/llvm-project/issues/87398
15911592
if (v.b[0] == 0xFFu) {
15921593
// v.b = { ptr[4], ptr[3], ptr[2], ptr[1] }
15931594
// on x64 this generates kind of gross code, i.e.

0 commit comments

Comments
 (0)