Skip to content
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

disassembler addv instruction #20776

Merged
merged 1 commit into from
Jan 25, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions compiler/src/dmd/backend/arm/disasmarm.d
Original file line number Diff line number Diff line change
Expand Up @@ -1857,12 +1857,21 @@ void disassemble(uint c) @trusted
uint Rd = field(ins, 4, 0);
//printf("ins:%08x Q:%d U:%d size:%d opcode:%x Rn:%d Rd:%d\n", ins, Q, U, size, opcode, Rn, Rd);

if (U == 1 && opcode == 3)
immutable string[8] sizeQ = ["8b","16b","4h","8h","","4s","",""];

if (U == 0 && opcode == 0x1B) // https://www.scs.stanford.edu/~zyedidia/arm64/addv_advsimd.html
{
p1 = "addv";
p2 = fregString(rbuf[0 .. 4], "bhs "[size], Rd);

uint n = snprintf(buf.ptr, cast(uint)buf.length, "v%d.%s", Rn, sizeQ[size * 2 + Q].ptr);
p3 = buf[0 .. n];
}
else if (U == 1 && opcode == 3) // https://www.scs.stanford.edu/~zyedidia/arm64/uaddlv_advsimd.html
{
p1 = "uaddlv";
p2 = fregString(rbuf[0 .. 4], "hsd "[size], Rd);

immutable string[8] sizeQ = ["8b","16b","4h","8h","","4s","",""];
uint n = snprintf(buf.ptr, cast(uint)buf.length, "v%d.%s", Rn, sizeQ[size * 2 + Q].ptr);
p3 = buf[0 .. n];
}
Expand Down Expand Up @@ -2759,8 +2768,9 @@ unittest
unittest
{
int line64 = __LINE__;
string[65] cases64 = // 64 bit code gen
string[66] cases64 = // 64 bit code gen
[
"0E 31 BB FF addv b31,v31.8b",
"2E 30 38 00 uaddlv h0,v0.8b",
"0E 20 58 00 cnt v0.8b,v0.8b",
"1E 27 01 00 fmov s0,w8",
Expand Down
Loading