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

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

Issue 2242223002: PPC: Enable unaligned access and clean up the use of UNALIGNED_ACCESSES (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase over master 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 | « src/regexp/ppc/regexp-macro-assembler-ppc.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/regexp/ppc/regexp-macro-assembler-ppc.cc
diff --git a/src/regexp/ppc/regexp-macro-assembler-ppc.cc b/src/regexp/ppc/regexp-macro-assembler-ppc.cc
index a7418dde53fe0bbd61cf5a09f3ce52624b7fb088..531eac10d74b7c8b897654cdac9a3d376ab8e14a 100644
--- a/src/regexp/ppc/regexp-macro-assembler-ppc.cc
+++ b/src/regexp/ppc/regexp-macro-assembler-ppc.cc
@@ -1269,11 +1269,6 @@ void RegExpMacroAssemblerPPC::CheckStackLimit() {
}
-bool RegExpMacroAssemblerPPC::CanReadUnaligned() {
- return CpuFeatures::IsSupported(UNALIGNED_ACCESSES) && !slow_safe();
-}
-
-
void RegExpMacroAssemblerPPC::LoadCurrentCharacterUnchecked(int cp_offset,
int characters) {
Register offset = current_input_offset();
@@ -1287,14 +1282,47 @@ void RegExpMacroAssemblerPPC::LoadCurrentCharacterUnchecked(int cp_offset,
// We assume we don't want to do unaligned loads on PPC, so this function
// must only be used to load a single character at a time.
- DCHECK(characters == 1);
__ add(current_character(), end_of_input_address(), offset);
+#if V8_TARGET_LITTLE_ENDIAN
if (mode_ == LATIN1) {
- __ lbz(current_character(), MemOperand(current_character()));
+ if (characters == 4) {
+ __ lwz(current_character(), MemOperand(current_character()));
+ } else if (characters == 2) {
+ __ lhz(current_character(), MemOperand(current_character()));
+ } else {
+ DCHECK(characters == 1);
+ __ lbz(current_character(), MemOperand(current_character()));
+ }
} else {
DCHECK(mode_ == UC16);
- __ lhz(current_character(), MemOperand(current_character()));
+ if (characters == 2) {
+ __ lwz(current_character(), MemOperand(current_character()));
+ } else {
+ DCHECK(characters == 1);
+ __ lhz(current_character(), MemOperand(current_character()));
+ }
+ }
+#else
+ if (mode_ == LATIN1) {
+ if (characters == 4) {
+ __ lwbrx(current_character(), MemOperand(r0, current_character()));
+ } else if (characters == 2) {
+ __ lhbrx(current_character(), MemOperand(r0, current_character()));
+ } else {
+ DCHECK(characters == 1);
+ __ lbz(current_character(), MemOperand(current_character()));
+ }
+ } else {
+ DCHECK(mode_ == UC16);
+ if (characters == 2) {
+ __ lwz(current_character(), MemOperand(current_character()));
+ __ rlwinm(current_character(), current_character(), 16, 0, 31);
+ } else {
+ DCHECK(characters == 1);
+ __ lhz(current_character(), MemOperand(current_character()));
+ }
}
+#endif
}
« no previous file with comments | « src/regexp/ppc/regexp-macro-assembler-ppc.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698