summaryrefslogtreecommitdiff
path: root/sv.h
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2006-12-13 20:56:24 +0000
committerNicholas Clark <nick@ccl4.org>2006-12-13 20:56:24 +0000
commita4558e1afe1f4daf6db9e38c0852e5f89d5788cc (patch)
tree56419fe2efdbc31c5fc2c250233be63efc85aad9 /sv.h
parent69d979076b2f9bb35f54152abb51ae3bcac7b013 (diff)
downloadperl-a4558e1afe1f4daf6db9e38c0852e5f89d5788cc.tar.gz
Swap the order of PERL_FBM_PREVIOUS_{L,H}_OFFSET_FROM_TABLE on little
endian machines to hint to the compiler that a 16 bit read could work. p4raw-id: //depot/perl@29552
Diffstat (limited to 'sv.h')
-rw-r--r--sv.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/sv.h b/sv.h
index 8b1f385f46..d052b0d626 100644
--- a/sv.h
+++ b/sv.h
@@ -1334,8 +1334,13 @@ the scalar's value cannot change unless written to.
#define PERL_FBM_TABLE_OFFSET 5 /* Number of bytes between EOS and table */
#define PERL_FBM_FLAGS_OFFSET_FROM_TABLE -1
/* how many characters in string before rare? */
-#define PERL_FBM_PREVIOUS_L_OFFSET_FROM_TABLE -2
-#define PERL_FBM_PREVIOUS_H_OFFSET_FROM_TABLE -3
+#if (BYTEORDER == 0x4321) || (BYTEORDER == 0x87654321)
+# define PERL_FBM_PREVIOUS_L_OFFSET_FROM_TABLE -2
+# define PERL_FBM_PREVIOUS_H_OFFSET_FROM_TABLE -3
+#else
+# define PERL_FBM_PREVIOUS_H_OFFSET_FROM_TABLE -2
+# define PERL_FBM_PREVIOUS_L_OFFSET_FROM_TABLE -3
+#endif
/* rarest character in string */
#define PERL_FBM_RARE_OFFSET_FROM_TABLE -4