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

Side by Side Diff: src/arm/macro-assembler-arm.cc

Issue 11087047: Allow unaligned accesses for ARMv7. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address comments Created 8 years, 2 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/arm/constants-arm.h ('k') | src/arm/regexp-macro-assembler-arm.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 3172 matching lines...) Expand 10 before | Expand all | Expand 10 after
3183 3183
3184 // Copy bytes in word size chunks. 3184 // Copy bytes in word size chunks.
3185 bind(&word_loop); 3185 bind(&word_loop);
3186 if (emit_debug_code()) { 3186 if (emit_debug_code()) {
3187 tst(src, Operand(kPointerSize - 1)); 3187 tst(src, Operand(kPointerSize - 1));
3188 Assert(eq, "Expecting alignment for CopyBytes"); 3188 Assert(eq, "Expecting alignment for CopyBytes");
3189 } 3189 }
3190 cmp(length, Operand(kPointerSize)); 3190 cmp(length, Operand(kPointerSize));
3191 b(lt, &byte_loop); 3191 b(lt, &byte_loop);
3192 ldr(scratch, MemOperand(src, kPointerSize, PostIndex)); 3192 ldr(scratch, MemOperand(src, kPointerSize, PostIndex));
3193 #if CAN_USE_UNALIGNED_ACCESSES 3193 if (CpuFeatures::IsSupported(UNALIGNED_ACCESSES)) {
3194 str(scratch, MemOperand(dst, kPointerSize, PostIndex)); 3194 str(scratch, MemOperand(dst, kPointerSize, PostIndex));
3195 #else 3195 } else {
3196 strb(scratch, MemOperand(dst, 1, PostIndex)); 3196 strb(scratch, MemOperand(dst, 1, PostIndex));
3197 mov(scratch, Operand(scratch, LSR, 8)); 3197 mov(scratch, Operand(scratch, LSR, 8));
3198 strb(scratch, MemOperand(dst, 1, PostIndex)); 3198 strb(scratch, MemOperand(dst, 1, PostIndex));
3199 mov(scratch, Operand(scratch, LSR, 8)); 3199 mov(scratch, Operand(scratch, LSR, 8));
3200 strb(scratch, MemOperand(dst, 1, PostIndex)); 3200 strb(scratch, MemOperand(dst, 1, PostIndex));
3201 mov(scratch, Operand(scratch, LSR, 8)); 3201 mov(scratch, Operand(scratch, LSR, 8));
3202 strb(scratch, MemOperand(dst, 1, PostIndex)); 3202 strb(scratch, MemOperand(dst, 1, PostIndex));
3203 #endif 3203 }
3204 sub(length, length, Operand(kPointerSize)); 3204 sub(length, length, Operand(kPointerSize));
3205 b(&word_loop); 3205 b(&word_loop);
3206 3206
3207 // Copy the last bytes if any left. 3207 // Copy the last bytes if any left.
3208 bind(&byte_loop); 3208 bind(&byte_loop);
3209 cmp(length, Operand(0)); 3209 cmp(length, Operand(0));
3210 b(eq, &done); 3210 b(eq, &done);
3211 bind(&byte_loop_1); 3211 bind(&byte_loop_1);
3212 ldrb(scratch, MemOperand(src, 1, PostIndex)); 3212 ldrb(scratch, MemOperand(src, 1, PostIndex));
3213 strb(scratch, MemOperand(dst, 1, PostIndex)); 3213 strb(scratch, MemOperand(dst, 1, PostIndex));
(...skipping 625 matching lines...) Expand 10 before | Expand all | Expand 10 after
3839 void CodePatcher::EmitCondition(Condition cond) { 3839 void CodePatcher::EmitCondition(Condition cond) {
3840 Instr instr = Assembler::instr_at(masm_.pc_); 3840 Instr instr = Assembler::instr_at(masm_.pc_);
3841 instr = (instr & ~kCondMask) | cond; 3841 instr = (instr & ~kCondMask) | cond;
3842 masm_.emit(instr); 3842 masm_.emit(instr);
3843 } 3843 }
3844 3844
3845 3845
3846 } } // namespace v8::internal 3846 } } // namespace v8::internal
3847 3847
3848 #endif // V8_TARGET_ARCH_ARM 3848 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/constants-arm.h ('k') | src/arm/regexp-macro-assembler-arm.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698