Skip to content

Instantly share code, notes, and snippets.

@nemequ
Last active June 19, 2021 03:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nemequ/356f7356b1373bea2d58bdd3e69769b6 to your computer and use it in GitHub Desktop.
Save nemequ/356f7356b1373bea2d58bdd3e69769b6 to your computer and use it in GitHub Desktop.
{
"const": {
"title": "Constant",
"description": "Materialize a constant `v128` SIMD value from the 16 immediate bytes in the immediate mode operand `imm`. The `v128.const` instruction is encoded with 16 immediate bytes which provide the bits of the vector directly.",
"instructions": [
{
"name": "v128.const",
"opcode": 12,
"return": "v128",
"params": [
{
"name": "imm",
"type": "ImmByte[16]"
}
],
"intrin": [
{
"name": "wasm_i8x16_const",
"return": "v128_t",
"params": [
{
"type": "int8_t",
"name": "__c0",
"map": "imm[0]"
},
{
"type": "int8_t",
"name": "__c1",
"map": "imm[1]"
},
{
"type": "int8_t",
"name": "__c2",
"map": "imm[2]"
},
{
"type": "int8_t",
"name": "__c3",
"map": "imm[3]"
},
{
"type": "int8_t",
"name": "__c4",
"map": "imm[4]"
},
{
"type": "int8_t",
"name": "__c5",
"map": "imm[5]"
},
{
"type": "int8_t",
"name": "__c6",
"map": "imm[6]"
},
{
"type": "int8_t",
"name": "__c7",
"map": "imm[7]"
},
{
"type": "int8_t",
"name": "__c8",
"map": "imm[8]"
},
{
"type": "int8_t",
"name": "__c9",
"map": "imm[9]"
},
{
"type": "int8_t",
"name": "__c10",
"map": "imm[10]"
},
{
"type": "int8_t",
"name": "__c11",
"map": "imm[11]"
},
{
"type": "int8_t",
"name": "__c12",
"map": "imm[12]"
},
{
"type": "int8_t",
"name": "__c13",
"map": "imm[13]"
},
{
"type": "int8_t",
"name": "__c14",
"map": "imm[14]"
},
{
"type": "int8_t",
"name": "__c15",
"map": "imm[15]"
}
]
},
{
"name": "wasm_i16x8_const",
"return": "v128_t",
"params": [
{
"type": "int16_t",
"name": "__c0",
"map": "imm[0:1]"
},
{
"type": "int16_t",
"name": "__c1",
"map": "imm[2:3]"
},
{
"type": "int16_t",
"name": "__c2",
"map": "imm[4:5]"
},
{
"type": "int16_t",
"name": "__c3",
"map": "imm[6:7]"
},
{
"type": "int16_t",
"name": "__c4",
"map": "imm[8:9]"
},
{
"type": "int16_t",
"name": "__c5",
"map": "imm[10:11]"
},
{
"type": "int16_t",
"name": "__c6",
"map": "imm[12:13]"
},
{
"type": "int16_t",
"name": "__c7",
"map": "imm[14:15]"
}
]
},
{
"name": "wasm_i32x4_const",
"return": "v128_t",
"params": [
{
"type": "int32_t",
"name": "__c0",
"map": "imm[0:3]"
},
{
"type": "int32_t",
"name": "__c1",
"map": "imm[4:7]"
},
{
"type": "int32_t",
"name": "__c2",
"map": "imm[8:11]"
},
{
"type": "int32_t",
"name": "__c3",
"map": "imm[12:15]"
}
]
},
{
"name": "wasm_i64x2_const",
"return": "v128_t",
"params": [
{
"type": "int64_t",
"name": "__c0",
"map": "imm[0:7]"
},
{
"type": "int64_t",
"name": "__c1",
"map": "imm[8:15]"
}
]
},
{
"name": "wasm_f32x4_const",
"return": "v128_t",
"params": [
{
"type": "float",
"name": "__c0",
"map": "imm[0:3]"
},
{
"type": "float",
"name": "__c1",
"map": "imm[4:7]"
},
{
"type": "float",
"name": "__c2",
"map": "imm[8:11]"
},
{
"type": "float",
"name": "__c3",
"map": "imm[12:15]"
}
]
},
{
"name": "wasm_f64x2_const",
"return": "v128_t",
"params": [
{
"type": "double",
"name": "__c0",
"map": "imm[0:7]"
},
{
"type": "double",
"name": "__c1",
"map": "imm[8:15]"
}
]
}
],
"wav": [
{
"name": "wav_i8x16_const",
"alias": [
"wav_const"
],
"return": "wav_8x16_t",
"params": [
{
"type": "int8_t",
"name": "c0",
"map": "imm[0]"
},
{
"type": "int8_t",
"name": "c1",
"map": "imm[1]"
},
{
"type": "int8_t",
"name": "c2",
"map": "imm[2]"
},
{
"type": "int8_t",
"name": "c3",
"map": "imm[3]"
},
{
"type": "int8_t",
"name": "c4",
"map": "imm[4]"
},
{
"type": "int8_t",
"name": "c5",
"map": "imm[5]"
},
{
"type": "int8_t",
"name": "c6",
"map": "imm[6]"
},
{
"type": "int8_t",
"name": "c7",
"map": "imm[7]"
},
{
"type": "int8_t",
"name": "c8",
"map": "imm[8]"
},
{
"type": "int8_t",
"name": "c9",
"map": "imm[9]"
},
{
"type": "int8_t",
"name": "c10",
"map": "imm[10]"
},
{
"type": "int8_t",
"name": "c11",
"map": "imm[11]"
},
{
"type": "int8_t",
"name": "c12",
"map": "imm[12]"
},
{
"type": "int8_t",
"name": "c13",
"map": "imm[13]"
},
{
"type": "int8_t",
"name": "c14",
"map": "imm[14]"
},
{
"type": "int8_t",
"name": "c15",
"map": "imm[15]"
}
]
},
{
"name": "wav_i16x8_const",
"alias": [
"wav_const"
],
"return": "wav_16x8_t",
"params": [
{
"type": "int16_t",
"name": "c0",
"map": "imm[0:1]"
},
{
"type": "int16_t",
"name": "c1",
"map": "imm[2:3]"
},
{
"type": "int16_t",
"name": "c2",
"map": "imm[4:5]"
},
{
"type": "int16_t",
"name": "c3",
"map": "imm[6:7]"
},
{
"type": "int16_t",
"name": "c4",
"map": "imm[8:9]"
},
{
"type": "int16_t",
"name": "c5",
"map": "imm[10:11]"
},
{
"type": "int16_t",
"name": "c6",
"map": "imm[12:13]"
},
{
"type": "int16_t",
"name": "c7",
"map": "imm[14:15]"
}
]
},
{
"name": "wav_i32x4_const",
"alias": [
"wav_const"
],
"return": "wav_32x4_t",
"params": [
{
"type": "int32_t",
"name": "c0",
"map": "imm[0:3]"
},
{
"type": "int32_t",
"name": "c1",
"map": "imm[4:7]"
},
{
"type": "int32_t",
"name": "c2",
"map": "imm[8:11]"
},
{
"type": "int32_t",
"name": "c3",
"map": "imm[12:15]"
}
]
},
{
"name": "wav_i64x2_const",
"alias": [
"wav_const"
],
"return": "wav_64x2_t",
"params": [
{
"type": "int64_t",
"name": "c0",
"map": "imm[0:7]"
},
{
"type": "int64_t",
"name": "c1",
"map": "imm[8:15]"
}
]
},
{
"name": "wav_u8x16_const",
"alias": [
"wav_const"
],
"return": "wav_8x16_t",
"params": [
{
"type": "uint8_t",
"name": "c0",
"map": "imm[0]"
},
{
"type": "uint8_t",
"name": "c1",
"map": "imm[1]"
},
{
"type": "uint8_t",
"name": "c2",
"map": "imm[2]"
},
{
"type": "uint8_t",
"name": "c3",
"map": "imm[3]"
},
{
"type": "uint8_t",
"name": "c4",
"map": "imm[4]"
},
{
"type": "uint8_t",
"name": "c5",
"map": "imm[5]"
},
{
"type": "uint8_t",
"name": "c6",
"map": "imm[6]"
},
{
"type": "uint8_t",
"name": "c7",
"map": "imm[7]"
},
{
"type": "uint8_t",
"name": "c8",
"map": "imm[8]"
},
{
"type": "uint8_t",
"name": "c9",
"map": "imm[9]"
},
{
"type": "uint8_t",
"name": "c10",
"map": "imm[10]"
},
{
"type": "uint8_t",
"name": "c11",
"map": "imm[11]"
},
{
"type": "uint8_t",
"name": "c12",
"map": "imm[12]"
},
{
"type": "uint8_t",
"name": "c13",
"map": "imm[13]"
},
{
"type": "uint8_t",
"name": "c14",
"map": "imm[14]"
},
{
"type": "uint8_t",
"name": "c15",
"map": "imm[15]"
}
]
},
{
"name": "wav_u16x8_const",
"alias": [
"wav_const"
],
"return": "wav_16x8_t",
"params": [
{
"type": "uint16_t",
"name": "c0",
"map": "imm[0:1]"
},
{
"type": "uint16_t",
"name": "c1",
"map": "imm[2:3]"
},
{
"type": "uint16_t",
"name": "c2",
"map": "imm[4:5]"
},
{
"type": "uint16_t",
"name": "c3",
"map": "imm[6:7]"
},
{
"type": "uint16_t",
"name": "c4",
"map": "imm[8:9]"
},
{
"type": "uint16_t",
"name": "c5",
"map": "imm[10:11]"
},
{
"type": "uint16_t",
"name": "c6",
"map": "imm[12:13]"
},
{
"type": "uint16_t",
"name": "c7",
"map": "imm[14:15]"
}
]
},
{
"name": "wav_u32x4_const",
"alias": [
"wav_const"
],
"return": "wav_32x4_t",
"params": [
{
"type": "uint32_t",
"name": "c0",
"map": "imm[0:3]"
},
{
"type": "uint32_t",
"name": "c1",
"map": "imm[4:7]"
},
{
"type": "uint32_t",
"name": "c2",
"map": "imm[8:11]"
},
{
"type": "uint32_t",
"name": "c3",
"map": "imm[12:15]"
}
]
},
{
"name": "wav_u64x2_const",
"alias": [
"wav_const"
],
"return": "wav_64x2_t",
"params": [
{
"type": "uint64_t",
"name": "c0",
"map": "imm[0:7]"
},
{
"type": "uint64_t",
"name": "c1",
"map": "imm[8:15]"
}
]
},
{
"name": "wav_f32x4_const",
"alias": [
"wav_const"
],
"return": "wav_32x4_t",
"params": [
{
"type": "float",
"name": "c0",
"map": "imm[0:3]"
},
{
"type": "float",
"name": "c1",
"map": "imm[4:7]"
},
{
"type": "float",
"name": "c2",
"map": "imm[8:11]"
},
{
"type": "float",
"name": "c3",
"map": "imm[12:15]"
}
]
},
{
"name": "wav_f64x2_const",
"alias": [
"wav_const"
],
"return": "wav_64x2_t",
"params": [
{
"type": "double",
"name": "c0",
"map": "imm[0:7]"
},
{
"type": "double",
"name": "c1",
"map": "imm[8:15]"
}
]
}
],
"lowering": [
{
"option": "base",
"implementations": [
{
"instructions": [
{
"name": "movaps",
"latency": 6,
"uops": 1,
"arguments": [
".LCPI0_0(%rip)",
"%xmm0"
]
}
]
}
]
},
{
"option": "AVX",
"implementations": [
{
"instructions": [
{
"name": "vmovaps",
"latency": 6,
"uops": 1,
"arguments": [
".LCPI0_0(%rip)",
"%xmm0"
]
}
]
}
]
},
{
"option": "armv8-a",
"implementations": [
{
"instructions": [
{
"name": "adrp",
"latency": 1,
"uops": 1,
"arguments": [
"x8",
".LCPI0_0"
]
},
{
"name": "ldr",
"latency": 4,
"uops": 1,
"arguments": [
"q0",
"[x8",
":lo12:.LCPI0_0]"
]
}
]
}
]
}
]
}
]
},
"splat": {
"title": "Create vector with identical lanes",
"description": "Construct a vector with x replicated to all lanes.",
"operation": "def S.splat(x):\n result = S.New()\n for i in range(S.Lanes):\n result[i] = S.Reduce(x)\n return result\n",
"instructions": [
{
"name": "i8x16.splat",
"opcode": 15,
"return": "v128",
"params": [
{
"name": "x",
"type": "i32"
}
],
"intrin": [
{
"name": "wasm_i8x16_splat",
"return": "v128_t",
"params": [
{
"type": "int8_t",
"name": "__a",
"map": "x"
}
]
}
],
"wav": [
{
"name": "wav_i8x16_splat",
"alias": [
"wav_splat"
],
"return": "wav_i8x16_t",
"params": [
{
"type": "int8_t",
"name": "value",
"map": "x"
}
]
},
{
"name": "wav_u8x16_splat",
"alias": [
"wav_splat"
],
"return": "wav_u8x16_t",
"params": [
{
"type": "uint8_t",
"name": "value",
"map": "x"
}
]
}
],
"lowering": [
{
"option": "base",
"implementations": [
{
"instructions": [
{
"name": "movd",
"latency": 1,
"uops": 1,
"arguments": [
"%edi",
"%xmm0"
]
},
{
"name": "punpcklbw",
"latency": 1,
"uops": 1,
"arguments": [
"%xmm0",
"%xmm0"
]
},
{
"name": "pshuflw",
"latency": 1,
"uops": 1,
"arguments": [
"$0",
"%xmm0",
"%xmm0"
]
},
{
"name": "pshufd",
"latency": 1,
"uops": 1,
"arguments": [
"$0",
"%xmm0",
"%xmm0"
]
}
]
}
]
},
{
"option": "SSSE3",
"implementations": [
{
"instructions": [
{
"name": "movd",
"latency": 1,
"uops": 1,
"arguments": [
"%edi",
"%xmm0"
]
},
{
"name": "pxor",
"latency": 0,
"uops": 1,
"arguments": [
"%xmm1",
"%xmm1"
]
},
{
"name": "pshufb",
"latency": 1,
"uops": 1,
"arguments": [
"%xmm1",
"%xmm0"
]
}
]
}
]
},
{
"option": "AVX",
"implementations": [
{
"instructions": [
{
"name": "vmovd",
"latency": 1,
"uops": 1,
"arguments": [
"%edi",
"%xmm0"
]
},
{
"name": "vpxor",
"latency": 0,
"uops": 1,
"arguments": [
"%xmm1",
"%xmm1",
"%xmm1"
]
},
{
"name": "vpshufb",
"latency": 1,
"uops": 1,
"arguments": [
"%xmm1",
"%xmm0",
"%xmm0"
]
}
]
}
]
},
{
"option": "AVX2",
"implementations": [
{
"instructions": [
{
"name": "vmovd",
"latency": 1,
"uops": 1,
"arguments": [
"%edi",
"%xmm0"
]
},
{
"name": "vpbroadcastb",
"latency": 3,
"uops": 1,
"arguments": [
"%xmm0",
"%xmm0"
]
}
]
}
]
},
{
"option": "AVX-512BW+AVX-512VL",
"implementations": [
{
"instructions": [
{
"name": "vpbroadcastb",
"latency": 1,
"uops": 1,
"arguments": [
"%edi",
"%xmm0"
]
}
]
}
]
},
{
"option": "armv8-a",
"implementations": [
{
"instructions": [
{
"name": "dup",
"latency": 7,
"uops": 2,
"arguments": [
"v0.16b",
"w0"
]
}
]
}
]
}
]
},
{
"name": "i16x8.splat",
"opcode": 16,
"return": "v128",
"params": [
{
"name": "x",
"type": "i32"
}
],
"intrin": [
{
"name": "wasm_i16x8_splat",
"return": "v128_t",
"params": [
{
"type": "int16_t",
"name": "__a",
"map": "x"
}
]
}
],
"wav": [
{
"name": "wav_i16x8_splat",
"alias": [
"wav_splat"
],
"return": "wav_i16x8_t",
"params": [
{
"type": "int16_t",
"name": "value"
}
]
},
{
"name": "wav_u16x8_splat",
"alias": [
"wav_splat"
],
"return": "wav_u16x8_t",
"params": [
{
"type": "uint16_t",
"name": "value"
}
]
}
],
"lowering": [
{
"option": "base",
"implementations": [
{
"instructions": [
{
"name": "movd",
"latency": 1,
"uops": 1,
"arguments": [
"%edi",
"%xmm0"
]
},
{
"name": "pshuflw",
"latency": 1,
"uops": 1,
"arguments": [
"$0",
"%xmm0",
"%xmm0"
]
},
{
"name": "pshufd",
"latency": 1,
"uops": 1,
"arguments": [
"$0",
"%xmm0",
"%xmm0"
]
}
]
}
]
},
{
"option": "AVX",
"implementations": [
{
"instructions": [
{
"name": "vmovd",
"latency": 1,
"uops": 1,
"arguments": [
"%edi",
"%xmm0"
]
},
{
"name": "vpshuflw",
"latency": 1,
"uops": 1,
"arguments": [
"$0",
"%xmm0",
"%xmm0"
]
},
{
"name": "vpshufd",
"latency": 1,
"uops": 1,
"arguments": [
"$0",
"%xmm0",
"%xmm0"
]
}
]
}
]
},
{
"option": "AVX2",
"implementations": [
{
"instructions": [
{
"name": "vmovd",
"latency": 1,
"uops": 1,
"arguments": [
"%edi",
"%xmm0"
]
},
{
"name": "vpbroadcastw",
"latency": 3,
"uops": 1,
"arguments": [
"%xmm0",
"%xmm0"
]
}
]
}
]
},
{
"option": "AVX-512BW+AVX-512VL",
"implementations": [
{
"instructions": [
{
"name": "vpbroadcastw",
"latency": 1,
"uops": 1,
"arguments": [
"%edi",
"%xmm0"
]
}
]
}
]
},
{
"option": "armv8-a",
"implementations": [
{
"instructions": [
{
"name": "dup",
"latency": 7,
"uops": 2,
"arguments": [
"v0.8h",
"w0"
]
}
]
}
]
}
]
},
{
"name": "i32x4.splat",
"opcode": 17,
"return": "v128",
"params": [
{
"name": "x",
"type": "i32"
}
],
"intrin": [
{
"name": "wasm_i32x4_splat",
"return": "v128_t",
"params": [
{
"type": "int32_t",
"name": "__a",
"map": "x"
}
]
}
],
"wav": [
{
"name": "wav_i32x4_splat",
"alias": [
"wav_splat"
],
"return": "wav_i32x4_t",
"params": [
{
"type": "int32_t",
"name": "value"
}
]
},
{
"name": "wav_u32x4_splat",
"alias": [
"wav_splat"
],
"return": "wav_u32x4_t",
"params": [
{
"type": "uint32_t",
"name": "value"
}
]
}
],
"lowering": [
{
"option": "base",
"implementations": [
{
"instructions": [
{
"name": "movd",
"latency": 1,
"uops": 1,
"arguments": [
"%edi",
"%xmm0"
]
},
{
"name": "pshufd",
"latency": 1,
"uops": 1,
"arguments": [
"$0",
"%xmm0",
"%xmm0"
]
}
]
}
]
},
{
"option": "AVX",
"implementations": [
{
"instructions": [
{
"name": "vmovd",
"latency": 1,
"uops": 1,
"arguments": [
"%edi",
"%xmm0"
]
},
{
"name": "vpshufd",
"latency": 1,
"uops": 1,
"arguments": [
"$0",
"%xmm0",
"%xmm0"
]
}
]
}
]
},
{
"option": "AVX2",
"implementations": [
{
"instructions": [
{
"name": "vmovd",
"latency": 1,
"uops": 1,
"arguments": [
"%edi",
"%xmm0"
]
},
{
"name": "vpbroadcastd",
"latency": 1,
"uops": 1,
"arguments": [
"%xmm0",
"%xmm0"
]
}
]
}
]
},
{
"option": "AVX-512VL",
"implementations": [
{
"instructions": [
{
"name": "vpbroadcastd",
"latency": 1,
"uops": 1,
"arguments": [
"%edi",
"%xmm0"
]
}
]
}
]
},
{
"option": "armv8-a",
"implementations": [
{
"instructions": [
{
"name": "dup",
"latency": 7,
"uops": 2,
"arguments": [
"v0.4s",
"w0"
]
}
]
}
]
}
]
},
{
"name": "i64x2.splat",
"opcode": 18,
"return": "v128",
"params": [
{
"name": "x",
"type": "i64"
}
],
"intrin": [
{
"name": "wasm_i64x2_splat",
"return": "v128_t",
"params": [
{
"type": "int64_t",
"name": "__a",
"map": "x"
}
]
}
],
"wav": [
{
"name": "wav_i64x2_splat",
"alias": [
"wav_splat"
],
"return": "wav_i64x2_t",
"params": [
{
"type": "int64_t",
"name": "value",
"map": "x"
}
]
},
{
"name": "wav_u64x2_splat",
"alias": [
"wav_splat"
],
"return": "wav_u64x2_t",
"params": [
{
"type": "uint64_t",
"name": "value",
"map": "x"
}
]
}
],
"lowering": [
{
"option": "base",
"implementations": [
{
"instructions": [
{
"name": "movq",
"latency": 1,
"uops": 1,
"arguments": [
"%rdi",
"%xmm0"
]
},
{
"name": "pshufd",
"latency": 1,
"uops": 1,
"arguments": [
"$68",
"%xmm0",
"%xmm0"
]
}
]
}
]
},
{
"option": "AVX",
"implementations": [
{
"instructions": [
{
"name": "vmovq",
"latency": 1,
"uops": 1,
"arguments": [
"%rdi",
"%xmm0"
]
},
{
"name": "vpshufd",
"latency": 1,
"uops": 1,
"arguments": [
"$68",
"%xmm0",
"%xmm0"
]
}
]
}
]
},
{
"option": "AVX2",
"implementations": [
{
"instructions": [
{
"name": "vmovq",
"latency": 1,
"uops": 1,
"arguments": [
"%rdi",
"%xmm0"
]
},
{
"name": "vpbroadcastq",
"latency": 1,
"uops": 1,
"arguments": [
"%xmm0",
"%xmm0"
]
}
]
}
]
},
{
"option": "AVX-512VL",
"implementations": [
{
"instructions": [
{
"name": "vpbroadcastq",
"latency": 1,
"uops": 1,
"arguments": [
"%rdi",
"%xmm0"
]
}
]
}
]
},
{
"option": "armv8-a",
"implementations": [
{
"instructions": [
{
"name": "dup",
"latency": 7,
"uops": 2,
"arguments": [
"v0.2d",
"x0"
]
}
]
}
]
}
]
},
{
"name": "f32x4.splat",
"opcode": 19,
"return": "v128",
"params": [
{
"name": "x",
"type": "f32"
}
],
"intrin": [
{
"name": "wasm_f32x4_splat",
"return": "v128_t",
"params": [
{
"type": "float",
"name": "__a",
"map": "x"
}
]
}
],
"wav": [
{
"name": "wav_f32x4_splat",
"alias": [
"wav_splat"
],
"return": "wav_f32x4_t",
"params": [
{
"type": "float",
"name": "value"
}
]
}
],
"lowering": [
{
"option": "base",
"implementations": [
{
"instructions": [
{
"name": "shufps",
"latency": 1,
"uops": 1,
"arguments": [
"$0",
"%xmm0",
"%xmm0"
]
}
]
}
]
},
{
"option": "AVX",
"implementations": [
{
"instructions": [
{
"name": "vpermilps",
"latency": 1,
"uops": 1,
"arguments": [
"$0",
"%xmm0",
"%xmm0"
]
}
]
}
]
},
{
"option": "AVX2",
"implementations": [
{
"instructions": [
{
"name": "vbroadcastss",
"latency": 1,
"uops": 1,
"arguments": [
"%xmm0",
"%xmm0"
]
}
]
}
]
},
{
"option": "armv8-a",
"implementations": [
{
"instructions": [
{
"name": "dup",
"latency": 7,
"uops": 2,
"arguments": [
"v0.4s",
"v0.s[0]"
]
}
]
}
]
}
]
},
{
"name": "f64x2.splat",
"opcode": 20,
"return": "v128",
"params": [
{
"name": "x",
"type": "f64"
}
],
"intrin": [
{
"name": "wasm_f64x2_splat",
"return": "v128_t",
"params": [
{
"type": "double",
"name": "__a",
"map": "x"
}
]
}
],
"wav": [
{
"name": "wav_f64x2_splat",
"alias": [
"wav_splat"
],
"return": "wav_f64x2_t",
"params": [
{
"type": "double",
"name": "value",
"map": "x"
}
]
}
],
"lowering": [
{
"option": "base",
"implementations": [
{
"instructions": [
{
"name": "movlhps",
"latency": 1,
"uops": 1,
"arguments": [
"%xmm0",
"%xmm0"
]
}
]
}
]
},
{
"option": "SSE3",
"implementations": [
{
"instructions": [
{
"name": "movddup",
"latency": 1,
"uops": 1,
"arguments": [
"%xmm0",
"%xmm0"
]
}
]
}
]
},
{
"option": "AVX",
"implementations": [
{
"instructions": [
{
"name": "vmovddup",
"latency": 1,
"uops": 1,
"arguments": [
"%xmm0",
"%xmm0"
]
}
]
}
]
},
{
"option": "armv8-a",
"implementations": [
{
"instructions": [
{
"name": "dup",
"latency": 7,
"uops": 2,
"arguments": [
"v0.2d",
"v0.d[0]"
]
}
]
}
]
}
]
}
]
},
"load": {
"title": "Load",
"description": "Load a `v128` vector from the given heap address.",
"operation": "def S.load(memarg):\n return S.from_bytes(memory[memarg.offset:memarg.offset + 16])\n",
"instructions": [
{
"name": "v128.load",
"opcode": 0,
"return": "v128",
"params": [
{
"name": "memarg",
"type": "*"
}
],
"intrin": [
{
"name": "wasm_v128_load",
"return": "v128_t",
"params": [
{
"name": "__mem",
"type": "const void *",
"map": "memarg",
"alignment": 1
}
]
}
],
"wav": [
{
"name": "wav_i8x16_load",
"return": "wav_i8x16_t",
"alias": [
"wav_load"
],
"params": [
{
"name": "src",
"type": "int8_t[16]",
"map": "memarg"
}
]
},
{
"name": "wav_i16x8_load",
"return": "wav_i16x8_t",
"alias": [
"wav_load"
],
"params": [
{
"name": "src",
"type": "int16_t[8]",
"map": "memarg"
}
]
},
{
"name": "wav_i32x4_load",
"return": "wav_i32x4_t",
"alias": [
"wav_load"
],
"params": [
{
"name": "src",
"type": "int32_t[4]",
"map": "memarg"
}
]
},
{
"name": "wav_i64x2_load",
"return": "wav_i64x2_t",
"alias": [
"wav_load"
],
"params": [
{
"name": "src",
"type": "int64_t[2]",
"map": "memarg"
}
]
},
{
"name": "wav_u8x16_load",
"return": "wav_u8x16_t",
"alias": [
"wav_load"
],
"params": [
{
"name": "src",
"type": "uint8_t[16]",
"map": "memarg"
}
]
},
{
"name": "wav_u16x8_load",
"return": "wav_u16x8_t",
"alias": [
"wav_load"
],
"params": [
{
"name": "src",
"type": "uint16_t[8]",
"map": "memarg"
}
]
},
{
"name": "wav_u32x4_load",
"return": "wav_u32x4_t",
"alias": [
"wav_load"
],
"params": [
{
"name": "src",
"type": "uint32_t[4]",
"map": "memarg"
}
]
},
{
"name": "wav_i64x2_load",
"return": "wav_i64x2_t",
"alias": [
"wav_load"
],
"params": [
{
"name": "src",
"type": "int64_t[2]",
"map": "memarg"
}
]
},
{
"name": "wav_f32x4_load",
"return": "wav_f32x4_t",
"alias": [
"wav_load"
],
"params": [
{
"name": "src",
"type": "float[4]",
"map": "memarg"
}
]
},
{
"name": "wav_f64x2_load",
"return": "wav_f64x2_t",
"alias": [
"wav_load"
],
"params": [
{
"name": "src",
"type": "double[2]",
"map": "memarg"
}
]
},
{
"name": "wav_i8x16_loada",
"return": "wav_i8x16_t",
"alias": [
"wav_loada"
],
"params": [
{
"name": "src",
"type": "int8_t[16]",
"map": "memarg",
"alignment": 16
}
]
},
{
"name": "wav_i16x8_loada",
"return": "wav_i16x8_t",
"alias": [
"wav_loada"
],
"params": [
{
"name": "src",
"type": "int16_t[8]",
"map": "memarg",
"alignment": 16
}
]
},
{
"name": "wav_i32x4_loada",
"return": "wav_i32x4_t",
"alias": [
"wav_loada"
],
"params": [
{
"name": "src",
"type": "int32_t[4]",
"map": "memarg",
"alignment": 16
}
]
},
{
"name": "wav_i64x2_loada",
"return": "wav_i64x2_t",
"alias": [
"wav_loada"
],
"params": [
{
"name": "src",
"type": "int64_t[2]",
"map": "memarg",
"alignment": 16
}
]
},
{
"name": "wav_u8x16_loada",
"return": "wav_u8x16_t",
"alias": [
"wav_loada"
],
"params": [
{
"name": "src",
"type": "uint8_t[16]",
"map": "memarg",
"alignment": 16
}
]
},
{
"name": "wav_u16x8_loada",
"return": "wav_u16x8_t",
"alias": [
"wav_loada"
],
"params": [
{
"name": "src",
"type": "uint16_t[8]",
"map": "memarg",
"alignment": 16
}
]
},
{
"name": "wav_u32x4_loada",
"return": "wav_u32x4_t",
"alias": [
"wav_loada"
],
"params": [
{
"name": "src",
"type": "uint32_t[4]",
"map": "memarg",
"alignment": 16
}
]
},
{
"name": "wav_i64x2_loada",
"return": "wav_i64x2_t",
"alias": [
"wav_loada"
],
"params": [
{
"name": "src",
"type": "int64_t[2]",
"map": "memarg",
"alignment": 16
}
]
},
{
"name": "wav_f32x4_loada",
"return": "wav_f32x4_t",
"alias": [
"wav_loada"
],
"params": [
{
"name": "src",
"type": "float[4]",
"map": "memarg",
"alignment": 16
}
]
},
{
"name": "wav_f64x2_loada",
"return": "wav_f64x2_t",
"alias": [
"wav_loada"
],
"params": [
{
"name": "src",
"type": "double[2]",
"map": "memarg",
"alignment": 16
}
]
},
{
"name": "wav_i8x16_loadu",
"return": "wav_i8x16_t",
"alias": [
"wav_loadu"
],
"params": [
{
"name": "src",
"type": "*",
"map": "memarg",
"alignment": 1
}
]
},
{
"name": "wav_i16x8_loadu",
"return": "wav_i16x8_t",
"alias": [
"wav_loadu"
],
"params": [
{
"name": "src",
"type": "*",
"map": "memarg",
"alignment": 1
}
]
},
{
"name": "wav_i32x4_loadu",
"return": "wav_i32x4_t",
"alias": [
"wav_loadu"
],
"params": [
{
"name": "src",
"type": "*",
"map": "memarg",
"alignment": 1
}
]
},
{
"name": "wav_i64x2_loadu",
"return": "wav_i64x2_t",
"alias": [
"wav_loadu"
],
"params": [
{
"name": "src",
"type": "*",
"map": "memarg",
"alignment": 1
}
]
},
{
"name": "wav_u8x16_loadu",
"return": "wav_u8x16_t",
"alias": [
"wav_loadu"
],
"params": [
{
"name": "src",
"type": "*",
"map": "memarg",
"alignment": 1
}
]
},
{
"name": "wav_u16x8_loadu",
"return": "wav_u16x8_t",
"alias": [
"wav_loadu"
],
"params": [
{
"name": "src",
"type": "*",
"map": "memarg",
"alignment": 1
}
]
},
{
"name": "wav_u32x4_loadu",
"return": "wav_u32x4_t",
"alias": [
"wav_loadu"
],
"params": [
{
"name": "src",
"type": "*",
"map": "memarg",
"alignment": 1
}
]
},
{
"name": "wav_i64x2_loadu",
"return": "wav_i64x2_t",
"alias": [
"wav_loadu"
],
"params": [
{
"name": "src",
"type": "*",
"map": "memarg",
"alignment": 1
}
]
},
{
"name": "wav_f32x4_loadu",
"return": "wav_f32x4_t",
"alias": [
"wav_loadu"
],
"params": [
{
"name": "src",
"type": "*",
"map": "memarg",
"alignment": 1
}
]
},
{
"name": "wav_f64x2_loadu",
"return": "wav_f64x2_t",
"alias": [
"wav_loadu"
],
"params": [
{
"name": "src",
"type": "*",
"map": "memarg",
"alignment": 1
}
]
}
],
"lowering": [
{
"option": "base",
"implementations": [
{
"instructions": [
{
"name": "movups",
"latency": 6,
"uops": 1,
"arguments": [
"(%rdi)",
"%xmm0"
]
}
]
}
]
},
{
"option": "AVX",
"implementations": [
{
"instructions": [
{
"name": "vmovups",
"latency": 6,
"uops": 1,
"arguments": [
"(%rdi)",
"%xmm0"
]
}
]
}
]
},
{
"option": "armv8-a",
"implementations": [
{
"instructions": [
{
"name": "ldr",
"latency": 4,
"uops": 1,
"arguments": [
"q0",
"[x0]"
]
}
]
}
]
}
]
}
]
},
"extract_lane": {
"title": "Extract lane as a scalar",
"description": "Extract the scalar value of lane specified in the immediate mode operand `imm` in `a`. The `{interpretation}.extract_lane{_s}{_u}` instructions are encoded with one immediate byte providing the index of the lane to extract.\nThe _s and _u variants will sign-extend or zero-extend the lane value to i32 respectively.",
"operation": "def S.extract_lane(a, i):\n return a[i]\n",
"instructions": [
{
"name": "i8x16.extract_lane_s",
"opcode": 21,
"return": "i32",
"params": [
{
"name": "a",
"type": "v128"
},
{
"name": "imm",
"type": "ImmLaneIdx16"
}
],
"intrin": [
{
"name": "wasm_i8x16_extract_lane",
"return": "int",
"params": [
{
"name": "__a",
"type": "v128_t",
"map": "a"
},
{
"name": "i",
"type": "const int",
"map": "imm",
"range": {
"min": 0,
"max": 15
}
}
]
}
],
"wav": [
{
"name": "wav_i8x16_extract_lane",
"alias": [
"wav_extract_lane"
],
"return": "int8_t",
"params": [
{
"name": "v",
"type": "wav_i8x16_t",
"map": "a"
},
{
"name": "lane",
"type": "const int",
"map": "imm",
"range": {
"min": 0,
"max": 15
}
}
]
}
],
"lowering": [
{
"option": "base",
"implementations": [
{
"immediates": [
0
],
"instructions": [
{
"name": "movd",
"latency": 2,
"uops": 1,
"arguments": [
"%xmm0",
"%eax"
]
},
{
"name": "movsbl",
"latency": 1,
"uops": 1,
"arguments": [
"%al",
"%eax"
]
}
]
},
{
"immediates": [
1,
2
],
"instructions": [
{
"name": "movd",
"latency": 2,
"uops": 1,
"arguments": [
"%xmm0",
"%eax"
]
},
{
"name": "shrl",
"latency": 1,
"uops": 1,
"arguments": [
"$<{ 1: 8, 2: 16 }>",
"%eax"
]
},
{
"name": "movsbl",
"latency": 1,
"uops": 1,
"arguments": [
"%al",
"%eax"
]
}
]
},
{
"immediates": [
3
],
"instructions": [
{
"name": "movd",
"latency": 2,
"uops": 1,
"arguments": [
"%xmm0",
"%eax"
]
},
{
"name": "sarl",
"latency": 1,
"uops": 1,
"arguments": [
"$24",
"%eax"
]
}
]
},
{
"immediates": [
4,
6,
8,
10,
12,
14
],
"instructions": [
{
"name": "pextrw",
"latency": 3,
"uops": 2,
"arguments": [
"$<{ 4: 2, 6: 3, 8: 4, 10: 5, 12: 6, 14: 7 }>",
"%xmm0",
"%eax"
]
},
{
"name": "movsbl",
"latency": 1,
"uops": 1,
"arguments": [
"%al",
"%eax"
]
}
]
},
{
"immediates": [
5,
7,
9,
11,
13,
15
],
"instructions": [
{
"name": "pextrw",
"latency": 3,
"uops": 2,
"arguments": [
"$<{ 5: 2, 7: 3, 9: 4, 11: 5, 13: 6, 15: 7 }>",
"%xmm0",
"%eax"
]
},
{
"name": "shrl",
"latency": 1,
"uops": 1,
"arguments": [
"$8",
"%eax"
]
},
{
"name": "movsbl",
"latency": 1,
"uops": 1,
"arguments": [
"%al",
"%eax"
]
}
]
}
]
},
{
"option": "SSE4.1",
"implementations": [
{
"immediates": [
0
],
"instructions": [
{
"name": "movd",
"latency": 2,
"uops": 1,
"arguments": [
"%xmm0",
"%eax"
]
},
{
"name": "movsbl",
"latency": 1,
"uops": 1,
"arguments": [
"%al",
"%eax"
]
}
]
},
{
"immediates": [
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15
],
"instructions": [
{
"name": "pextrb",
"latency": 3,
"uops": 2,
"arguments": [
"$<imm>",
"%xmm0",
"%eax"
]
},
{
"name": "movsbl",
"latency": 1,
"uops": 1,
"arguments": [
"%al",
"%eax"
]
}
]
}
]
},
{
"option": "AVX",
"implementations": [
{
"immediates": [
0
],
"instructions": [
{
"name": "vmovd",
"latency": 2,
"uops": 1,
"arguments": [
"%xmm0",
"%eax"
]
},
{
"name": "movsbl",
"latency": 1,
"uops": 1,
"arguments": [
"%al",
"%eax"
]
}
]
},
{
"immediates": [
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15
],
"instructions": [
{
"name": "vpextrb",
"latency": 3,
"uops": 2,
"arguments": [
"$<imm>",
"%xmm0",
"%eax"
]
},
{
"name": "movsbl",
"latency": 1,
"uops": 1,
"arguments": [
"%al",
"%eax"
]
}
]
}
]
},
{
"option": "armv8-a",
"implementations": [
{
"immediates": [
0,
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15
],
"instructions": [
{
"name": "smov",
"latency": 5,
"uops": 2,
"arguments": [
"w0",
"v0.b[<imm>]"
]
}
]
}
]
}
]
},
{
"name": "i8x16.extract_lane_u",
"opcode": 22,
"return": "i32",
"params": [
{
"name": "a",
"type": "v128"
},
{
"name": "imm",
"type": "ImmLaneIdx16"
}
],
"intrin": [
{
"name": "wasm_u8x16_extract_lane",
"return": "unsigned int",
"params": [
{
"name": "__a",
"type": "v128_t",
"map": "a"
},
{
"name": "i",
"type": "const int",
"map": "imm",
"range": {
"min": 0,
"max": 15
}
}
]
}
],
"wav": [
{
"name": "wav_u8x16_extract_lane",
"alias": [
"wav_extract_lane"
],
"return": "uint8_t",
"params": [
{
"name": "v",
"type": "wav_u8x16_t",
"map": "a"
},
{
"name": "lane",
"type": "const int",
"map": "imm",
"range": {
"min": 0,
"max": 15
}
}
]
}
],
"lowering": [
{
"option": "base",
"implementations": [
{
"immediates": [
0,
1
],
"instructions": [
{
"name": "movd",
"latency": 2,
"uops": 1,
"arguments": [
"%xmm0",
"%eax"
]
},
{
"name": "movzbl",
"latency": 1,
"uops": 1,
"arguments": [
"%al",
"%eax"
]
}
]
},
{
"immediates": [
2
],
"instructions": [
{
"name": "movd",
"latency": 2,
"uops": 1,
"arguments": [
"%xmm0",
"%eax"
]
},
{
"name": "shrl",
"latency": 1,
"uops": 1,
"arguments": [
"$16",
"%eax"
]
},
{
"name": "movzbl",
"latency": 1,
"uops": 1,
"arguments": [
"%al",
"%eax"
]
}
]
},
{
"immediates": [
3
],
"instructions": [
{
"name": "movd",
"latency": 2,
"uops": 1,
"arguments": [
"%xmm0",
"%eax"
]
},
{
"name": "shrl",
"latency": 1,
"uops": 1,
"arguments": [
"$24",
"%eax"
]
}
]
},
{
"immediates": [
4,
6,
8,
10,
12,
14
],
"instructions": [
{
"name": "pextrw",
"latency": 3,
"uops": 2,
"arguments": [
"$<{ 4: 2, 6: 3, 8: 4, 10: 5, 12: 6, 14: 7 }>",
"%xmm0",
"%eax"
]
},
{
"name": "movzbl",
"latency": 1,
"uops": 1,
"arguments": [
"%al",
"%eax"
]
}
]
},
{
"immediates": [
5,
7,
9,
11,
13,
15
],
"instructions": [
{
"name": "pextrw",
"latency": 3,
"uops": 2,
"arguments": [
"$<{ 5: 2, 7: 3, 9: 4, 11: 5, 13: 6, 15: 7 }>",
"%xmm0",
"%eax"
]
},
{
"name": "shrl",
"latency": 1,
"uops": 1,
"arguments": [
"$8",
"%eax"
]
}
]
}
]
},
{
"option": "SSE4.1",
"implementations": [
{
"immediates": [
0,
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15
],
"instructions": [
{
"name": "pextrb",
"latency": 3,
"uops": 2,
"arguments": [
"$<imm>",
"%xmm0",
"%eax"
]
}
]
}
]
},
{
"option": "AVX",
"implementations": [
{
"immediates": [
0,
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15
],
"instructions": [
{
"name": "vpextrb",
"latency": 3,
"uops": 2,
"arguments": [
"$<imm>",
"%xmm0",
"%eax"
]
}
]
}
]
},
{
"option": "armv8-a",
"implementations": [
{
"immediates": [
0,
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15
],
"instructions": [
{
"name": "umov",
"latency": 5,
"uops": 2,
"arguments": [
"w0",
"v0.b[<imm>]"
]
}
]
}
]
}
]
},
{
"name": "i16x8.extract_lane_s",
"opcode": 24,
"return": "i32",
"params": [
{
"name": "a",
"type": "v128"
},
{
"name": "imm",
"type": "ImmLaneIdx8"
}
],
"intrin": [
{
"name": "wasm_i16x8_extract_lane",
"return": "int",
"params": [
{
"name": "__a",
"type": "v128_t",
"map": "a"
},
{
"name": "i",
"type": "const int",
"map": "imm",
"range": {
"min": 0,
"max": 7
}
}
]
}
],
"wav": [
{
"name": "wav_i16x8_extract_lane",
"alias": [
"wav_extract_lane"
],
"return": "int16_t",
"params": [
{
"name": "v",
"type": "wav_i16x8_t",
"map": "a"
},
{
"name": "lane",
"type": "const int",
"map": "imm",
"range": {
"min": 0,
"max": 15
}
}
]
}
],
"lowering": [
{
"option": "base",
"implementations": [
{
"immediates": [
0
],
"instructions": [
{
"name": "movd",
"latency": 2,
"uops": 1,
"arguments": [
"%xmm0",
"%eax"
]
},
{
"name": "cwtl",
"latency": 1,
"uops": 1
}
]
},
{
"immediates": [
1,
2,
3,
4,
5,
6,
7
],
"instructions": [
{
"name": "pextrw",
"latency": 3,
"uops": 2,
"arguments": [
"$<imm>",
"%xmm0",
"%eax"
]
},
{
"name": "cwtl",
"latency": 1,
"uops": 1
}
]
}
]
},
{
"option": "AVX",
"implementations": [
{
"immediates": [
0
],
"instructions": [
{
"name": "vmovd",
"latency": 2,
"uops": 1,
"arguments": [
"%xmm0",
"%eax"
]
},
{
"name": "cwtl",
"latency": 1,
"uops": 1
}
]
},
{
"immediates": [
1,
2,
3,
4,
5,
6,
7
],
"instructions": [
{
"name": "vpextrw",
"latency": 3,
"uops": 2,
"arguments": [
"$<imm>",
"%xmm0",
"%eax"
]
},
{
"name": "cwtl",
"latency": 1,
"uops": 1
}
]
}
]
},
{
"option": "armv8-a",
"implementations": [
{
"immediates": [
0,
1,
2,
3,
4,
5,
6,
7
],
"instructions": [
{
"name": "smov",
"latency": 5,
"uops": 2,
"arguments": [
"w0",
"v0.h[<imm>]"
]
}
]
}
]
}
]
},
{
"name": "i16x8.extract_lane_u",
"opcode": 25,
"return": "i32",
"params": [
{
"name": "a",
"type": "v128"
},
{
"name": "imm",
"type": "ImmLaneIdx8"
}
],
"intrin": [
{
"name": "wasm_u16x8_extract_lane",
"return": "unsigned int",
"params": [
{
"name": "__a",
"type": "v128_t",
"map": "a"
},
{
"name": "i",
"type": "const int",
"map": "imm",
"range": {
"min": 0,
"max": 7
}
}
]
}
],
"wav": [
{
"name": "wav_u16x8_extract_lane",
"alias": [
"wav_extract_lane"
],
"return": "uint16_t",
"params": [
{
"name": "v",
"type": "wav_u16x8_t",
"map": "a"
},
{
"name": "lane",
"type": "const int",
"map": "imm",
"range": {
"min": 0,
"max": 7
}
}
]
}
],
"lowering": [
{
"option": "base",
"implementations": [
{
"immediates": [
0,
1,
2,
3,
4,
5,
6,
7
],
"instructions": [
{
"name": "pextrw",
"latency": 3,
"uops": 2,
"arguments": [
"$<imm>",
"%xmm0",
"%eax"
]
}
]
}
]
},
{
"option": "AVX",
"implementations": [
{
"immediates": [
0,
1,
2,
3,
4,
5,
6,
7
],
"instructions": [
{
"name": "vpextrw",
"latency": 3,
"uops": 2,
"arguments": [
"$<imm>",
"%xmm0",
"%eax"
]
}
]
}
]
},
{
"option": "armv8-a",
"implementations": [
{
"immediates": [
0,
1,
2,
3,
4,
5,
6,
7
],
"instructions": [
{
"name": "umov",
"latency": 5,
"uops": 2,
"arguments": [
"w0",
"v0.h[<imm>]"
]
}
]
}
]
}
]
},
{
"name": "i32x4.extract_lane",
"opcode": 27,
"return": "i32",
"params": [
{
"name": "a",
"type": "v128"
},
{
"name": "imm",
"type": "ImmLaneIdx4"
}
],
"intrin": [
{
"name": "wasm_i32x4_extract_lane",
"return": "int",
"params": [
{
"name": "__a",
"type": "v128_t",
"map": "a"
},
{
"name": "i",
"type": "const int",
"map": "imm",
"range": {
"min": 0,
"max": 3
}
}
]
}
],
"wav": [
{
"name": "wav_i32x4_extract_lane",
"alias": [
"wav_extract_lane"
],
"return": "int32_t",
"params": [
{
"name": "v",
"type": "wav_i32x4_t",
"map": "a"
},
{
"name": "lane",
"type": "const int",
"map": "imm",
"range": {
"min": 0,
"max": 3
}
}
]
},
{
"name": "wav_u32x4_extract_lane",
"alias": [
"wav_extract_lane"
],
"return": "uint32_t",
"params": [
{
"name": "v",
"type": "wav_u32x4_t",
"map": "a"
},
{
"name": "lane",
"type": "const int",
"map": "imm",
"range": {
"min": 0,
"max": 3
}
}
]
}
],
"lowering": [
{
"option": "base",
"implementations": [
{
"immediates": [
0
],
"instructions": [
{
"name": "movd",
"latency": 2,
"uops": 1,
"arguments": [
"%xmm0",
"%eax"
]
}
]
},
{
"immediates": [
1,
2,
3
],
"instructions": [
{
"name": "pshufd",
"latency": 1,
"uops": 1,
"arguments": [
"$<{ 1: 85, 2: 238, 3: 255 }>",
"%xmm0",
"%xmm0"
]
},
{
"name": "movd",
"latency": 2,
"uops": 1,
"arguments": [
"%xmm0",
"%eax"
]
}
]
}
]
},
{
"option": "SSE4.1",
"implementations": [
{
"immediates": [
0
],
"instructions": [
{
"name": "movd",
"latency": 2,
"uops": 1,
"arguments": [
"%xmm0",
"%eax"
]
}
]
},
{
"immediates": [
1,
2,
3
],
"instructions": [
{
"name": "extractps",
"latency": 3,
"uops": 2,
"arguments": [
"$<imm>",
"%xmm0",
"%eax"
]
}
]
}
]
},
{
"option": "AVX",
"implementations": [
{
"immediates": [
0
],
"instructions": [
{
"name": "vmovd",
"latency": 2,
"uops": 1,
"arguments": [
"%xmm0",
"%eax"
]
}
]
},
{
"immediates": [
1,
2,
3
],
"instructions": [
{
"name": "vextractps",
"latency": 3,
"uops": 2,
"arguments": [
"$<imm>",
"%xmm0",
"%eax"
]
}
]
}
]
},
{
"option": "armv8-a",
"implementations": [
{
"immediates": [
0
],
"instructions": [
{
"name": "fmov",
"latency": 4,
"uops": 1,
"arguments": [
"w0",
"s0"
]
}
]
},
{
"immediates": [
1,
2,
3
],
"instructions": [
{
"name": "mov",
"latency": 5,
"uops": 2,
"arguments": [
"w0",
"v0.s[<imm>]"
]
}
]
}
]
}
]
},
{
"name": "i64x2.extract_lane",
"opcode": 29,
"return": "i64",
"params": [
{
"name": "a",
"type": "v128"
},
{
"name": "imm",
"type": "ImmLaneIdx2"
}
],
"intrin": [
{
"name": "wasm_i64x2_extract_lane",
"return": "int64_t",
"params": [
{
"name": "__a",
"type": "v128_t",
"map": "a"
},
{
"name": "i",
"type": "const int",
"map": "imm",
"range": {
"min": 0,
"max": 1
}
}
]
}
],
"wav": [
{
"name": "wav_i64x2_extract_lane",
"alias": [
"wav_extract_lane"
],
"return": "int64_t",
"params": [
{
"name": "v",
"type": "wav_i64x2_t",
"map": "a"
},
{
"name": "lane",
"type": "const int",
"map": "imm",
"range": {
"min": 0,
"max": 1
}
}
]
},
{
"name": "wav_u64x2_extract_lane",
"alias": [
"wav_extract_lane"
],
"return": "uint64_t",
"params": [
{
"name": "v",
"type": "wav_u64x2_t",
"map": "a"
},
{
"name": "lane",
"type": "const int",
"map": "imm",
"range": {
"min": 0,
"max": 1
}
}
]
}
],
"lowering": [
{
"option": "base",
"implementations": [
{
"immediates": [
0
],
"instructions": [
{
"name": "movq",
"latency": 2,
"uops": 1,
"arguments": [
"%xmm0",
"%rax"
]
}
]
},
{
"immediates": [
1
],
"instructions": [
{
"name": "pshufd",
"latency": 1,
"uops": 1,
"arguments": [
"$238",
"%xmm0",
"%xmm0"
]
},
{
"name": "movq",
"latency": 2,
"uops": 1,
"arguments": [
"%xmm0",
"%rax"
]
}
]
}
]
},
{
"option": "SSE4.1",
"implementations": [
{
"immediates": [
0
],
"instructions": [
{
"name": "movq",
"latency": 2,
"uops": 1,
"arguments": [
"%xmm0",
"%rax"
]
}
]
},
{
"immediates": [
1
],
"instructions": [
{
"name": "pextrq",
"latency": 3,
"uops": 2,
"arguments": [
"$<imm>",
"%xmm0",
"%rax"
]
}
]
}
]
},
{
"option": "AVX",
"implementations": [
{
"immediates": [
0
],
"instructions": [
{
"name": "vmovq",
"latency": 2,
"uops": 1,
"arguments": [
"%xmm0",
"%rax"
]
}
]
},
{
"immediates": [
1
],
"instructions": [
{
"name": "vpextrq",
"latency": 3,
"uops": 2,
"arguments": [
"$<imm>",
"%xmm0",
"%rax"
]
}
]
}
]
},
{
"option": "armv8-a",
"implementations": [
{
"immediates": [
0
],
"instructions": [
{
"name": "fmov",
"latency": 4,
"uops": 1,
"arguments": [
"x0",
"d0"
]
}
]
},
{
"immediates": [
1
],
"instructions": [
{
"name": "mov",
"latency": 5,
"uops": 2,
"arguments": [
"x0",
"v0.d[<imm>]"
]
}
]
}
]
}
]
},
{
"name": "f32x4.extract_lane",
"opcode": 31,
"return": "f32",
"params": [
{
"name": "a",
"type": "v128"
},
{
"name": "imm",
"type": "ImmLaneIdx4"
}
],
"intrin": [
{
"name": "wasm_f32x4_extract_lane",
"return": "float",
"params": [
{
"name": "__a",
"type": "v128_t",
"map": "a"
},
{
"name": "i",
"type": "const int",
"map": "imm",
"range": {
"min": 0,
"max": 3
}
}
]
}
],
"wav": [
{
"name": "wav_f32x4_extract_lane",
"alias": [
"wav_extract_lane"
],
"return": "float",
"params": [
{
"name": "v",
"type": "wav_f32x4_t",
"map": "a"
},
{
"name": "lane",
"type": "const int",
"map": "imm",
"range": {
"min": 0,
"max": 3
}
}
]
}
],
"lowering": [
{
"option": "base",
"implementations": [
{
"immediates": [
0
],
"instructions": []
},
{
"immediates": [
1,
2,
3
],
"instructions": [
{
"name": "pshufd",
"latency": 1,
"uops": 1,
"arguments": [
"$<{ 1: 85, 2: 238, 3: 255 }>",
"%xmm0",
"%xmm0"
]
}
]
}
]
},
{
"option": "AVX",
"implementations": [
{
"immediates": [
0
],
"instructions": []
},
{
"immediates": [
1,
2,
3
],
"instructions": [
{
"name": "vpermilps",
"latency": 1,
"uops": 1,
"arguments": [
"$<{ 1: 245, 2: 78, 3: 255 }>",
"%xmm0",
"%xmm0"
]
}
]
}
]
},
{
"option": "armv8-a",
"implementations": [
{
"immediates": [
0
],
"instructions": []
},
{
"immediates": [
1,
2,
3
],
"instructions": [
{
"name": "mov",
"latency": 2,
"uops": 1,
"arguments": [
"s0",
"v0.s[<imm>]"
]
}
]
}
]
}
]
},
{
"name": "f64x2.extract_lane",
"opcode": 33,
"return": "f64",
"params": [
{
"name": "a",
"type": "v128"
},
{
"name": "imm",
"type": "ImmLaneIdx2"
}
],
"intrin": [
{
"name": "wasm_f64x2_extract_lane",
"return": "double",
"params": [
{
"name": "__a",
"type": "v128_t",
"map": "a"
},
{
"name": "i",
"type": "const int",
"map": "imm",
"range": {
"min": 0,
"max": 1
}
}
]
}
],
"wav": [
{
"name": "wav_f64x2_extract_lane",
"alias": [
"wav_extract_lane"
],
"return": "double",
"params": [
{
"name": "v",
"type": "wav_f64x2_t",
"map": "a"
},
{
"name": "lane",
"type": "const int",
"map": "imm",
"range": {
"min": 0,
"max": 1
}
}
]
}
],
"lowering": [
{
"option": "base",
"implementations": [
{
"immediates": [
0
],
"instructions": []
},
{
"immediates": [
1
],
"instructions": [
{
"name": "pshufd",
"latency": 1,
"uops": 1,
"arguments": [
"$238",
"%xmm0",
"%xmm0"
]
}
]
}
]
},
{
"option": "AVX",
"implementations": [
{
"immediates": [
0
],
"instructions": []
},
{
"immediates": [
1
],
"instructions": [
{
"name": "vpermilps",
"latency": 1,
"uops": 1,
"arguments": [
"$78",
"%xmm0",
"%xmm0"
]
}
]
}
]
},
{
"option": "armv8-a",
"implementations": [
{
"immediates": [
0
],
"instructions": []
},
{
"immediates": [
1
],
"instructions": [
{
"name": "mov",
"latency": 2,
"uops": 1,
"arguments": [
"d0",
"v0.d[<imm>]"
]
}
]
}
]
}
]
}
]
},
"replace_lane": {
"title": "Replace lane value",
"description": "Return a new vector with lanes identical to `a`, except for the lane specified in the immediate mode operand `imm` which has the value `x`. The `{interpretation}.replace_lane` instructions are encoded with an immediate byte providing the index of the lane the value of which is to be replaced.\nThe input lane value, x, is interpreted the same way as for the splat instructions. For the i8 and i16 lanes, the high bits of x are ignored.",
"operation": "def S.replace_lane(a, i, x):\n result = S.New()\n for j in range(S.Lanes):\n result[j] = a[j]\n result[i] = x\n return result\n",
"instructions": [
{
"name": "i8x16.replace_lane",
"opcode": 23,
"return": "v128",
"params": [
{
"name": "a",
"type": "v128"
},
{
"name": "imm",
"type": "ImmLaneIdx16"
},
{
"name": "x",
"type": "i32"
}
],
"intrin": [
{
"name": "wasm_i8x16_replace_lane",
"return": "v128_t",
"params": [
{
"name": "__a",
"type": "v128_t",
"map": "a"
},
{
"name": "__i",
"type": "const int",
"map": "imm",
"range": {
"min": 0,
"max": 15
}
},
{
"name": "__b",
"type": "int",
"map": "x"
}
]
}
],
"wav": [
{
"name": "wav_i8x16_replace_lane",
"alias": [
"wav_replace_lane"
],
"return": "wav_i8x16_t",
"params": [
{
"name": "v",
"type": "wav_i8x16_t",
"map": "a"
},
{
"name": "lane",
"type": "const int",
"map": "imm",
"range": {
"min": 0,
"max": 15
}
},
{
"name": "value",
"type": "int8_t",
"map": "x"
}
]
},
{
"name": "wav_u8x16_replace_lane",
"alias": [
"wav_replace_lane"
],
"return": "wav_u8x16_t",
"params": [
{
"name": "v",
"type": "wav_u8x16_t",
"map": "a"
},
{
"name": "lane",
"type": "const int",
"map": "imm",
"range": {
"min": 0,
"max": 15
}
},
{
"name": "value",
"type": "uint8_t",
"map": "x"
}
]
}
],
"lowering": [
{
"option": "base",
"implementations": [
{
"immediates": [
0
],
"instructions": [
{
"name": "movdqa",
"latency": 6,
"uops": 1,
"arguments": [
".LCPI0_0(%rip)",
"%xmm1"
]
},
{
"name": "pand",
"latency": 1,
"uops": 1,
"arguments": [
"%xmm1",
"%xmm0"
]
},
{
"name": "movd",
"latency": 1,
"uops": 1,
"arguments": [
"%edi",
"%xmm2"
]
},
{
"name": "pandn",
"latency": 1,
"uops": 1,
"arguments": [
"%xmm2",
"%xmm1"
]
},
{
"name": "por",
"latency": 1,
"uops": 1,
"arguments": [
"%xmm1",
"%xmm0"
]
}
]
},
{
"immediates": [
1
],
"instructions": [
{
"name": "movdqa",
"latency": 6,
"uops": 1,
"arguments": [
".LCPI0_0(%rip)",
"%xmm1"
]
},
{
"name": "pand",
"latency": 1,
"uops": 1,
"arguments": [
"%xmm1",
"%xmm0"
]
},
{
"name": "movd",
"latency": 1,
"uops": 1,
"arguments": [
"%edi",
"%xmm2"
]
},
{
"name": "psllw",
"latency": 1,
"uops": 1,
"arguments": [
"$8",
"%xmm2"
]
},
{
"name": "pandn",
"latency": 1,
"uops": 1,
"arguments": [
"%xmm2",
"%xmm1"
]
},
{
"name": "por",
"latency": 1,
"uops": 1,
"arguments": [
"%xmm1",
"%xmm0"
]
}
]
},
{
"immediates": [
2,
3
],
"instructions": [
{
"name": "movdqa",
"latency": 6,
"uops": 1,
"arguments": [
".LCPI0_0(%rip)",
"%xmm1"
]
},
{
"name": "pand",
"latency": 1,
"uops": 1,
"arguments": [
"%xmm1",
"%xmm0"
]
},
{
"name": "movd",
"latency": 1,
"uops": 1,
"arguments": [
"%edi",
"%xmm2"
]
},
{
"name": "pslld",
"latency": 1,
"uops": 1,
"arguments": [
"$<{ 2: 16, 3: 24 }>",
"%xmm2"
]
},
{
"name": "pandn",
"latency": 1,
"uops": 1,
"arguments": [
"%xmm2",
"%xmm1"
]
},
{
"name": "por",
"latency": 1,
"uops": 1,
"arguments": [
"%xmm1",
"%xmm0"
]
}
]
},
{
"immediates": [
4,
8,
12
],
"instructions": [
{
"name": "movdqa",
"latency": 6,
"uops": 1,
"arguments": [
".LCPI0_0(%rip)",
"%xmm1"
]
},
{
"name": "pand",
"latency": 1,
"uops": 1,
"arguments": [
"%xmm1",
"%xmm0"
]
},
{
"name": "movd",
"latency": 1,
"uops": 1,
"arguments": [
"%edi",
"%xmm2"
]
},
{
"name": "pshufd",
"latency": 1,
"uops": 1,
"arguments": [
"$<{ 4: 80, 8: 68, 12: 0 }>",
"%xmm2",
"%xmm2"
]
},
{
"name": "pandn",
"latency": 1,
"uops": 1,
"arguments": [
"%xmm2",
"%xmm1"
]
},
{
"name": "por",
"latency": 1,
"uops": 1,
"arguments": [
"%xmm1",
"%xmm0"
]
}
]
},
{
"immediates": [
5,
6,
7
],
"instructions": [
{
"name": "movdqa",
"latency": 6,
"uops": 1,
"arguments": [
".LCPI0_0(%rip)",
"%xmm1"
]
},
{
"name": "pand",
"latency": 1,
"uops": 1,
"arguments": [
"%xmm1",
"%xmm0"
]
},
{
"name": "movd",
"latency": 1,
"uops": 1,
"arguments": [
"%edi",
"%xmm2"
]
},
{
"name": "psllq",
"latency": 1,
"uops": 1,
"arguments": [
"$<{ 5: 40, 6: 48, 7: 56 }>",
"%xmm2"
]
},
{
"name": "pandn",
"latency": 1,
"uops": 1,
"arguments": [
"%xmm2",
"%xmm1"
]
},
{
"name": "por",
"latency": 1,
"uops": 1,
"arguments": [
"%xmm1",
"%xmm0"
]
}
]
},
{
"immediates": [
9,
10,
11,
13,
14
],
"instructions": [
{
"name": "movdqa",
"latency": 6,
"uops": 1,
"arguments": [
".LCPI0_0(%rip)",
"%xmm1"
]
},
{
"name": "pand",
"latency": 1,
"uops": 1,
"arguments": [
"%xmm1",
"%xmm0"
]
},
{
"name": "movd",
"latency": 1,
"uops": 1,
"arguments": [
"%edi",
"%xmm2"
]
},
{
"name": "pslldq",
"latency": 1,
"uops": 1,
"arguments": [
"$<imm>",
"%xmm2"
]
},
{
"name": "pandn",
"latency": 1,
"uops": 1,
"arguments": [
"%xmm2",
"%xmm1"
]
},
{
"name": "por",
"latency": 1,
"uops": 1,
"arguments": [
"%xmm1",
"%xmm0"
]
}
]
},
{
"immediates": [
15
],
"instructions": [
{
"name": "pand",
"latency": 7,
"uops": 2,
"arguments": [
".LCPI0_0(%rip)",
"%xmm0"
]
},
{
"name": "movd",
"latency": 1,
"uops": 1,
"arguments": [
"%edi",
"%xmm1"
]
},
{
"name": "pslldq",
"latency": 1,
"uops": 1,
"arguments": [
"$<imm>",
"%xmm1"
]
},
{
"name": "por",
"latency": 1,
"uops": 1,
"arguments": [
"%xmm1",
"%xmm0"
]
}
]
}
]
},
{
"option": "SSSE3",
"implementations": [
{
"immediates": [
0
],
"instructions": [
{
"name": "movd",
"latency": 1,
"uops": 1,
"arguments": [
"%edi",
"%xmm1"
]
},
{
"name": "palignr",
"latency": 1,
"uops": 1,
"arguments": [
"$1",
"%xmm0",
"%xmm1"
]
},
{
"name": "palignr",
"latency": 1,
"uops": 1,
"arguments": [
"$15",
"%xmm1",
"%xmm1"
]
},
{
"name": "movdqa",
"latency": 1,
"uops": 1,
"arguments": [
"%xmm1",
"%xmm0"
]
}
]
},
{
"immediates": [
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14
],
"instructions": [
{
"name": "pshufb",
"latency": 7,
"uops": 2,
"arguments": [
".LCPI0_0(%rip)",
"%xmm0"
]
},
{
"name": "movd",
"latency": 1,
"uops": 1,
"arguments": [
"%edi",
"%xmm1"
]
},
{
"name": "pshufb",
"latency": 7,
"uops": 2,
"arguments": [
".LCPI0_1(%rip)",
"%xmm1"
]
},
{
"name": "por",
"latency": 1,
"uops": 1,
"arguments": [
"%xmm1",
"%xmm0"
]
}
]
},
{
"immediates": [
15
],
"instructions": [
{
"name": "pshufb",
"latency": 7,
"uops": 2,
"arguments": [
".LCPI0_0(%rip)",
"%xmm0"
]
},
{
"name": "movd",
"latency": 1,
"uops": 1,
"arguments": [
"%edi",
"%xmm1"
]
},
{
"name": "pslldq",
"latency": 1,
"uops": 1,
"arguments": [
"$<imm>",
"%xmm1"
]
},
{
"name": "por",
"latency": 1,
"uops": 1,
"arguments": [
"%xmm1",
"%xmm0"
]
}
]
}
]
},
{
"option": "SSE4.1",
"implementations": [
{
"immediates": [
0,
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15
],
"instructions": [
{
"name": "pinsrb",
"latency": 2,
"uops": 2,
"arguments": [
"$<imm>",
"%edi",
"%xmm0"
]
}
]
}
]
},
{
"option": "AVX",
"implementations": [
{
"immediates": [
0,
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15
],
"instructions": [
{
"name": "vpinsrb",
"latency": 2,
"uops": 2,
"arguments": [
"$<imm>",
"%edi",
"%xmm0",
"%xmm0"
]
}
]
}
]
},
{
"option": "armv8-a",
"implementations": [
{
"immediates": [
0,
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15
],
"instructions": [
{
"name": "mov",
"latency": 7,
"uops": 2,
"arguments": [
"v0.b[<imm>]",
"w0"
]
}
]
}
]
}
]
},
{
"name": "i16x8.replace_lane",
"opcode": 26,
"return": "v128",
"params": [
{
"name": "a",
"type": "v128"
},
{
"name": "imm",
"type": "ImmLaneIdx8"
},
{
"name": "x",
"type": "i32"
}
],
"intrin": [
{
"name": "wasm_i16x8_replace_lane",
"return": "v128_t",
"params": [
{
"name": "__a",
"type": "v128_t",
"map": "a"
},
{
"name": "__i",
"type": "const int",
"map": "imm",
"range": {
"min": 0,
"max": 7
}
},
{
"name": "__b",
"type": "int",
"map": "x"
}
]
}
],
"wav": [
{
"name": "wav_i16x8_replace_lane",
"alias": [
"wav_replace_lane"
],
"return": "wav_i16x8_t",
"params": [
{
"name": "v",
"type": "wav_i16x8_t",
"map": "a"
},
{
"name": "lane",
"type": "const int",
"map": "imm",
"range": {
"min": 0,
"max": 7
}
},
{
"name": "value",
"type": "int16_t",
"map": "x"
}
]
},
{
"name": "wav_u16x8_replace_lane",
"alias": [
"wav_replace_lane"
],
"return": "wav_u16x8_t",
"params": [
{
"name": "v",
"type": "wav_u16x8_t",
"map": "a"
},
{
"name": "lane",
"type": "const int",
"map": "imm",
"range": {
"min": 0,
"max": 7
}
},
{
"name": "value",
"type": "uint16_t",
"map": "x"
}
]
}
],
"lowering": [
{
"option": "base",
"implementations": [
{
"immediates": [
0,
1,
2,
3,
4,
5,
6,
7
],
"instructions": [
{
"name": "pinsrw",
"latency": 2,
"uops": 2,
"arguments": [
"$<imm>",
"%edi",
"%xmm0"
]
}
]
}
]
},
{
"option": "AVX",
"implementations": [
{
"immediates": [
0,
1,
2,
3,
4,
5,
6,
7
],
"instructions": [
{
"name": "vpinsrw",
"latency": 2,
"uops": 2,
"arguments": [
"$<imm>",
"%edi",
"%xmm0",
"%xmm0"
]
}
]
}
]
},
{
"option": "armv8-a",
"implementations": [
{
"immediates": [
0,
1,
2,
3,
4,
5,
6,
7
],
"instructions": [
{
"name": "mov",
"latency": 7,
"uops": 2,
"arguments": [
"v0.h[<imm>]",
"w0"
]
}
]
}
]
}
]
},
{
"name": "i32x4.replace_lane",
"opcode": 28,
"return": "v128",
"params": [
{
"name": "a",
"type": "v128"
},
{
"name": "imm",
"type": "ImmLaneIdx4"
},
{
"name": "x",
"type": "i32"
}
],
"intrin": [
{
"name": "wasm_i32x4_replace_lane",
"return": "v128_t",
"params": [
{
"name": "__a",
"type": "v128_t",
"map": "a"
},
{
"name": "__i",
"type": "const int",
"map": "imm",
"range": {
"min": 0,
"max": 3
}
},
{
"name": "__b",
"type": "int",
"map": "x"
}
]
}
],
"wav": [
{
"name": "wav_i32x4_replace_lane",
"alias": [
"wav_replace_lane"
],
"return": "wav_i32x4_t",
"params": [
{
"name": "v",
"type": "wav_i32x4_t",
"map": "a"
},
{
"name": "lane",
"type": "const int",
"map": "imm",
"range": {
"min": 0,
"max": 3
}
},
{
"name": "value",
"type": "int32_t",
"map": "x"
}
]
},
{
"name": "wav_u32x4_replace_lane",
"alias": [
"wav_replace_lane"
],
"return": "wav_u32x4_t",
"params": [
{
"name": "v",
"type": "wav_u32x4_t",
"map": "a"
},
{
"name": "lane",
"type": "const int",
"map": "imm",
"range": {
"min": 0,
"max": 3
}
},
{
"name": "value",
"type": "uint32_t",
"map": "x"
}
]
}
],
"lowering": [
{
"option": "base",
"implementations": [
{
"immediates": [
0
],
"instructions": [
{
"name": "movd",
"latency": 1,
"uops": 1,
"arguments": [
"%edi",
"%xmm1"
]
},
{
"name": "movss",
"latency": 1,
"uops": 1,
"arguments": [
"%xmm1",
"%xmm0"
]
}
]
},
{
"immediates": [
1
],
"instructions": [
{
"name": "movd",
"latency": 1,
"uops": 1,
"arguments": [
"%edi",
"%xmm1"
]
},
{
"name": "punpcklqdq",
"latency": 1,
"uops": 1,
"arguments": [
"%xmm0",
"%xmm1"
]
},
{
"name": "shufps",
"latency": 1,
"uops": 1,
"arguments": [
"$226",
"%xmm0",
"%xmm1"
]
},
{
"name": "movaps",
"latency": 1,
"uops": 1,
"arguments": [
"%xmm1",
"%xmm0"
]
}
]
},
{
"immediates": [
2,
3
],
"instructions": [
{
"name": "movd",
"latency": 1,
"uops": 1,
"arguments": [
"%edi",
"%xmm1"
]
},
{
"name": "shufps",
"latency": 1,
"uops": 1,
"arguments": [
"$<{ 2: 48, 3: 228 }>",
"%xmm0",
"%xmm1"
]
},
{
"name": "shufps",
"latency": 1,
"uops": 1,
"arguments": [
"$<{ 2: 132, 3: 36 }>",
"%xmm1",
"%xmm0"
]
}
]
}
]
},
{
"option": "SSE4.1",
"implementations": [
{
"immediates": [
0,
1,
2,
3
],
"instructions": [
{
"name": "pinsrd",
"latency": 2,
"uops": 2,
"arguments": [
"$<imm>",
"%edi",
"%xmm0"
]
}
]
}
]
},
{
"option": "AVX",
"implementations": [
{
"immediates": [
0,
1,
2,
3
],
"instructions": [
{
"name": "vpinsrd",
"latency": 2,
"uops": 2,
"arguments": [
"$<imm>",
"%edi",
"%xmm0",
"%xmm0"
]
}
]
}
]
},
{
"option": "armv8-a",
"implementations": [
{
"immediates": [
0,
1,
2,
3
],
"instructions": [
{
"name": "mov",
"latency": 7,
"uops": 2,
"arguments": [
"v0.s[<imm>]",
"w0"
]
}
]
}
]
}
]
},
{
"name": "i64x2.replace_lane",
"opcode": 30,
"return": "v128",
"params": [
{
"name": "a",
"type": "v128"
},
{
"name": "imm",
"type": "ImmLaneIdx2"
},
{
"name": "x",
"type": "i32"
}
],
"intrin": [
{
"name": "wasm_i64x2_replace_lane",
"return": "v128_t",
"params": [
{
"name": "__a",
"type": "v128_t",
"map": "a"
},
{
"name": "__i",
"type": "const int",
"map": "imm",
"range": {
"min": 0,
"max": 1
}
},
{
"name": "__b",
"type": "int64_t",
"map": "x"
}
]
}
],
"wav": [
{
"name": "wav_i64x2_replace_lane",
"alias": [
"wav_replace_lane"
],
"return": "wav_i64x2_t",
"params": [
{
"name": "v",
"type": "wav_i64x2_t",
"map": "a"
},
{
"name": "lane",
"type": "const int",
"map": "imm",
"range": {
"min": 0,
"max": 1
}
},
{
"name": "value",
"type": "int64_t",
"map": "x"
}
]
},
{
"name": "wav_u64x2_replace_lane",
"alias": [
"wav_replace_lane"
],
"return": "wav_u64x2_t",
"params": [
{
"name": "v",
"type": "wav_u64x2_t",
"map": "a"
},
{
"name": "lane",
"type": "const int",
"map": "imm",
"range": {
"min": 0,
"max": 1
}
},
{
"name": "value",
"type": "uint64_t",
"map": "x"
}
]
}
],
"lowering": [
{
"option": "base",
"implementations": [
{
"immediates": [
0
],
"instructions": [
{
"name": "movq",
"latency": 1,
"uops": 1,
"arguments": [
"%rdi",
"%xmm1"
]
},
{
"name": "movsd",
"latency": 1,
"uops": 1,
"arguments": [
"%xmm1",
"%xmm0"
]
}
]
},
{
"immediates": [
1
],
"instructions": [
{
"name": "movq",
"latency": 1,
"uops": 1,
"arguments": [
"%rdi",
"%xmm1"
]
},
{
"name": "punpcklqdq",
"latency": 1,
"uops": 1,
"arguments": [
"%xmm1",
"%xmm0"
]
}
]
}
]
},
{
"option": "SSE4.1",
"implementations": [
{
"immediates": [
0,
1
],
"instructions": [
{
"name": "pinsrq",
"latency": 2,
"uops": 2,
"arguments": [
"$<imm>",
"%rdi",
"%xmm0"
]
}
]
}
]
},
{
"option": "AVX",
"implementations": [
{
"immediates": [
0,
1
],
"instructions": [
{
"name": "vpinsrq",
"latency": 2,
"uops": 2,
"arguments": [
"$<imm>",
"%rdi",
"%xmm0",
"%xmm0"
]
}
]
}
]
},
{
"option": "armv8-a",
"implementations": [
{
"immediates": [
0,
1
],
"instructions": [
{
"name": "mov",
"latency": 7,
"uops": 2,
"arguments": [
"v0.d[<imm>]",
"x0"
]
}
]
}
]
}
]
},
{
"name": "f32x4.replace_lane",
"opcode": 32,
"return": "v128",
"params": [
{
"name": "a",
"type": "v128"
},
{
"name": "imm",
"type": "ImmLaneIdx4"
},
{
"name": "x",
"type": "f32"
}
],
"intrin": [
{
"name": "wasm_f32x4_replace_lane",
"return": "v128_t",
"params": [
{
"name": "__a",
"type": "v128_t",
"map": "a"
},
{
"name": "__i",
"type": "const int",
"map": "imm",
"range": {
"min": 0,
"max": 3
}
},
{
"name": "__b",
"type": "int",
"map": "x"
}
]
}
],
"wav": [
{
"name": "wav_f32x4_replace_lane",
"alias": [
"wav_replace_lane"
],
"return": "wav_f32x4_t",
"params": [
{
"name": "v",
"type": "wav_f32x4_t",
"map": "a"
},
{
"name": "lane",
"type": "const int",
"map": "imm",
"range": {
"min": 0,
"max": 3
}
},
{
"name": "value",
"type": "float",
"map": "x"
}
]
}
],
"lowering": [
{
"option": "base",
"implementations": [
{
"immediates": [
0
],
"instructions": [
{
"name": "movss",
"latency": 1,
"uops": 1,
"arguments": [
"%xmm1",
"%xmm0"
]
}
]
},
{
"immediates": [
1
],
"instructions": [
{
"name": "movlhps",
"latency": 1,
"uops": 1,
"arguments": [
"%xmm0",
"%xmm1"
]
},
{
"name": "shufps",
"latency": 1,
"uops": 1,
"arguments": [
"$226",
"%xmm0",
"%xmm1"
]
},
{
"name": "movaps",
"latency": 1,
"uops": 1,
"arguments": [
"%xmm1",
"%xmm0"
]
}
]
},
{
"immediates": [
2,
3
],
"instructions": [
{
"name": "shufps",
"latency": 1,
"uops": 1,
"arguments": [
"$<{ 2: 48, 3: 228 }>",
"%xmm0",
"%xmm1"
]
},
{
"name": "shufps",
"latency": 1,
"uops": 1,
"arguments": [
"$<{ 2: 132, 3: 36 }>",
"%xmm1",
"%xmm0"
]
}
]
}
]
},
{
"option": "SSE4.1",
"implementations": [
{
"immediates": [
0
],
"instructions": [
{
"name": "blendps",
"latency": 1,
"uops": 1,
"arguments": [
"$1",
"%xmm1",
"%xmm0"
]
}
]
},
{
"immediates": [
1,
2,
3
],
"instructions": [
{
"name": "insertps",
"latency": 1,
"uops": 1,
"arguments": [
"$<{ 1: 16, 2: 32, 3: 48 }>",
"%xmm1",
"%xmm0"
]
}
]
}
]
},
{
"option": "AVX",
"implementations": [
{
"immediates": [
0
],
"instructions": [
{
"name": "vblendps",
"latency": 1,
"uops": 1,
"arguments": [
"$1",
"%xmm1",
"%xmm0",
"%xmm0"
]
}
]
},
{
"immediates": [
1,
2,
3
],
"instructions": [
{
"name": "vinsertps",
"latency": 1,
"uops": 1,
"arguments": [
"$<{ 1: 16, 2: 32, 3: 48 }>",
"%xmm1",
"%xmm0",
"%xmm0"
]
}
]
}
]
},
{
"option": "armv8-a",
"implementations": [
{
"immediates": [
0,
1,
2,
3
],
"instructions": [
{
"name": "mov",
"latency": 7,
"uops": 2,
"arguments": [
"v0.s[<imm>]",
"v1.s[0]"
]
}
]
}
]
}
]
},
{
"name": "f64x2.replace_lane",
"opcode": 34,
"return": "v128",
"params": [
{
"name": "a",
"type": "v128"
},
{
"name": "imm",
"type": "ImmLaneIdx2"
},
{
"name": "x",
"type": "f32"
}
],
"intrin": [
{
"name": "wasm_f64x2_replace_lane",
"return": "v128_t",
"params": [
{
"name": "__a",
"type": "v128_t",
"map": "a"
},
{
"name": "__i",
"type": "const int",
"map": "imm",
"range": {
"min": 0,
"max": 1
}
},
{
"name": "__b",
"type": "double",
"map": "x"
}
]
}
],
"wav": [
{
"name": "wav_f64x2_replace_lane",
"alias": [
"wav_replace_lane"
],
"return": "wav_f64x2_t",
"params": [
{
"name": "v",
"type": "wav_f64x2_t",
"map": "a"
},
{
"name": "lane",
"type": "const int",
"map": "imm",
"range": {
"min": 0,
"max": 1
}
},
{
"name": "value",
"type": "double",
"map": "x"
}
]
}
],
"lowering": [
{
"option": "base",
"implementations": [
{
"immediates": [
0
],
"instructions": [
{
"name": "movsd",
"latency": 1,
"uops": 1,
"arguments": [
"%xmm1",
"%xmm0"
]
}
]
},
{
"immediates": [
1
],
"instructions": [
{
"name": "movlhps",
"latency": 1,
"uops": 1,
"arguments": [
"%xmm1",
"%xmm0"
]
}
]
}
]
},
{
"option": "SSE4.1",
"implementations": [
{
"immediates": [
0
],
"instructions": [
{
"name": "blendps",
"latency": 1,
"uops": 1,
"arguments": [
"$3",
"%xmm1",
"%xmm0"
]
}
]
},
{
"immediates": [
1
],
"instructions": [
{
"name": "movlhps",
"latency": 1,
"uops": 1,
"arguments": [
"%xmm1",
"%xmm0"
]
}
]
}
]
},
{
"option": "AVX",
"implementations": [
{
"immediates": [
0
],
"instructions": [
{
"name": "vblendps",
"latency": 1,
"uops": 1,
"arguments": [
"$3",
"%xmm1",
"%xmm0",
"%xmm0"
]
}
]
},
{
"immediates": [
1
],
"instructions": [
{
"name": "vmovlhps",
"latency": 1,
"uops": 1,
"arguments": [
"%xmm1",
"%xmm0",
"%xmm0"
]
}
]
}
]
},
{
"option": "armv8-a",
"implementations": [
{
"immediates": [
0,
1
],
"instructions": [
{
"name": "mov",
"latency": 7,
"uops": 2,
"arguments": [
"v0.d[<imm>]",
"v1.d[0]"
]
}
]
}
]
}
]
}
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment