aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPo Lu2023-04-02 09:11:00 +0800
committerPo Lu2023-04-02 09:11:00 +0800
commit1d84b4b28659b5f2cc60872ce095e3887bed6fdd (patch)
tree7b9e75b4fac2a599fb8f6dd32ed893b3b188ba02 /src
parentaeac57fbbd7b0a1fcc27230f8e44374bd93b1602 (diff)
parent97e35b149874a105a9975853a7fcd6f0034ddeab (diff)
downloademacs-1d84b4b28659b5f2cc60872ce095e3887bed6fdd.tar.gz
emacs-1d84b4b28659b5f2cc60872ce095e3887bed6fdd.zip
Merge remote-tracking branch 'origin/master' into feature/android
Diffstat (limited to 'src')
-rw-r--r--src/fns.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/fns.c b/src/fns.c
index e28d684396a..46fc20f9a77 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -452,6 +452,9 @@ If string STR1 is greater, the value is a positive number N;
452 || defined __s390__ || defined __s390x__) \ 452 || defined __s390__ || defined __s390x__) \
453 && defined __OPTIMIZE__ 453 && defined __OPTIMIZE__
454#define HAVE_FAST_UNALIGNED_ACCESS 1 454#define HAVE_FAST_UNALIGNED_ACCESS 1
455#else
456#define HAVE_FAST_UNALIGNED_ACCESS 0
457#endif
455 458
456/* Load a word from a possibly unaligned address. */ 459/* Load a word from a possibly unaligned address. */
457static inline size_t 460static inline size_t
@@ -462,8 +465,6 @@ load_unaligned_size_t (const void *p)
462 return x; 465 return x;
463} 466}
464 467
465#endif
466
467DEFUN ("string-lessp", Fstring_lessp, Sstring_lessp, 2, 2, 0, 468DEFUN ("string-lessp", Fstring_lessp, Sstring_lessp, 2, 2, 0,
468 doc: /* Return non-nil if STRING1 is less than STRING2 in lexicographic order. 469 doc: /* Return non-nil if STRING1 is less than STRING2 in lexicographic order.
469Case is significant. 470Case is significant.
@@ -504,18 +505,16 @@ Symbols are also allowed; their print names are used instead. */)
504 /* String data is normally allocated with word alignment, but 505 /* String data is normally allocated with word alignment, but
505 there are exceptions (notably pure strings) so we restrict the 506 there are exceptions (notably pure strings) so we restrict the
506 wordwise skipping to safe architectures. */ 507 wordwise skipping to safe architectures. */
507#ifdef HAVE_FAST_UNALIGNED_ACCESS 508 if (HAVE_FAST_UNALIGNED_ACCESS)
508 { 509 {
509 /* First compare entire machine words. */ 510 /* First compare entire machine words. */
510 int ws = sizeof (size_t); 511 int ws = sizeof (size_t);
511 const char *w1 = SSDATA (string1); 512 const char *w1 = SSDATA (string1);
512 const char *w2 = SSDATA (string2); 513 const char *w2 = SSDATA (string2);
513 while (b < nb - ws + 1 514 while (b < nb - ws + 1 && load_unaligned_size_t (w1 + b)
514 && (load_unaligned_size_t (w1 + b) 515 == load_unaligned_size_t (w2 + b))
515 == load_unaligned_size_t (w2 + b)))
516 b += ws; 516 b += ws;
517 } 517 }
518#endif
519 518
520 /* Scan forward to the differing byte. */ 519 /* Scan forward to the differing byte. */
521 while (b < nb && SREF (string1, b) == SREF (string2, b)) 520 while (b < nb && SREF (string1, b) == SREF (string2, b))