Skip to content

Commit

Permalink
8288992: AArch64: CMN should be handled the same way as CMP
Browse files Browse the repository at this point in the history
Reviewed-by: adinn, ngasson
  • Loading branch information
Andrew Haley committed Jul 6, 2022
1 parent 75c0a5b commit cc2b792
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3370,7 +3370,7 @@ void MacroAssembler::kernel_crc32_using_crc32(Register crc, Register buf,
crc32x(crc, crc, tmp2);
crc32x(crc, crc, tmp3);
br(Assembler::GE, CRC_by32_loop);
cmn(len, 32);
cmn(len, (u1)32);
br(Assembler::NE, CRC_less32);
b(L_exit);

Expand Down Expand Up @@ -3433,7 +3433,7 @@ void MacroAssembler::kernel_crc32_using_crc32(Register crc, Register buf,

sub(len, len, 64);
add(buf, buf, 8);
cmn(len, 128);
cmn(len, (u1)128);
br(Assembler::NE, CRC_less64);
BIND(L_exit);
mvnw(crc, crc);
Expand Down Expand Up @@ -3667,7 +3667,7 @@ void MacroAssembler::kernel_crc32c_using_crc32c(Register crc, Register buf,
crc32cx(crc, crc, tmp2);
crc32cx(crc, crc, tmp3);
br(Assembler::GE, CRC_by32_loop);
cmn(len, 32);
cmn(len, (u1)32);
br(Assembler::NE, CRC_less32);
b(L_exit);

Expand Down Expand Up @@ -3730,7 +3730,7 @@ void MacroAssembler::kernel_crc32c_using_crc32c(Register crc, Register buf,

sub(len, len, 64);
add(buf, buf, 8);
cmn(len, 128);
cmn(len, (u1)128);
br(Assembler::NE, CRC_less64);
BIND(L_exit);
}
Expand Down
7 changes: 5 additions & 2 deletions src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,11 @@ class MacroAssembler: public Assembler {
inline void cmp(Register Rd, unsigned char imm8) { subs(zr, Rd, imm8); }
inline void cmp(Register Rd, unsigned imm) = delete;

inline void cmnw(Register Rd, unsigned imm) { addsw(zr, Rd, imm); }
inline void cmn(Register Rd, unsigned imm) { adds(zr, Rd, imm); }
template<class T>
inline void cmnw(Register Rd, T imm) { addsw(zr, Rd, imm); }

inline void cmn(Register Rd, unsigned char imm8) { adds(zr, Rd, imm8); }
inline void cmn(Register Rd, unsigned imm) = delete;

void cset(Register Rd, Assembler::Condition cond) {
csinc(Rd, zr, zr, ~cond);
Expand Down

3 comments on commit cc2b792

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@GoeLin
Copy link
Member

@GoeLin GoeLin commented on cc2b792 Jul 28, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/backport jdk17u-dev

@openjdk
Copy link

@openjdk openjdk bot commented on cc2b792 Jul 28, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@GoeLin the backport was successfully created on the branch GoeLin-backport-cc2b7927 in my personal fork of openjdk/jdk17u-dev. To create a pull request with this backport targeting openjdk/jdk17u-dev:master, just click the following link:

➡️ Create pull request

The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:

Hi all,

This pull request contains a backport of commit cc2b7927 from the openjdk/jdk repository.

The commit being backported was authored by Andrew Haley on 6 Jul 2022 and was reviewed by Andrew Dinn and Nick Gasson.

Thanks!

If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jdk17u-dev:

$ git fetch https://github.com/openjdk-bots/jdk17u-dev GoeLin-backport-cc2b7927:GoeLin-backport-cc2b7927
$ git checkout GoeLin-backport-cc2b7927
# make changes
$ git add paths/to/changed/files
$ git commit --message 'Describe additional changes made'
$ git push https://github.com/openjdk-bots/jdk17u-dev GoeLin-backport-cc2b7927

Please sign in to comment.