Commit 0c7b551f authored by Ng Zhi An's avatar Ng Zhi An Committed by Commit Bot

Reland "Clean up macros"

This is a reland of 08b26f53

Fixed the original crash, by removing a disasm for psllq and psrlq
that is now handled by the macro list.

Original change's description:
> Clean up macros
>
> Move some instruction definitions into sse-instr, which is used to
> generate some disasm tests, so we can remove some cases there.
>
> Bug: v8:9810
> Change-Id: I0615ec823396da08bc5d234cf1dabca6afd3f052
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1866965
> Reviewed-by: Deepti Gandluri <gdeepti@chromium.org>
> Commit-Queue: Zhi An Ng <zhin@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#64441}

Bug: v8:9810
Change-Id: I69335a889f5f72b76a79e4e9860835232e6e38a8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1872298Reviewed-by: 's avatarDeepti Gandluri <gdeepti@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#64487}
parent d8ba2856
...@@ -2495,14 +2495,6 @@ void Assembler::psllq(XMMRegister reg, uint8_t shift) { ...@@ -2495,14 +2495,6 @@ void Assembler::psllq(XMMRegister reg, uint8_t shift) {
EMIT(shift); EMIT(shift);
} }
void Assembler::psllq(XMMRegister dst, XMMRegister src) {
EnsureSpace ensure_space(this);
EMIT(0x66);
EMIT(0x0F);
EMIT(0xF3);
emit_sse_operand(dst, src);
}
void Assembler::psrlq(XMMRegister reg, uint8_t shift) { void Assembler::psrlq(XMMRegister reg, uint8_t shift) {
EnsureSpace ensure_space(this); EnsureSpace ensure_space(this);
EMIT(0x66); EMIT(0x66);
...@@ -2512,14 +2504,6 @@ void Assembler::psrlq(XMMRegister reg, uint8_t shift) { ...@@ -2512,14 +2504,6 @@ void Assembler::psrlq(XMMRegister reg, uint8_t shift) {
EMIT(shift); EMIT(shift);
} }
void Assembler::psrlq(XMMRegister dst, XMMRegister src) {
EnsureSpace ensure_space(this);
EMIT(0x66);
EMIT(0x0F);
EMIT(0xD3);
emit_sse_operand(dst, src);
}
void Assembler::pshufhw(XMMRegister dst, Operand src, uint8_t shuffle) { void Assembler::pshufhw(XMMRegister dst, Operand src, uint8_t shuffle) {
EnsureSpace ensure_space(this); EnsureSpace ensure_space(this);
EMIT(0xF3); EMIT(0xF3);
...@@ -2798,6 +2782,12 @@ void Assembler::vpslld(XMMRegister dst, XMMRegister src, uint8_t imm8) { ...@@ -2798,6 +2782,12 @@ void Assembler::vpslld(XMMRegister dst, XMMRegister src, uint8_t imm8) {
EMIT(imm8); EMIT(imm8);
} }
void Assembler::vpsllq(XMMRegister dst, XMMRegister src, uint8_t imm8) {
XMMRegister iop = XMMRegister::from_code(6);
vinstr(0x73, iop, dst, Operand(src), k66, k0F, kWIG);
EMIT(imm8);
}
void Assembler::vpsrlw(XMMRegister dst, XMMRegister src, uint8_t imm8) { void Assembler::vpsrlw(XMMRegister dst, XMMRegister src, uint8_t imm8) {
XMMRegister iop = XMMRegister::from_code(2); XMMRegister iop = XMMRegister::from_code(2);
vinstr(0x71, iop, dst, Operand(src), k66, k0F, kWIG); vinstr(0x71, iop, dst, Operand(src), k66, k0F, kWIG);
......
...@@ -996,9 +996,7 @@ class V8_EXPORT_PRIVATE Assembler : public AssemblerBase { ...@@ -996,9 +996,7 @@ class V8_EXPORT_PRIVATE Assembler : public AssemblerBase {
void psraw(XMMRegister reg, uint8_t shift); void psraw(XMMRegister reg, uint8_t shift);
void psrad(XMMRegister reg, uint8_t shift); void psrad(XMMRegister reg, uint8_t shift);
void psllq(XMMRegister reg, uint8_t shift); void psllq(XMMRegister reg, uint8_t shift);
void psllq(XMMRegister dst, XMMRegister src);
void psrlq(XMMRegister reg, uint8_t shift); void psrlq(XMMRegister reg, uint8_t shift);
void psrlq(XMMRegister dst, XMMRegister src);
void pshufhw(XMMRegister dst, XMMRegister src, uint8_t shuffle) { void pshufhw(XMMRegister dst, XMMRegister src, uint8_t shuffle) {
pshufhw(dst, Operand(src), shuffle); pshufhw(dst, Operand(src), shuffle);
...@@ -1332,6 +1330,7 @@ class V8_EXPORT_PRIVATE Assembler : public AssemblerBase { ...@@ -1332,6 +1330,7 @@ class V8_EXPORT_PRIVATE Assembler : public AssemblerBase {
void vpsllw(XMMRegister dst, XMMRegister src, uint8_t imm8); void vpsllw(XMMRegister dst, XMMRegister src, uint8_t imm8);
void vpslld(XMMRegister dst, XMMRegister src, uint8_t imm8); void vpslld(XMMRegister dst, XMMRegister src, uint8_t imm8);
void vpsllq(XMMRegister dst, XMMRegister src, uint8_t imm8);
void vpsrlw(XMMRegister dst, XMMRegister src, uint8_t imm8); void vpsrlw(XMMRegister dst, XMMRegister src, uint8_t imm8);
void vpsrld(XMMRegister dst, XMMRegister src, uint8_t imm8); void vpsrld(XMMRegister dst, XMMRegister src, uint8_t imm8);
void vpsraw(XMMRegister dst, XMMRegister src, uint8_t imm8); void vpsraw(XMMRegister dst, XMMRegister src, uint8_t imm8);
......
...@@ -31,10 +31,12 @@ ...@@ -31,10 +31,12 @@
V(por, 66, 0F, EB) \ V(por, 66, 0F, EB) \
V(psllw, 66, 0F, F1) \ V(psllw, 66, 0F, F1) \
V(pslld, 66, 0F, F2) \ V(pslld, 66, 0F, F2) \
V(psllq, 66, 0F, F3) \
V(psraw, 66, 0F, E1) \ V(psraw, 66, 0F, E1) \
V(psrad, 66, 0F, E2) \ V(psrad, 66, 0F, E2) \
V(psrlw, 66, 0F, D1) \ V(psrlw, 66, 0F, D1) \
V(psrld, 66, 0F, D2) \ V(psrld, 66, 0F, D2) \
V(psrlq, 66, 0F, D3) \
V(psubb, 66, 0F, F8) \ V(psubb, 66, 0F, F8) \
V(psubw, 66, 0F, F9) \ V(psubw, 66, 0F, F9) \
V(psubd, 66, 0F, FA) \ V(psubd, 66, 0F, FA) \
......
...@@ -2259,13 +2259,6 @@ int DisassemblerIA32::InstructionDecode(v8::internal::Vector<char> out_buffer, ...@@ -2259,13 +2259,6 @@ int DisassemblerIA32::InstructionDecode(v8::internal::Vector<char> out_buffer,
} else if (*data == 0x90) { } else if (*data == 0x90) {
data++; data++;
AppendToBuffer("nop"); // 2 byte nop. AppendToBuffer("nop"); // 2 byte nop.
} else if (*data == 0xF3) {
data++;
int mod, regop, rm;
get_modrm(*data, &mod, &regop, &rm);
AppendToBuffer("psllq %s,%s", NameOfXMMRegister(regop),
NameOfXMMRegister(rm));
data++;
} else if (*data == 0x71) { } else if (*data == 0x71) {
data++; data++;
int mod, regop, rm; int mod, regop, rm;
...@@ -2291,13 +2284,6 @@ int DisassemblerIA32::InstructionDecode(v8::internal::Vector<char> out_buffer, ...@@ -2291,13 +2284,6 @@ int DisassemblerIA32::InstructionDecode(v8::internal::Vector<char> out_buffer,
AppendToBuffer("ps%sq %s,%d", sf_str[regop / 2], AppendToBuffer("ps%sq %s,%d", sf_str[regop / 2],
NameOfXMMRegister(rm), static_cast<int>(imm8)); NameOfXMMRegister(rm), static_cast<int>(imm8));
data += 2; data += 2;
} else if (*data == 0xD3) {
data++;
int mod, regop, rm;
get_modrm(*data, &mod, &regop, &rm);
AppendToBuffer("psrlq %s,%s", NameOfXMMRegister(regop),
NameOfXMMRegister(rm));
data++;
} else if (*data == 0x7F) { } else if (*data == 0x7F) {
AppendToBuffer("movdqa "); AppendToBuffer("movdqa ");
data++; data++;
......
...@@ -535,9 +535,7 @@ TEST(DisasmIa320) { ...@@ -535,9 +535,7 @@ TEST(DisasmIa320) {
__ psraw(xmm0, 17); __ psraw(xmm0, 17);
__ psrad(xmm0, 17); __ psrad(xmm0, 17);
__ psllq(xmm0, 17); __ psllq(xmm0, 17);
__ psllq(xmm0, xmm1);
__ psrlq(xmm0, 17); __ psrlq(xmm0, 17);
__ psrlq(xmm0, xmm1);
__ pshufhw(xmm5, xmm1, 5); __ pshufhw(xmm5, xmm1, 5);
__ pshufhw(xmm5, Operand(edx, 4), 5); __ pshufhw(xmm5, Operand(edx, 4), 5);
...@@ -735,6 +733,7 @@ TEST(DisasmIa320) { ...@@ -735,6 +733,7 @@ TEST(DisasmIa320) {
__ vpsllw(xmm0, xmm7, 21); __ vpsllw(xmm0, xmm7, 21);
__ vpslld(xmm0, xmm7, 21); __ vpslld(xmm0, xmm7, 21);
__ vpsllq(xmm0, xmm7, 21);
__ vpsrlw(xmm0, xmm7, 21); __ vpsrlw(xmm0, xmm7, 21);
__ vpsrld(xmm0, xmm7, 21); __ vpsrld(xmm0, xmm7, 21);
__ vpsrlq(xmm0, xmm7, 21); __ vpsrlq(xmm0, xmm7, 21);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment