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

Side by Side Diff: test/mjsunit/asm/float32array-negative-offset.js

Issue 733893008: [x64] Fix optimization for certain checked load/stores. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 6 years 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
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 m = (function Module(stdlib, foreign, heap) {
11 "use asm";
12 var MEM32 = new stdlib.Float32Array(heap);
13 function load(i) {
14 i = i|0;
15 i = +MEM32[i >> 2];
16 return i;
17 }
18 function store(i, v) {
19 i = i|0;
20 v = +v;
21 MEM32[i >> 2] = v;
22 }
23 function load8(i) {
24 i = i|0;
25 i = +MEM32[i + 8 >> 2];
26 return i;
27 }
28 function store8(i, v) {
29 i = i|0;
30 v = +v;
31 MEM32[i + 8 >> 2] = v;
32 }
33 return { load: load, store: store, load8: load8, store8: store8 };
34 })(stdlib, foreign, buffer);
35
36 assertEquals(NaN, m.load(-8));
37 assertEquals(NaN, m.load8(-16));
38 m.store(0, 42.0);
39 assertEquals(42.0, m.load8(-8));
40 m.store8(-8, 99.0);
41 assertEquals(99.0, m.load(0));
42 assertEquals(99.0, m.load8(-8));
OLDNEW
« no previous file with comments | « src/compiler/x64/instruction-selector-x64.cc ('k') | test/mjsunit/asm/float64array-negative-offset.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698