RFR: 8300253: Introduce AArch64 nzcv accessors [v2]

Hao Sun haosun at openjdk.org
Fri Jan 20 02:09:44 UTC 2023


On Thu, 19 Jan 2023 10:18:53 GMT, Erik Österlund <eosterlund at openjdk.org> wrote:

>> Some code, such as verification code, might want to run without changing the state of the system. To do that, it's useful to be able to get and set the nzcv flags. This enhancement aims at adding accessors for that.
>
> Erik Österlund has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Add test

test/hotspot/gtest/aarch64/aarch64-asmtest.py line 1462:

> 1460: for system_reg in ["fpsr", "dczid_el0", "ctr_el0", "nzcv"]:
> 1461:     generate (SystemOneRegOp, [ ["msr", system_reg] ])
> 1462:     generate (OneRegSystemOp, [ ["mrs", system_reg] ])

Suggestion:

for system_reg in ["fpsr", "nzcv"]:
    generate (SystemOneRegOp, [ ["msr", system_reg] ])
 
for system_reg in ["fpsr", "dczid_el0", "ctr_el0", "nzcv"]:
    generate (OneRegSystemOp, [ ["mrs", system_reg] ])


1. `asmtest.out.h` should be updated as well. Note that it's generated by running `aarch64-asmtest.py` script.
2. There are no instructions to "set/update" `dczid_el0` or `ctr_el0` in `macroAssembler_aarch64.hpp`. Here shows the warnings of running `python2 aarch64-asmtest.py`:

aarch64ops.s: Assembler messages:
aarch64ops.s:202: Warning: specified register cannot be written to at operand 1 -- `msr dczid_el0,x27'
aarch64ops.s:206: Warning: specified register cannot be written to at operand 1 -- `msr ctr_el0,x11'

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

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


More information about the hotspot-dev mailing list