Parse insertlane and extractlane instruction formats.

These instruction formats take immediate lane index operands. We store these as
u8 fields and require them to be in decimal format in the source. No hexadecimal
lane indexes are supported.
This commit is contained in:
Jakob Stoklund Olesen
2016-07-06 13:36:15 -07:00
parent f18e5fe0fa
commit 7f8479e097
3 changed files with 53 additions and 3 deletions

View File

@@ -15,6 +15,14 @@ ebb0:
; Polymorphic istruction controlled by second operand.
function select() {
ebb0(vx0: i32, vx1:i32, vx2: b1):
ebb0(vx0: i32, vx1: i32, vx2: b1):
v0 = select vx2, vx0, vx1
}
; Lane indexes.
function lanes() {
ebb0:
v0 = iconst.i32x4 2
v1 = extractlane v0, 3
v2 = insertlane v0, 1, v1
}

View File

@@ -14,3 +14,10 @@ function select() {
ebb0(vx0: i32, vx1: i32, vx2: b1):
v0 = select vx2, vx0, vx1
}
function lanes() {
ebb0:
v0 = iconst.i32x4 2
v1 = extractlane v0, 3
v2 = insertlane v0, 1, v1
}