Skip to content

Commit

Permalink
[a64] Replace instances of MOV+DUP-splats to MOVI`
Browse files Browse the repository at this point in the history
These `MOV`->`DUP` splats can just be a singular `MOVI` instruction
  • Loading branch information
Wunkolo committed Jun 23, 2024
1 parent 2953e2e commit 3acd0a3
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions src/xenia/cpu/backend/a64/a64_seq_vector.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1138,13 +1138,11 @@ struct PERMUTE_V128
}

// Indices must be endian-swapped
e.MOV(W0, 0b11);
e.DUP(Q1.B16(), W0);
e.MOVI(Q1.B16(), 0b11);
e.EOR(indices.B16(), indices.B16(), Q1.B16());

// Modulo 32 the indices
e.MOV(W0, 0b0001'1111);
e.DUP(Q1.B16(), W0);
e.MOVI(Q1.B16(), 0b0001'1111);
e.AND(indices.B16(), indices.B16(), Q1.B16());

// Table-registers must be sequential indices
Expand Down Expand Up @@ -1186,22 +1184,18 @@ struct PERMUTE_V128
}

// Indices must be endian-swapped
e.MOV(W0, 0b1);
e.DUP(Q1.H8(), W0);
e.MOVI(Q1.H8(), 0b1);
e.EOR(indices.B16(), indices.B16(), Q1.B16());

// Modulo-16 the indices
e.MOV(W0, 0b0000'1111);
e.DUP(Q1.H8(), W0);
e.MOVI(Q1.H8(), 0b0000'1111);
e.AND(indices.B16(), indices.B16(), Q1.B16());

// Convert int16 indices into int8
e.MOV(W0, 0x02'02);
e.DUP(Q1.H8(), W0);
e.MOVI(Q1.B16(), 0x02);
e.MUL(indices.H8(), indices.H8(), Q1.H8());

e.MOV(W0, 0x01'00);
e.DUP(Q1.H8(), W0);
e.MOVI(Q1.H8(), 0x01, LSL, 8);
e.ADD(indices.H8(), indices.H8(), Q1.H8());

// Table-registers must be sequential indices
Expand Down

0 comments on commit 3acd0a3

Please sign in to comment.