RFR: 8334078: RISC-V: TestIntVect.java fails after JDK-8332153 when running without RVV

Hamlin Li mli at openjdk.org
Mon Jun 17 10:14:14 UTC 2024


On Sat, 15 Jun 2024 06:50:51 GMT, Gui Cao <gcao at openjdk.org> wrote:

>> Yes, rv* is much better, I'm OK with this renaming.
>> 
>> At the same time, can you fix `WHITE_BOX.getCPUFeatures()` with `CPUInfo.getFeatures()` in IREncodingPrinter.java? As I think it's the final fix for this kind of issue. As I said, with a `String.contains(xxx)`, it could fail with other cpu features in the future, as it mixes all cpu features in one long string, and there is no guarantee the similar issue will not happen again.
>
>> Yes, rv* is much better, I'm OK with this renaming.
>> 
>> At the same time, can you fix `WHITE_BOX.getCPUFeatures()` with `CPUInfo.getFeatures()` in IREncodingPrinter.java? As I think it's the final fix for this kind of issue. As I said, with a `String.contains(xxx)`, it could fail with other cpu features in the future, as it mixes all cpu features in one long string, and there is no guarantee the similar issue will not happen again.
> 
> When I modify it this way, x86 fastdebug has some errors.
> ``` diff
> diff --git a/test/hotspot/jtreg/compiler/lib/ir_framework/test/IREncodingPrinter.java b/test/hotspot/jtreg/compiler/lib/ir_framework/test/IREncodingPrinter.java
> index 73943db3f53..03eba7c6c2c 100644
> --- a/test/hotspot/jtreg/compiler/lib/ir_framework/test/IREncodingPrinter.java
> +++ b/test/hotspot/jtreg/compiler/lib/ir_framework/test/IREncodingPrinter.java
> @@ -29,6 +29,7 @@
>  import compiler.lib.ir_framework.shared.*;
>  import jdk.test.lib.Platform;
>  import jdk.test.whitebox.WhiteBox;
> +import jdk.test.whitebox.cpuinfo.CPUInfo;
>  
>  import java.lang.reflect.Method;
>  import java.nio.ByteOrder;
> @@ -416,7 +417,7 @@ private boolean checkCPUFeature(String feature, String value) {
>              TestFormat.failNoThrow("Provided incorrect value for feature " + feature + failAt());
>              return false;
>          }
> -        String cpuFeatures = WHITE_BOX.getCPUFeatures();
> +        List<String> cpuFeatures = CPUInfo.getFeatures();
>          return (trueValue && cpuFeatures.contains(feature)) || (falseValue && !cpuFeatures.contains(feature));
>      }
>  
> 
> 
> 
> cpu info:
> 
> processor	: 127
> vendor_id	: GenuineIntel
> cpu family	: 6
> model		: 106
> model name	: Intel(R) Xeon(R) Platinum 8378C CPU @ 2.80GHz
> stepping	: 6
> microcode	: 0x1
> cpu MHz		: 2799.998
> cache size	: 58368 KB
> physical id	: 1
> siblings	: 64
> core id		: 31
> cpu cores	: 32
> apicid		: 127
> initial apicid	: 127
> fpu		: yes
> fpu_exception	: yes
> cpuid level	: 13
> wp		: yes
> flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc rep_good nopl xtopology nonstop_tsc cpuid tsc_known_freq pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch cpuid_fault invpcid_single ssbd ibrs ibpb stibp ibrs_enhanced fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid avx512f avx512dq rdseed adx smap avx512ifma clflushopt clwb avx512cd sha_ni avx512bw avx512vl xsave...

I see, thanks for updating.
I guess there could be other potential issues in the future, but it's related to existing, I don't have good simle solution for it.
Let's move forward with this one.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/19686#discussion_r1642567012


More information about the hotspot-dev mailing list