Skip to content
This repository was archived by the owner on Aug 27, 2022. It is now read-only.
/ lanai Public archive

Commit a21c4fb

Browse files
author
Pengfei Li
committedApr 3, 2020
8241475: AArch64: Add missing support for PopCountVI node
Reviewed-by: aph, njian
1 parent 934b8a9 commit a21c4fb

File tree

2 files changed

+43
-3
lines changed

2 files changed

+43
-3
lines changed
 

‎src/hotspot/cpu/aarch64/aarch64.ad

+38
Original file line numberDiff line numberDiff line change
@@ -17992,6 +17992,44 @@ instruct vround2D_reg(vecX dst, vecX src, immI rmode) %{
1799217992
ins_pipe(vdop_fp128);
1799317993
%}
1799417994

17995+
instruct vpopcount4I(vecX dst, vecX src) %{
17996+
predicate(UsePopCountInstruction && n->as_Vector()->length() == 4);
17997+
match(Set dst (PopCountVI src));
17998+
format %{
17999+
"cnt $dst, $src\t# vector (16B)\n\t"
18000+
"uaddlp $dst, $dst\t# vector (16B)\n\t"
18001+
"uaddlp $dst, $dst\t# vector (8H)"
18002+
%}
18003+
ins_encode %{
18004+
__ cnt(as_FloatRegister($dst$$reg), __ T16B,
18005+
as_FloatRegister($src$$reg));
18006+
__ uaddlp(as_FloatRegister($dst$$reg), __ T16B,
18007+
as_FloatRegister($dst$$reg));
18008+
__ uaddlp(as_FloatRegister($dst$$reg), __ T8H,
18009+
as_FloatRegister($dst$$reg));
18010+
%}
18011+
ins_pipe(pipe_class_default);
18012+
%}
18013+
18014+
instruct vpopcount2I(vecD dst, vecD src) %{
18015+
predicate(UsePopCountInstruction && n->as_Vector()->length() == 2);
18016+
match(Set dst (PopCountVI src));
18017+
format %{
18018+
"cnt $dst, $src\t# vector (8B)\n\t"
18019+
"uaddlp $dst, $dst\t# vector (8B)\n\t"
18020+
"uaddlp $dst, $dst\t# vector (4H)"
18021+
%}
18022+
ins_encode %{
18023+
__ cnt(as_FloatRegister($dst$$reg), __ T8B,
18024+
as_FloatRegister($src$$reg));
18025+
__ uaddlp(as_FloatRegister($dst$$reg), __ T8B,
18026+
as_FloatRegister($dst$$reg));
18027+
__ uaddlp(as_FloatRegister($dst$$reg), __ T4H,
18028+
as_FloatRegister($dst$$reg));
18029+
%}
18030+
ins_pipe(pipe_class_default);
18031+
%}
18032+
1799518033
//----------PEEPHOLE RULES-----------------------------------------------------
1799618034
// These must follow all instruction definitions as they use the names
1799718035
// defined in the instructions definitions.

‎src/hotspot/cpu/aarch64/assembler_aarch64.hpp

+5-3
Original file line numberDiff line numberDiff line change
@@ -2269,21 +2269,23 @@ void mvnw(Register Rd, Register Rm,
22692269
#define INSN(NAME, opc, opc2, accepted) \
22702270
void NAME(FloatRegister Vd, SIMD_Arrangement T, FloatRegister Vn) { \
22712271
guarantee(T != T1Q && T != T1D, "incorrect arrangement"); \
2272-
if (accepted < 2) guarantee(T != T2S && T != T2D, "incorrect arrangement"); \
2273-
if (accepted == 0) guarantee(T == T8B || T == T16B, "incorrect arrangement"); \
2272+
if (accepted < 3) guarantee(T != T2D, "incorrect arrangement"); \
2273+
if (accepted < 2) guarantee(T != T2S, "incorrect arrangement"); \
2274+
if (accepted < 1) guarantee(T == T8B || T == T16B, "incorrect arrangement"); \
22742275
starti; \
22752276
f(0, 31), f((int)T & 1, 30), f(opc, 29), f(0b01110, 28, 24); \
22762277
f((int)T >> 1, 23, 22), f(opc2, 21, 10); \
22772278
rf(Vn, 5), rf(Vd, 0); \
22782279
}
22792280

22802281
INSN(absr, 0, 0b100000101110, 1); // accepted arrangements: T8B, T16B, T4H, T8H, T4S
2281-
INSN(negr, 1, 0b100000101110, 2); // accepted arrangements: T8B, T16B, T4H, T8H, T2S, T4S, T2D
2282+
INSN(negr, 1, 0b100000101110, 3); // accepted arrangements: T8B, T16B, T4H, T8H, T2S, T4S, T2D
22822283
INSN(notr, 1, 0b100000010110, 0); // accepted arrangements: T8B, T16B
22832284
INSN(addv, 0, 0b110001101110, 1); // accepted arrangements: T8B, T16B, T4H, T8H, T4S
22842285
INSN(cls, 0, 0b100000010010, 1); // accepted arrangements: T8B, T16B, T4H, T8H, T4S
22852286
INSN(clz, 1, 0b100000010010, 1); // accepted arrangements: T8B, T16B, T4H, T8H, T4S
22862287
INSN(cnt, 0, 0b100000010110, 0); // accepted arrangements: T8B, T16B
2288+
INSN(uaddlp, 1, 0b100000001010, 2); // accepted arrangements: T8B, T16B, T4H, T8H, T2S, T4S
22872289
INSN(uaddlv, 1, 0b110000001110, 1); // accepted arrangements: T8B, T16B, T4H, T8H, T4S
22882290

22892291
#undef INSN

0 commit comments

Comments
 (0)