[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-hotspot-compiler-dev
Subject:    Re: RFR: 8302906: AArch64: Add SVE backend support for vector unsigned comparison
From:       Chang Peng <duke () openjdk ! org>
Date:       2023-02-27 3:04:03
Message-ID: v2tE_Gd0wl5YMwWB9a2k6_rM2hfPvfGZHDbETzevt2M=.16e0a22f-e940-4428-a4e9-131163c290f5 () github ! com
[Download RAW message or body]

On Thu, 23 Feb 2023 11:05:11 GMT, Andrew Haley <aph@openjdk.org> wrote:

> > This patch implements unsigned vector comparison on SVE.
> > 
> > 1: Test:
> > All vector API test cases[1][2] passed without new failure. Existing test cases \
> > can cover all unsigned comparison conditions for all kinds of vector. 
> > 2: Performance:
> > (1): Benchmark:
> > As existing benchmarks in panama repo (such as [3]) have some issues [4] (We will \
> > fix them in a separate patch.), I collected performance data with a reduced jmh \
> > benchmark [5]. e.g. for ByteVector unsigned comparison: 
> > 
> > @Benchmark
> > public void byteVectorUnsignedCompare() {
> > for (int j = 0; j < 200; j++) {
> > for (int i = 0; i < bspecies.length(); i++) {
> > ByteVector av = ByteVector.fromArray(bspecies, ba, i);
> > ByteVector ca = ByteVector.fromArray(bspecies, bb, i);
> > av.compare(VectorOperators.UNSIGNED_GT, ca).intoArray(br, i);
> > }
> > }
> > }
> > 
> > 
> > (2): Performance data
> > 
> > Before:
> > 
> > 
> > Benchmark                               Score(op/ms)     Error
> > ByteVector.UNSIGNED_GT#size(1024)       4.846            3.419
> > ShortVector.UNSIGNED_GE#size(1024)      3.055            1.369
> > IntVector.UNSIGNED_LT#size(1024)        3.475            1.269
> > LongVector.UNSIGNED_LE#size(1024)       4.515            1.812
> > 
> > 
> > After:
> > 
> > 
> > Benchmark                               Score(op/ms)     Error
> > ByteVector.UNSIGNED_GT#size(1024)       493.937          1.389
> > ShortVector.UNSIGNED_GE#size(1024)      5308.796         20.557
> > IntVector.UNSIGNED_LT#size(1024)        4944.744         10.606
> > LongVector.UNSIGNED_LE#size(1024)       8459.605         28.683
> > 
> > 
> > [1] https://github.com/openjdk/jdk/tree/master/test/jdk/jdk/incubator/vector
> > [2] https://github.com/openjdk/jdk/tree/master/test/hotspot/jtreg/compiler/vectorapi
> >  [3] https://github.com/openjdk/panama-vector/blob/2aade73adeabdf6a924136b17fd96cc \
> > c95c1d160/test/micro/org/openjdk/bench/jdk/incubator/vector/operation/ByteMaxVector.java#L1459
> >  [4] https://bugs.openjdk.org/browse/JDK-8282850
> > [5] https://gist.github.com/changpeng1997/d311127e1015c107197f9b56a92b0fae
> 
> src/hotspot/cpu/aarch64/c2_MacroAssembler_aarch64.cpp line 1123:
> 
> > 1121:     case BoolTest::uge: condition = Assembler::HS; break;
> > 1122:     case BoolTest::ult: z1 = zm; z2 = zn; condition = Assembler::HI; break;
> > 1123:     case BoolTest::ule: z1 = zm; z2 = zn; condition = Assembler::HS; break;
> 
> I'm sure you already know what to do here.

Ok, thanks. I will remove these switch-case statements.

-------------

PR: https://git.openjdk.org/jdk/pull/12725


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic