--- old/src/hotspot/cpu/aarch64/c1_Runtime1_aarch64.cpp 2018-07-09 18:34:55.360566087 +0300 +++ new/src/hotspot/cpu/aarch64/c1_Runtime1_aarch64.cpp 2018-07-09 18:34:55.164553579 +0300 @@ -709,7 +709,7 @@ { Label ok, not_ok; __ ldrw(obj_size, Address(klass, Klass::layout_helper_offset())); - __ cmp(obj_size, 0u); + __ cmp(obj_size, (unsigned char)0); __ br(Assembler::LE, not_ok); // make sure it's an instance (LH > 0) __ tstw(obj_size, Klass::_lh_instance_slow_path_bit); __ br(Assembler::EQ, ok); --- old/src/hotspot/cpu/aarch64/interp_masm_aarch64.cpp 2018-07-09 18:34:55.884599525 +0300 +++ new/src/hotspot/cpu/aarch64/interp_masm_aarch64.cpp 2018-07-09 18:34:55.704588039 +0300 @@ -1758,7 +1758,7 @@ br(Assembler::EQ, do_profile); get_method(tmp); ldrh(rscratch1, Address(tmp, Method::intrinsic_id_offset_in_bytes())); - cmp(rscratch1, vmIntrinsics::_compiledLambdaForm); + subs(zr, rscratch1, vmIntrinsics::_compiledLambdaForm); br(Assembler::NE, profile_continue); bind(do_profile); --- old/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp 2018-07-09 18:34:56.384631431 +0300 +++ new/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp 2018-07-09 18:34:56.208620200 +0300 @@ -4357,7 +4357,7 @@ cmp(cnt1, 8); // Use Linear Scan if cnt1 < 8 || cnt1 >= 256 br(LT, LINEARSEARCH); dup(v0, T16B, cnt1); // done in separate FPU pipeline. Almost no penalty - cmp(cnt1, 256); + subs(zr, cnt1, 256); lsr(tmp1, cnt2, 2); ccmp(cnt1, tmp1, 0b0000, LT); // Source must be 4 * pattern for BM br(GE, LINEARSTUB); @@ -4463,7 +4463,7 @@ BIND(BCLOOP); (this->*str1_load_1chr)(ch1, Address(post(tmp3, str1_chr_size))); if (!str1_isL) { - cmp(ch1, ASIZE); + subs(zr, ch1, ASIZE); br(HS, BCSKIP); } strb(ch2, Address(sp, ch1)); @@ -4527,7 +4527,7 @@ } else { mov(result_tmp, 1); } - cmp(skipch, ASIZE); + subs(zr, skipch, ASIZE); br(HS, BMADV); } ldrb(result_tmp, Address(sp, skipch)); // load skip distance --- old/src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp 2018-07-09 18:34:56.856661551 +0300 +++ new/src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp 2018-07-09 18:34:56.680650320 +0300 @@ -180,8 +180,8 @@ template inline void cmpw(Register Rd, T imm) { subsw(zr, Rd, imm); } - // imm is limited to 12 bits. - inline void cmp(Register Rd, unsigned imm) { subs(zr, Rd, imm); } + + inline void cmp(Register Rd, unsigned char imm8) { subs(zr, Rd, imm8); } inline void cmnw(Register Rd, unsigned imm) { addsw(zr, Rd, imm); } inline void cmn(Register Rd, unsigned imm) { adds(zr, Rd, imm); } --- old/src/hotspot/cpu/aarch64/macroAssembler_aarch64_log.cpp 2018-07-09 18:34:57.324691415 +0300 +++ new/src/hotspot/cpu/aarch64/macroAssembler_aarch64_log.cpp 2018-07-09 18:34:57.144679929 +0300 @@ -292,7 +292,7 @@ // vtmp1 = AS_DOUBLE_BITS(0x77F0 << 48 | mantissa(X)) == mx fmovd(vtmp1, tmp4); subw(tmp2, tmp2, 16); - cmp(tmp2, 0x8000); + subs(zr, tmp2, 0x8000); br(GE, SMALL_VALUE); bind(MAIN); fmovs(tmp3, vtmp5); // int intB0 = AS_INT_BITS(B); --- old/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp 2018-07-09 18:34:57.780720514 +0300 +++ new/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp 2018-07-09 18:34:57.600709028 +0300 @@ -265,7 +265,7 @@ { Label L; __ ldr(rscratch1, Address(rthread, in_bytes(Thread::pending_exception_offset()))); - __ cmp(rscratch1, (unsigned)NULL_WORD); + __ cmp(rscratch1, (unsigned char)NULL_WORD); __ br(Assembler::EQ, L); __ stop("StubRoutines::call_stub: entered with pending exception"); __ BIND(L); @@ -4106,7 +4106,7 @@ __ ldr(tmp3, Address(__ post(cnt1, 8))); if (SoftwarePrefetchHintDistance >= 0) { - __ cmp(cnt2, prefetchLoopExitCondition); + __ subs(rscratch2, cnt2, prefetchLoopExitCondition); __ br(__ LT, SMALL_LOOP); __ bind(LARGE_LOOP_PREFETCH); __ prfm(Address(tmp2, SoftwarePrefetchHintDistance)); @@ -4123,7 +4123,7 @@ __ subs(tmp4, tmp4, 1); __ br(__ GT, LARGE_LOOP_PREFETCH_REPEAT2); __ sub(cnt2, cnt2, 64); - __ cmp(cnt2, prefetchLoopExitCondition); + __ subs(rscratch2, cnt2, prefetchLoopExitCondition); __ br(__ GE, LARGE_LOOP_PREFETCH); } __ cbz(cnt2, LOAD_LAST); // no characters left except last load @@ -4240,7 +4240,7 @@ compare_string_16_bytes_same(DIFF, DIFF2); __ sub(cnt2, cnt2, isLL ? 64 : 32); compare_string_16_bytes_same(DIFF, DIFF2); - __ cmp(cnt2, largeLoopExitCondition); + __ subs(rscratch2, cnt2, largeLoopExitCondition); compare_string_16_bytes_same(DIFF, DIFF2); __ br(__ GT, LARGE_LOOP_PREFETCH); __ cbz(cnt2, LAST_CHECK_AND_LENGTH_DIFF); // no more chars left? @@ -4659,7 +4659,7 @@ __ zip1(v2, __ T16B, v2, v0); __ st1(v1, v2, __ T16B, __ post(dst, 32)); __ ld1(v3, v4, v5, v6, __ T16B, Address(__ post(src, 64))); - __ cmp(octetCounter, large_loop_threshold); + __ subs(rscratch1, octetCounter, large_loop_threshold); __ br(__ LE, LOOP_START); __ b(LOOP_PRFM_START); __ bind(LOOP_PRFM); @@ -4667,7 +4667,7 @@ __ bind(LOOP_PRFM_START); __ prfm(Address(src, SoftwarePrefetchHintDistance)); __ sub(octetCounter, octetCounter, 8); - __ cmp(octetCounter, large_loop_threshold); + __ subs(rscratch1, octetCounter, large_loop_threshold); inflate_and_store_2_fp_registers(true, v3, v4); inflate_and_store_2_fp_registers(true, v5, v6); __ br(__ GT, LOOP_PRFM);