Skip to content

Commit

Permalink
[x86-64] Add assembler methods for v128 replace_lane
Browse files Browse the repository at this point in the history
  • Loading branch information
haoyu-zc committed Aug 8, 2023
1 parent 69cd0fa commit 9ef686e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/asm/x86-64/X86_64Assembler.v3
Original file line number Diff line number Diff line change
Expand Up @@ -882,7 +882,9 @@ class X86_64Assembler(w: DataWriter, OP_REX: byte) {
def movhlps_s_s(a: X86_64Xmmr, b: X86_64Xmmr) -> this {
emit_rex_bb_r_r(a, b, NO_REX, 0x0F, 0x12);
}

def movlhps_s_s(a: X86_64Xmmr, b: X86_64Xmmr) -> this {
emit_rex_bb_r_r(a, b, NO_REX, 0x0F, 0x16);
}
def movd_s_r(a: X86_64Xmmr, b: X86_64Reg) -> this {
emitb(0x66);
emit_rex_bb_r_r(a, b, NO_REX, 0x0F, 0x6E);
Expand Down Expand Up @@ -1947,6 +1949,11 @@ class X86_64Assembler(w: DataWriter, OP_REX: byte) {
emit_rex_bbb_r_r(a, b, REX_W, 0x0F, 0x3A, 0x22);
emitb(imm);
}
def insertps_s_s_i(a: X86_64Xmmr, b: X86_64Xmmr, imm: u8) -> this {
emitb(0x66);
emit_rex_bbb_r_r(a, b, NO_REX, 0x0F, 0x3A, 0x21);
emitb(imm);
}
def pextrb_r_s_i(a: X86_64Gpr, b: X86_64Xmmr, imm: u8) -> this {
emitb(0x66);
emit_rex_bbb_r_r2(a, b, NO_REX, 0x0F, 0x3A, 0x14);
Expand Down
2 changes: 2 additions & 0 deletions test/asm/x86-64/X86_64AssemblerTestGen.v3
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,7 @@ def do_sse() {
do_s_m("pmovzxdq", asm.pmovzxdq_s_m);
do_s_s("pmovzxdq", asm.pmovzxdq_s_s);
do_s_s("movhlps", asm.movhlps_s_s);
do_s_s("movlhps", asm.movlhps_s_s);

do_s_s("movsd", asm.movsd_s_s);
do_m_s("movsd", asm.movsd_m_s);
Expand Down Expand Up @@ -697,6 +698,7 @@ def do_sse() {
do_s_r_b("pinsrq", asm.pinsrq_s_r_i);
do_r_s_b("pextrq", asm.pextrq_r_s_i);
do_m_s_b("pextrq", asm.pextrq_m_s_i);
do_s_s_b("insertps", asm.insertps_s_s_i);
}

def ADDRS = [
Expand Down

0 comments on commit 9ef686e

Please sign in to comment.