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
Backport-of: cc2b79270445ccfb2181894fed2edfd4518a2904
  • Loading branch information
GoeLin committed Aug 1, 2022
1 parent 3822bbd commit b9749f4
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 @@ -3361,7 +3361,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 @@ -3424,7 +3424,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 @@ -3658,7 +3658,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 @@ -3721,7 +3721,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 @@ -206,8 +206,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

1 comment on commit b9749f4

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

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

Please sign in to comment.