Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1270)

Unified Diff: src/regexp/s390/regexp-macro-assembler-s390.cc

Issue 2072863003: S390: Enable unaligned accesses and character preloading in regexp. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Change comment on load reverse Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/s390/assembler-s390.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/regexp/s390/regexp-macro-assembler-s390.cc
diff --git a/src/regexp/s390/regexp-macro-assembler-s390.cc b/src/regexp/s390/regexp-macro-assembler-s390.cc
index d9ca1df3124c8c660f2ac8a41524c02d6d23f228..93bb7029ab02b5020df457f8e00ff7c11ed2fb41 100644
--- a/src/regexp/s390/regexp-macro-assembler-s390.cc
+++ b/src/regexp/s390/regexp-macro-assembler-s390.cc
@@ -1232,17 +1232,52 @@ bool RegExpMacroAssemblerS390::CanReadUnaligned() {
void RegExpMacroAssemblerS390::LoadCurrentCharacterUnchecked(int cp_offset,
int characters) {
- DCHECK(characters == 1);
+ DCHECK(characters == 1 || CanReadUnaligned());
if (mode_ == LATIN1) {
- __ LoadlB(current_character(),
- MemOperand(current_input_offset(), end_of_input_address(),
- cp_offset * char_size()));
+ // using load reverse for big-endian platforms
+ if (characters == 4) {
+#if V8_TARGET_LITTLE_ENDIAN
+ __ LoadlW(current_character(),
+ MemOperand(current_input_offset(), end_of_input_address(),
+ cp_offset * char_size()));
+#else
+ __ LoadLogicalReversedWordP(current_character(),
+ MemOperand(current_input_offset(), end_of_input_address(),
+ cp_offset * char_size()));
+#endif
+ } else if (characters == 2) {
+#if V8_TARGET_LITTLE_ENDIAN
+ __ LoadLogicalHalfWordP(current_character(),
+ MemOperand(current_input_offset(), end_of_input_address(),
+ cp_offset * char_size()));
+#else
+ __ LoadLogicalReversedHalfWordP(current_character(),
+ MemOperand(current_input_offset(), end_of_input_address(),
+ cp_offset * char_size()));
+#endif
+ } else {
+ DCHECK(characters == 1);
+ __ LoadlB(current_character(),
+ MemOperand(current_input_offset(), end_of_input_address(),
+ cp_offset * char_size()));
+ }
} else {
DCHECK(mode_ == UC16);
- __ LoadLogicalHalfWordP(
- current_character(),
- MemOperand(current_input_offset(), end_of_input_address(),
- cp_offset * char_size()));
+ if (characters == 2) {
+ __ LoadlW(current_character(),
+ MemOperand(current_input_offset(), end_of_input_address(),
+ cp_offset * char_size()));
+#if !V8_TARGET_LITTLE_ENDIAN
+ // need to swap the order of the characters for big-endian platforms
+ __ rll(current_character(), current_character(), Operand(16));
+#endif
+ } else {
+ DCHECK(characters == 1);
+ __ LoadLogicalHalfWordP(
+ current_character(),
+ MemOperand(current_input_offset(), end_of_input_address(),
+ cp_offset * char_size()));
+ }
}
}
« no previous file with comments | « no previous file | src/s390/assembler-s390.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698