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

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

Issue 23480027: ARM: Add tests for CopyBytes. (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: bug fix for debug Created 7 years, 3 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
« no previous file with comments | « no previous file | test/cctest/cctest.gyp » ('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 3173 matching lines...) Expand 10 before | Expand all | Expand 10 after
3184 vstr(double_scratch.low(), 3184 vstr(double_scratch.low(),
3185 FieldMemOperand(dst, (field_count - 1) * kPointerSize)); 3185 FieldMemOperand(dst, (field_count - 1) * kPointerSize));
3186 } 3186 }
3187 } 3187 }
3188 3188
3189 3189
3190 void MacroAssembler::CopyBytes(Register src, 3190 void MacroAssembler::CopyBytes(Register src,
3191 Register dst, 3191 Register dst,
3192 Register length, 3192 Register length,
3193 Register scratch) { 3193 Register scratch) {
3194 Label align_loop, align_loop_1, word_loop, byte_loop, byte_loop_1, done; 3194 Label align_loop_1, word_loop, byte_loop, byte_loop_1, done;
3195 3195
3196 // Align src before copying in word size chunks. 3196 // Align src before copying in word size chunks.
3197 bind(&align_loop); 3197 cmp(length, Operand(kPointerSize));
3198 cmp(length, Operand::Zero()); 3198 b(le, &byte_loop);
3199 b(eq, &done); 3199
3200 bind(&align_loop_1); 3200 bind(&align_loop_1);
3201 tst(src, Operand(kPointerSize - 1)); 3201 tst(src, Operand(kPointerSize - 1));
3202 b(eq, &word_loop); 3202 b(eq, &word_loop);
3203 ldrb(scratch, MemOperand(src, 1, PostIndex)); 3203 ldrb(scratch, MemOperand(src, 1, PostIndex));
3204 strb(scratch, MemOperand(dst, 1, PostIndex)); 3204 strb(scratch, MemOperand(dst, 1, PostIndex));
3205 sub(length, length, Operand(1), SetCC); 3205 sub(length, length, Operand(1), SetCC);
3206 b(ne, &byte_loop_1); 3206 b(ne, &align_loop_1);
3207
3208 // Copy bytes in word size chunks. 3207 // Copy bytes in word size chunks.
3209 bind(&word_loop); 3208 bind(&word_loop);
3210 if (emit_debug_code()) { 3209 if (emit_debug_code()) {
3211 tst(src, Operand(kPointerSize - 1)); 3210 tst(src, Operand(kPointerSize - 1));
3212 Assert(eq, kExpectingAlignmentForCopyBytes); 3211 Assert(eq, kExpectingAlignmentForCopyBytes);
3213 } 3212 }
3214 cmp(length, Operand(kPointerSize)); 3213 cmp(length, Operand(kPointerSize));
3215 b(lt, &byte_loop); 3214 b(lt, &byte_loop);
3216 ldr(scratch, MemOperand(src, kPointerSize, PostIndex)); 3215 ldr(scratch, MemOperand(src, kPointerSize, PostIndex));
3217 if (CpuFeatures::IsSupported(UNALIGNED_ACCESSES)) { 3216 if (CpuFeatures::IsSupported(UNALIGNED_ACCESSES)) {
(...skipping 661 matching lines...) Expand 10 before | Expand all | Expand 10 after
3879 void CodePatcher::EmitCondition(Condition cond) { 3878 void CodePatcher::EmitCondition(Condition cond) {
3880 Instr instr = Assembler::instr_at(masm_.pc_); 3879 Instr instr = Assembler::instr_at(masm_.pc_);
3881 instr = (instr & ~kCondMask) | cond; 3880 instr = (instr & ~kCondMask) | cond;
3882 masm_.emit(instr); 3881 masm_.emit(instr);
3883 } 3882 }
3884 3883
3885 3884
3886 } } // namespace v8::internal 3885 } } // namespace v8::internal
3887 3886
3888 #endif // V8_TARGET_ARCH_ARM 3887 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | test/cctest/cctest.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698