-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Asm.js Simd.js : Fix for simd shr sequence cloberring the source reg value #941
Merged
chakrabot
merged 2 commits into
chakra-core:release/1.2
from
Krovatkin:b95_onto_r12_test
May 7, 2016
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Successfully compiled asm.js code | ||
SIMD.Int32x4(1, 2, 3, 4) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
//------------------------------------------------------------------------------------------------------- | ||
// Copyright (C) Microsoft Corporation and contributors. All rights reserved. | ||
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information. | ||
//------------------------------------------------------------------------------------------------------- | ||
|
||
|
||
function asmModule(stdlib, imports,buffer) { | ||
"use asm"; | ||
var i4 = stdlib.SIMD.Int32x4; | ||
var i4check = i4.check; | ||
var i4shiftLeftByScalar = i4.shiftLeftByScalar; | ||
var i4shiftRightByScalar = i4.shiftRightByScalar; | ||
var u4 = stdlib.SIMD.Uint32x4; | ||
var u4check = u4.check; | ||
var u4shiftLeftByScalar = u4.shiftLeftByScalar ; | ||
var u4shiftRightByScalar= u4.shiftRightByScalar ; | ||
var loopCOUNT = 3; | ||
|
||
function func1(a) | ||
{ | ||
a = i4check(a); | ||
var x = u4(0, 0, 0, 0); | ||
var y = u4(0, 0, 0, 0); | ||
var loopIndex = 0; | ||
var loopCOUNT = 3; | ||
|
||
while ( (loopIndex|0) < (loopCOUNT|0)) { | ||
x = u4shiftLeftByScalar(x, loopIndex); | ||
y = u4shiftRightByScalar(y, loopIndex); | ||
|
||
loopIndex = (loopIndex + 1) | 0; | ||
} | ||
return i4check(a); | ||
} | ||
return {func1:func1}; | ||
} | ||
|
||
var buffer = new ArrayBuffer(0x10000); | ||
var m = asmModule(this, {}, buffer); | ||
|
||
var v = SIMD.Int32x4(1, 2, 3, 4 ); | ||
|
||
var ret1 = m.func1(v); | ||
print(ret1); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Successfully compiled asm.js code | ||
255 | ||
255 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
//------------------------------------------------------------------------------------------------------- | ||
// Copyright (C) Microsoft Corporation and contributors. All rights reserved. | ||
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information. | ||
//------------------------------------------------------------------------------------------------------- | ||
|
||
function asmModule(stdlib, imports) { | ||
"use asm"; | ||
|
||
var i16 = stdlib.SIMD.Int8x16; | ||
var i16c = i16.check; | ||
var i4 = stdlib.SIMD.Int32x4; | ||
var i16shiftRightByScalar = i16.shiftRightByScalar; | ||
var i16add = i16.add; | ||
var i4extractLane = i4.extractLane; | ||
|
||
function f2(a) | ||
{ | ||
a = i16c(a); | ||
return a; | ||
} | ||
|
||
function testShiftLeftScalarLocal() | ||
{ | ||
var a = i16(255, 40, -40, 40, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); | ||
var b = i4(255,0,0,0); | ||
var i = 0; | ||
i = i4extractLane (b, 0); | ||
a = i16shiftRightByScalar(a, i >>> 0); | ||
a = i16c(f2(a)); | ||
return i|0; | ||
} | ||
|
||
return { | ||
testShiftLeftScalarLocal: testShiftLeftScalarLocal }; | ||
} | ||
|
||
var m = asmModule(this, {}); | ||
|
||
print (m.testShiftLeftScalarLocal()); | ||
print (m.testShiftLeftScalarLocal()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this conflict with #934?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see how. We are relaxing the shift amount type from Unsigned to Int. #934 allows coercion of SIMD return types.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah you're right, was misreading that as the ret type!