RFR: 8261142: AArch64: Incorrect instruction encoding when right-shifting vectors with shift amount equals to the element width [v9]
Andrew Haley
aph at openjdk.java.net
Tue Feb 23 17:16:41 UTC 2021
On Tue, 23 Feb 2021 10:29:05 GMT, Dong Bo <dongbo at openjdk.org> wrote:
> Hi, @theRealAph
>
> I've rebased the tests so that sshr/ushr/sshl/ssra/usra are accessed in one jtreg `test/hotspot/jtreg/compiler/vectorapi/TestVectorShiftImm.java`.
> Local tests by manually injected error shows all instructions are covered by the jtreg case. Suggestions?
I'm not seeing ```sra``` used anywhere.
The problem I see with the tests is that the methods are large. This causes C2 to do a lot of spilling. Also, because the resuling code is intertwined and complex, it's very hard to debug.
It would be far better to do something like this:
void long_shift_add(long arrLongs[][], LongVector vba, LongVector vbb, int i) {
vba.add(vbb.lanewise(VectorOperators.LSHR, 37)).intoArray(arrLongs[op], 2 * i);
vba.add(vbb.lanewise(VectorOperators.LSHR, 64)).intoArray(arrLongs[op + 1], 2 * i);
vba.add(vbb.lanewise(VectorOperators.LSHR, 99)).intoArray(arrLongs[op + 2], 2 * i);
vba.add(vbb.lanewise(VectorOperators.LSHR, 128)).intoArray(arrLongs[op + 3], 2 * i);
vba.add(vbb.lanewise(VectorOperators.LSHR, 157)).intoArray(arrLongs[op + 4], 2 * i);
vba.add(vbb.lanewise(VectorOperators.LSHR, 192)).intoArray(arrLongs[op + 5], 2 * i);
}
-------------
PR: https://git.openjdk.java.net/jdk/pull/2472
More information about the hotspot-compiler-dev
mailing list