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

Side by Side Diff: test/mjsunit/asm/sign-extend.js

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 | « test/cctest/test-disasm-arm.cc ('k') | test/mjsunit/asm/zero-extend.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 var stdlib = this;
6 var buffer = new ArrayBuffer(64 * 1024);
7 var foreign = {}
8
9
10 var sext8 = (function Module(stdlib, foreign, heap) {
11 "use asm";
12 function sext8(i) {
13 i = i|0;
14 i = i << 24 >> 24;
15 return i|0;
16 }
17 return { sext8: sext8 };
18 })(stdlib, foreign, buffer).sext8;
19
20 assertEquals(-128, sext8(128));
21 assertEquals(-1, sext8(-1));
22 assertEquals(-1, sext8(255));
23 assertEquals(0, sext8(0));
24 assertEquals(0, sext8(256));
25 assertEquals(42, sext8(42));
26 assertEquals(127, sext8(127));
27
28
29 var sext16 = (function Module(stdlib, foreign, heap) {
30 "use asm";
31 function sext16(i) {
32 i = i|0;
33 i = i << 16 >> 16;
34 return i|0;
35 }
36 return { sext16: sext16 };
37 })(stdlib, foreign, buffer).sext16;
38
39 assertEquals(-32768, sext16(32768));
40 assertEquals(-1, sext16(-1));
41 assertEquals(-1, sext16(65535));
42 assertEquals(0, sext16(0));
43 assertEquals(0, sext16(65536));
44 assertEquals(128, sext16(128));
45 assertEquals(32767, sext16(32767));
OLDNEW
« no previous file with comments | « test/cctest/test-disasm-arm.cc ('k') | test/mjsunit/asm/zero-extend.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698