RFR: 8315841: RISC-V: Check for hardware TSO support [v4]

Robbin Ehn rehn at openjdk.org
Fri Sep 8 05:02:44 UTC 2023


On Thu, 7 Sep 2023 12:53:12 GMT, Ludovic Henry <luhenry at openjdk.org> wrote:

>> src/hotspot/cpu/riscv/vm_version_riscv.cpp line 213:
>> 
>>> 211:   }
>>> 212: 
>>> 213: #if defined(TARGET_ZTSO) && TARGET_ZTSO
>> 
>> If someone compiles with "CXXFLAGS=-marchrv64....ztso..", we need to try to parse the supplied flags, that doesn't seem like fun.
>> Instead I suggest we add code to read-out the elf flags, i.e:
>> "Flags:                             0x15, RVC, double-float ABI, TSO"
>> 
>> And set UseZtso:
>> A: If this is a TSO elf.
>> B: If hwprobe says this TSO hardware (either directly or via vendor).
>> C: If someone set flag,
>> 
>> I guess your idea was to have a flag like --enable-tso which sets TARGET_TSO ?
>> If we have that or not I still like above to happen.
>> 
>> (I'm not saying you should do any of this in this PR, I can file new ones)
>
> `TARGET_TSO` is set by gcc directly. See https://www.mail-archive.com/gcc-patches@gcc.gnu.org/msg281514.html

Both llvm/gcc should define __riscv_ztso if this is compiled with tso. (@luhenry already updated PR)
Which means point A look in elf would never be needed,
B and C are already done in this PR.

Thanks for the update @luhenry !

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

PR Review Comment: https://git.openjdk.org/jdk/pull/15613#discussion_r1319355722


More information about the hotspot-dev mailing list