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

Side by Side Diff: src/arm/codegen-arm.cc

Issue 709123005: [arm] Recognize SXTB, SXTH, UXTB and UXTH. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 1 month 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/assembler-arm.cc ('k') | src/arm/disasm-arm.cc » ('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 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #if V8_TARGET_ARCH_ARM 7 #if V8_TARGET_ARCH_ARM
8 8
9 #include "src/arm/simulator-arm.h" 9 #include "src/arm/simulator-arm.h"
10 #include "src/codegen.h" 10 #include "src/codegen.h"
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 Register temp4 = r4; 281 Register temp4 = r4;
282 Label loop; 282 Label loop;
283 Label not_two; 283 Label not_two;
284 284
285 __ Push(lr, r4); 285 __ Push(lr, r4);
286 __ bic(temp2, chars, Operand(0x3)); 286 __ bic(temp2, chars, Operand(0x3));
287 __ add(temp2, dest, Operand(temp2, LSL, 1)); 287 __ add(temp2, dest, Operand(temp2, LSL, 1));
288 288
289 __ bind(&loop); 289 __ bind(&loop);
290 __ ldr(temp1, MemOperand(src, 4, PostIndex)); 290 __ ldr(temp1, MemOperand(src, 4, PostIndex));
291 __ uxtb16(temp3, Operand(temp1, ROR, 0)); 291 __ uxtb16(temp3, temp1);
292 __ uxtb16(temp4, Operand(temp1, ROR, 8)); 292 __ uxtb16(temp4, temp1, 8);
293 __ pkhbt(temp1, temp3, Operand(temp4, LSL, 16)); 293 __ pkhbt(temp1, temp3, Operand(temp4, LSL, 16));
294 __ str(temp1, MemOperand(dest)); 294 __ str(temp1, MemOperand(dest));
295 __ pkhtb(temp1, temp4, Operand(temp3, ASR, 16)); 295 __ pkhtb(temp1, temp4, Operand(temp3, ASR, 16));
296 __ str(temp1, MemOperand(dest, 4)); 296 __ str(temp1, MemOperand(dest, 4));
297 __ add(dest, dest, Operand(8)); 297 __ add(dest, dest, Operand(8));
298 __ cmp(dest, temp2); 298 __ cmp(dest, temp2);
299 __ b(&loop, ne); 299 __ b(&loop, ne);
300 300
301 __ mov(chars, Operand(chars, LSL, 31), SetCC); // bit0 => ne, bit1 => cs 301 __ mov(chars, Operand(chars, LSL, 31), SetCC); // bit0 => ne, bit1 => cs
302 __ b(&not_two, cc); 302 __ b(&not_two, cc);
303 __ ldrh(temp1, MemOperand(src, 2, PostIndex)); 303 __ ldrh(temp1, MemOperand(src, 2, PostIndex));
304 __ uxtb(temp3, Operand(temp1, ROR, 8)); 304 __ uxtb(temp3, temp1, 8);
305 __ mov(temp3, Operand(temp3, LSL, 16)); 305 __ mov(temp3, Operand(temp3, LSL, 16));
306 __ uxtab(temp3, temp3, Operand(temp1, ROR, 0)); 306 __ uxtab(temp3, temp3, temp1);
307 __ str(temp3, MemOperand(dest, 4, PostIndex)); 307 __ str(temp3, MemOperand(dest, 4, PostIndex));
308 __ bind(&not_two); 308 __ bind(&not_two);
309 __ ldrb(temp1, MemOperand(src), ne); 309 __ ldrb(temp1, MemOperand(src), ne);
310 __ strh(temp1, MemOperand(dest), ne); 310 __ strh(temp1, MemOperand(dest), ne);
311 __ Pop(pc, r4); 311 __ Pop(pc, r4);
312 } 312 }
313 313
314 CodeDesc desc; 314 CodeDesc desc;
315 masm.GetCode(&desc); 315 masm.GetCode(&desc);
316 316
(...skipping 625 matching lines...) Expand 10 before | Expand all | Expand 10 after
942 patcher.masm()->add(r0, pc, Operand(-8)); 942 patcher.masm()->add(r0, pc, Operand(-8));
943 patcher.masm()->ldr(pc, MemOperand(pc, -4)); 943 patcher.masm()->ldr(pc, MemOperand(pc, -4));
944 patcher.masm()->emit_code_stub_address(stub); 944 patcher.masm()->emit_code_stub_address(stub);
945 } 945 }
946 } 946 }
947 947
948 948
949 } } // namespace v8::internal 949 } } // namespace v8::internal
950 950
951 #endif // V8_TARGET_ARCH_ARM 951 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/assembler-arm.cc ('k') | src/arm/disasm-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698