llvm.org GIT mirror llvm / e88f13e
Reapply: [RISCV] Set isAsCheapAsAMove for ADDI, ORI, XORI, LUI This reapplies commit r352010 with RISC-V test fixes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@352237 91177308-0d34-0410-b5e6-96231b3b80d8 Ana Pazos 1 year, 4 months ago
12 changed file(s) with 1603 addition(s) and 2143 deletion(s). Raw diff Collapse all Expand all
446446 }
447447 }
448448 }
449
450 bool RISCVInstrInfo::isAsCheapAsAMove(const MachineInstr &MI) const {
451 const unsigned Opcode = MI.getOpcode();
452 switch(Opcode) {
453 default:
454 break;
455 case RISCV::ADDI:
456 case RISCV::ORI:
457 case RISCV::XORI:
458 return (MI.getOperand(1).isReg() && MI.getOperand(1).getReg() == RISCV::X0);
459 }
460 return MI.isAsCheapAsAMove();
461 }
7777
7878 bool isBranchOffsetInRange(unsigned BranchOpc,
7979 int64_t BrOffset) const override;
80
81 bool isAsCheapAsAMove(const MachineInstr &MI) const override;
8082 };
8183 }
8284 #endif
314314 //===----------------------------------------------------------------------===//
315315
316316 let hasSideEffects = 0, mayLoad = 0, mayStore = 0 in {
317 let isReMaterializable = 1 in
317 let isReMaterializable = 1, isAsCheapAsAMove = 1 in
318318 def LUI : RVInstU
319319 "lui", "$rd, $imm20">;
320320
350350
351351 // ADDI isn't always rematerializable, but isReMaterializable will be used as
352352 // a hint which is verified in isReallyTriviallyReMaterializable.
353 let isReMaterializable = 1 in
353 let isReMaterializable = 1, isAsCheapAsAMove = 1 in
354354 def ADDI : ALU_ri<0b000, "addi">;
355355
356356 def SLTI : ALU_ri<0b010, "slti">;
357357 def SLTIU : ALU_ri<0b011, "sltiu">;
358358
359 let isReMaterializable = 1 in {
359 let isReMaterializable = 1, isAsCheapAsAMove = 1 in {
360360 def XORI : ALU_ri<0b100, "xori">;
361361 def ORI : ALU_ri<0b110, "ori">;
362362 }
171171 ; RV32I-NEXT: sb a1, 11(sp)
172172 ; RV32I-NEXT: addi a1, sp, 11
173173 ; RV32I-NEXT: addi a3, zero, 2
174 ; RV32I-NEXT: mv a4, a3
174 ; RV32I-NEXT: addi a4, zero, 2
175175 ; RV32I-NEXT: call __atomic_compare_exchange_1
176176 ; RV32I-NEXT: lw ra, 12(sp)
177177 ; RV32I-NEXT: addi sp, sp, 16
208208 ; RV64I-NEXT: sb a1, 7(sp)
209209 ; RV64I-NEXT: addi a1, sp, 7
210210 ; RV64I-NEXT: addi a3, zero, 2
211 ; RV64I-NEXT: mv a4, a3
211 ; RV64I-NEXT: addi a4, zero, 2
212212 ; RV64I-NEXT: call __atomic_compare_exchange_1
213213 ; RV64I-NEXT: ld ra, 8(sp)
214214 ; RV64I-NEXT: addi sp, sp, 16
717717 ; RV32I-NEXT: sb a1, 11(sp)
718718 ; RV32I-NEXT: addi a1, sp, 11
719719 ; RV32I-NEXT: addi a3, zero, 5
720 ; RV32I-NEXT: mv a4, a3
720 ; RV32I-NEXT: addi a4, zero, 5
721721 ; RV32I-NEXT: call __atomic_compare_exchange_1
722722 ; RV32I-NEXT: lw ra, 12(sp)
723723 ; RV32I-NEXT: addi sp, sp, 16
754754 ; RV64I-NEXT: sb a1, 7(sp)
755755 ; RV64I-NEXT: addi a1, sp, 7
756756 ; RV64I-NEXT: addi a3, zero, 5
757 ; RV64I-NEXT: mv a4, a3
757 ; RV64I-NEXT: addi a4, zero, 5
758758 ; RV64I-NEXT: call __atomic_compare_exchange_1
759759 ; RV64I-NEXT: ld ra, 8(sp)
760760 ; RV64I-NEXT: addi sp, sp, 16
955955 ; RV32I-NEXT: sh a1, 10(sp)
956956 ; RV32I-NEXT: addi a1, sp, 10
957957 ; RV32I-NEXT: addi a3, zero, 2
958 ; RV32I-NEXT: mv a4, a3
958 ; RV32I-NEXT: addi a4, zero, 2
959959 ; RV32I-NEXT: call __atomic_compare_exchange_2
960960 ; RV32I-NEXT: lw ra, 12(sp)
961961 ; RV32I-NEXT: addi sp, sp, 16
993993 ; RV64I-NEXT: sh a1, 6(sp)
994994 ; RV64I-NEXT: addi a1, sp, 6
995995 ; RV64I-NEXT: addi a3, zero, 2
996 ; RV64I-NEXT: mv a4, a3
996 ; RV64I-NEXT: addi a4, zero, 2
997997 ; RV64I-NEXT: call __atomic_compare_exchange_2
998998 ; RV64I-NEXT: ld ra, 8(sp)
999999 ; RV64I-NEXT: addi sp, sp, 16
15151515 ; RV32I-NEXT: sh a1, 10(sp)
15161516 ; RV32I-NEXT: addi a1, sp, 10
15171517 ; RV32I-NEXT: addi a3, zero, 5
1518 ; RV32I-NEXT: mv a4, a3
1518 ; RV32I-NEXT: addi a4, zero, 5
15191519 ; RV32I-NEXT: call __atomic_compare_exchange_2
15201520 ; RV32I-NEXT: lw ra, 12(sp)
15211521 ; RV32I-NEXT: addi sp, sp, 16
15531553 ; RV64I-NEXT: sh a1, 6(sp)
15541554 ; RV64I-NEXT: addi a1, sp, 6
15551555 ; RV64I-NEXT: addi a3, zero, 5
1556 ; RV64I-NEXT: mv a4, a3
1556 ; RV64I-NEXT: addi a4, zero, 5
15571557 ; RV64I-NEXT: call __atomic_compare_exchange_2
15581558 ; RV64I-NEXT: ld ra, 8(sp)
15591559 ; RV64I-NEXT: addi sp, sp, 16
16991699 ; RV32I-NEXT: sw a1, 8(sp)
17001700 ; RV32I-NEXT: addi a1, sp, 8
17011701 ; RV32I-NEXT: addi a3, zero, 2
1702 ; RV32I-NEXT: mv a4, a3
1702 ; RV32I-NEXT: addi a4, zero, 2
17031703 ; RV32I-NEXT: call __atomic_compare_exchange_4
17041704 ; RV32I-NEXT: lw ra, 12(sp)
17051705 ; RV32I-NEXT: addi sp, sp, 16
17231723 ; RV64I-NEXT: sw a1, 4(sp)
17241724 ; RV64I-NEXT: addi a1, sp, 4
17251725 ; RV64I-NEXT: addi a3, zero, 2
1726 ; RV64I-NEXT: mv a4, a3
1726 ; RV64I-NEXT: addi a4, zero, 2
17271727 ; RV64I-NEXT: call __atomic_compare_exchange_4
17281728 ; RV64I-NEXT: ld ra, 8(sp)
17291729 ; RV64I-NEXT: addi sp, sp, 16
20632063 ; RV32I-NEXT: sw a1, 8(sp)
20642064 ; RV32I-NEXT: addi a1, sp, 8
20652065 ; RV32I-NEXT: addi a3, zero, 5
2066 ; RV32I-NEXT: mv a4, a3
2066 ; RV32I-NEXT: addi a4, zero, 5
20672067 ; RV32I-NEXT: call __atomic_compare_exchange_4
20682068 ; RV32I-NEXT: lw ra, 12(sp)
20692069 ; RV32I-NEXT: addi sp, sp, 16
20872087 ; RV64I-NEXT: sw a1, 4(sp)
20882088 ; RV64I-NEXT: addi a1, sp, 4
20892089 ; RV64I-NEXT: addi a3, zero, 5
2090 ; RV64I-NEXT: mv a4, a3
2090 ; RV64I-NEXT: addi a4, zero, 5
20912091 ; RV64I-NEXT: call __atomic_compare_exchange_4
20922092 ; RV64I-NEXT: ld ra, 8(sp)
20932093 ; RV64I-NEXT: addi sp, sp, 16
21722172 ; RV32I: # %bb.0:
21732173 ; RV32I-NEXT: addi sp, sp, -16
21742174 ; RV32I-NEXT: sw ra, 12(sp)
2175 ; RV32I-NEXT: mv a5, a4
21762175 ; RV32I-NEXT: sw a2, 4(sp)
21772176 ; RV32I-NEXT: sw a1, 0(sp)
21782177 ; RV32I-NEXT: mv a1, sp
2179 ; RV32I-NEXT: addi a4, zero, 2
21802178 ; RV32I-NEXT: mv a2, a3
2181 ; RV32I-NEXT: mv a3, a5
2179 ; RV32I-NEXT: mv a3, a4
2180 ; RV32I-NEXT: addi a4, zero, 2
21822181 ; RV32I-NEXT: mv a5, zero
21832182 ; RV32I-NEXT: call __atomic_compare_exchange_8
21842183 ; RV32I-NEXT: lw ra, 12(sp)
21892188 ; RV32IA: # %bb.0:
21902189 ; RV32IA-NEXT: addi sp, sp, -16
21912190 ; RV32IA-NEXT: sw ra, 12(sp)
2192 ; RV32IA-NEXT: mv a5, a4
21932191 ; RV32IA-NEXT: sw a2, 4(sp)
21942192 ; RV32IA-NEXT: sw a1, 0(sp)
21952193 ; RV32IA-NEXT: mv a1, sp
2194 ; RV32IA-NEXT: mv a2, a3
2195 ; RV32IA-NEXT: mv a3, a4
21962196 ; RV32IA-NEXT: addi a4, zero, 2
2197 ; RV32IA-NEXT: mv a2, a3
2198 ; RV32IA-NEXT: mv a3, a5
21992197 ; RV32IA-NEXT: mv a5, zero
22002198 ; RV32IA-NEXT: call __atomic_compare_exchange_8
22012199 ; RV32IA-NEXT: lw ra, 12(sp)
22372235 ; RV32I-NEXT: sw a2, 4(sp)
22382236 ; RV32I-NEXT: sw a1, 0(sp)
22392237 ; RV32I-NEXT: mv a1, sp
2240 ; RV32I-NEXT: addi a5, zero, 2
22412238 ; RV32I-NEXT: mv a2, a3
22422239 ; RV32I-NEXT: mv a3, a4
2243 ; RV32I-NEXT: mv a4, a5
2240 ; RV32I-NEXT: addi a4, zero, 2
2241 ; RV32I-NEXT: addi a5, zero, 2
22442242 ; RV32I-NEXT: call __atomic_compare_exchange_8
22452243 ; RV32I-NEXT: lw ra, 12(sp)
22462244 ; RV32I-NEXT: addi sp, sp, 16
22532251 ; RV32IA-NEXT: sw a2, 4(sp)
22542252 ; RV32IA-NEXT: sw a1, 0(sp)
22552253 ; RV32IA-NEXT: mv a1, sp
2256 ; RV32IA-NEXT: addi a5, zero, 2
22572254 ; RV32IA-NEXT: mv a2, a3
22582255 ; RV32IA-NEXT: mv a3, a4
2259 ; RV32IA-NEXT: mv a4, a5
2256 ; RV32IA-NEXT: addi a4, zero, 2
2257 ; RV32IA-NEXT: addi a5, zero, 2
22602258 ; RV32IA-NEXT: call __atomic_compare_exchange_8
22612259 ; RV32IA-NEXT: lw ra, 12(sp)
22622260 ; RV32IA-NEXT: addi sp, sp, 16
22692267 ; RV64I-NEXT: sd a1, 0(sp)
22702268 ; RV64I-NEXT: mv a1, sp
22712269 ; RV64I-NEXT: addi a3, zero, 2
2272 ; RV64I-NEXT: mv a4, a3
2270 ; RV64I-NEXT: addi a4, zero, 2
22732271 ; RV64I-NEXT: call __atomic_compare_exchange_8
22742272 ; RV64I-NEXT: ld ra, 8(sp)
22752273 ; RV64I-NEXT: addi sp, sp, 16
22942292 ; RV32I: # %bb.0:
22952293 ; RV32I-NEXT: addi sp, sp, -16
22962294 ; RV32I-NEXT: sw ra, 12(sp)
2297 ; RV32I-NEXT: mv a5, a4
22982295 ; RV32I-NEXT: sw a2, 4(sp)
22992296 ; RV32I-NEXT: sw a1, 0(sp)
23002297 ; RV32I-NEXT: mv a1, sp
2298 ; RV32I-NEXT: mv a2, a3
2299 ; RV32I-NEXT: mv a3, a4
23012300 ; RV32I-NEXT: addi a4, zero, 3
2302 ; RV32I-NEXT: mv a2, a3
2303 ; RV32I-NEXT: mv a3, a5
23042301 ; RV32I-NEXT: mv a5, zero
23052302 ; RV32I-NEXT: call __atomic_compare_exchange_8
23062303 ; RV32I-NEXT: lw ra, 12(sp)
23112308 ; RV32IA: # %bb.0:
23122309 ; RV32IA-NEXT: addi sp, sp, -16
23132310 ; RV32IA-NEXT: sw ra, 12(sp)
2314 ; RV32IA-NEXT: mv a5, a4
23152311 ; RV32IA-NEXT: sw a2, 4(sp)
23162312 ; RV32IA-NEXT: sw a1, 0(sp)
23172313 ; RV32IA-NEXT: mv a1, sp
2314 ; RV32IA-NEXT: mv a2, a3
2315 ; RV32IA-NEXT: mv a3, a4
23182316 ; RV32IA-NEXT: addi a4, zero, 3
2319 ; RV32IA-NEXT: mv a2, a3
2320 ; RV32IA-NEXT: mv a3, a5
23212317 ; RV32IA-NEXT: mv a5, zero
23222318 ; RV32IA-NEXT: call __atomic_compare_exchange_8
23232319 ; RV32IA-NEXT: lw ra, 12(sp)
23562352 ; RV32I: # %bb.0:
23572353 ; RV32I-NEXT: addi sp, sp, -16
23582354 ; RV32I-NEXT: sw ra, 12(sp)
2359 ; RV32I-NEXT: mv a6, a4
23602355 ; RV32I-NEXT: sw a2, 4(sp)
23612356 ; RV32I-NEXT: sw a1, 0(sp)
23622357 ; RV32I-NEXT: mv a1, sp
2358 ; RV32I-NEXT: mv a2, a3
2359 ; RV32I-NEXT: mv a3, a4
23632360 ; RV32I-NEXT: addi a4, zero, 3
23642361 ; RV32I-NEXT: addi a5, zero, 2
2365 ; RV32I-NEXT: mv a2, a3
2366 ; RV32I-NEXT: mv a3, a6
23672362 ; RV32I-NEXT: call __atomic_compare_exchange_8
23682363 ; RV32I-NEXT: lw ra, 12(sp)
23692364 ; RV32I-NEXT: addi sp, sp, 16
23732368 ; RV32IA: # %bb.0:
23742369 ; RV32IA-NEXT: addi sp, sp, -16
23752370 ; RV32IA-NEXT: sw ra, 12(sp)
2376 ; RV32IA-NEXT: mv a6, a4
23772371 ; RV32IA-NEXT: sw a2, 4(sp)
23782372 ; RV32IA-NEXT: sw a1, 0(sp)
23792373 ; RV32IA-NEXT: mv a1, sp
2374 ; RV32IA-NEXT: mv a2, a3
2375 ; RV32IA-NEXT: mv a3, a4
23802376 ; RV32IA-NEXT: addi a4, zero, 3
23812377 ; RV32IA-NEXT: addi a5, zero, 2
2382 ; RV32IA-NEXT: mv a2, a3
2383 ; RV32IA-NEXT: mv a3, a6
23842378 ; RV32IA-NEXT: call __atomic_compare_exchange_8
23852379 ; RV32IA-NEXT: lw ra, 12(sp)
23862380 ; RV32IA-NEXT: addi sp, sp, 16
24182412 ; RV32I: # %bb.0:
24192413 ; RV32I-NEXT: addi sp, sp, -16
24202414 ; RV32I-NEXT: sw ra, 12(sp)
2421 ; RV32I-NEXT: mv a5, a4
24222415 ; RV32I-NEXT: sw a2, 4(sp)
24232416 ; RV32I-NEXT: sw a1, 0(sp)
24242417 ; RV32I-NEXT: mv a1, sp
2418 ; RV32I-NEXT: mv a2, a3
2419 ; RV32I-NEXT: mv a3, a4
24252420 ; RV32I-NEXT: addi a4, zero, 4
2426 ; RV32I-NEXT: mv a2, a3
2427 ; RV32I-NEXT: mv a3, a5
24282421 ; RV32I-NEXT: mv a5, zero
24292422 ; RV32I-NEXT: call __atomic_compare_exchange_8
24302423 ; RV32I-NEXT: lw ra, 12(sp)
24352428 ; RV32IA: # %bb.0:
24362429 ; RV32IA-NEXT: addi sp, sp, -16
24372430 ; RV32IA-NEXT: sw ra, 12(sp)
2438 ; RV32IA-NEXT: mv a5, a4
24392431 ; RV32IA-NEXT: sw a2, 4(sp)
24402432 ; RV32IA-NEXT: sw a1, 0(sp)
24412433 ; RV32IA-NEXT: mv a1, sp
2434 ; RV32IA-NEXT: mv a2, a3
2435 ; RV32IA-NEXT: mv a3, a4
24422436 ; RV32IA-NEXT: addi a4, zero, 4
2443 ; RV32IA-NEXT: mv a2, a3
2444 ; RV32IA-NEXT: mv a3, a5
24452437 ; RV32IA-NEXT: mv a5, zero
24462438 ; RV32IA-NEXT: call __atomic_compare_exchange_8
24472439 ; RV32IA-NEXT: lw ra, 12(sp)
24802472 ; RV32I: # %bb.0:
24812473 ; RV32I-NEXT: addi sp, sp, -16
24822474 ; RV32I-NEXT: sw ra, 12(sp)
2483 ; RV32I-NEXT: mv a6, a4
24842475 ; RV32I-NEXT: sw a2, 4(sp)
24852476 ; RV32I-NEXT: sw a1, 0(sp)
24862477 ; RV32I-NEXT: mv a1, sp
2478 ; RV32I-NEXT: mv a2, a3
2479 ; RV32I-NEXT: mv a3, a4
24872480 ; RV32I-NEXT: addi a4, zero, 4
24882481 ; RV32I-NEXT: addi a5, zero, 2
2489 ; RV32I-NEXT: mv a2, a3
2490 ; RV32I-NEXT: mv a3, a6
24912482 ; RV32I-NEXT: call __atomic_compare_exchange_8
24922483 ; RV32I-NEXT: lw ra, 12(sp)
24932484 ; RV32I-NEXT: addi sp, sp, 16
24972488 ; RV32IA: # %bb.0:
24982489 ; RV32IA-NEXT: addi sp, sp, -16
24992490 ; RV32IA-NEXT: sw ra, 12(sp)
2500 ; RV32IA-NEXT: mv a6, a4
25012491 ; RV32IA-NEXT: sw a2, 4(sp)
25022492 ; RV32IA-NEXT: sw a1, 0(sp)
25032493 ; RV32IA-NEXT: mv a1, sp
2494 ; RV32IA-NEXT: mv a2, a3
2495 ; RV32IA-NEXT: mv a3, a4
25042496 ; RV32IA-NEXT: addi a4, zero, 4
25052497 ; RV32IA-NEXT: addi a5, zero, 2
2506 ; RV32IA-NEXT: mv a2, a3
2507 ; RV32IA-NEXT: mv a3, a6
25082498 ; RV32IA-NEXT: call __atomic_compare_exchange_8
25092499 ; RV32IA-NEXT: lw ra, 12(sp)
25102500 ; RV32IA-NEXT: addi sp, sp, 16
25422532 ; RV32I: # %bb.0:
25432533 ; RV32I-NEXT: addi sp, sp, -16
25442534 ; RV32I-NEXT: sw ra, 12(sp)
2545 ; RV32I-NEXT: mv a5, a4
25462535 ; RV32I-NEXT: sw a2, 4(sp)
25472536 ; RV32I-NEXT: sw a1, 0(sp)
25482537 ; RV32I-NEXT: mv a1, sp
2538 ; RV32I-NEXT: mv a2, a3
2539 ; RV32I-NEXT: mv a3, a4
25492540 ; RV32I-NEXT: addi a4, zero, 5
2550 ; RV32I-NEXT: mv a2, a3
2551 ; RV32I-NEXT: mv a3, a5
25522541 ; RV32I-NEXT: mv a5, zero
25532542 ; RV32I-NEXT: call __atomic_compare_exchange_8
25542543 ; RV32I-NEXT: lw ra, 12(sp)
25592548 ; RV32IA: # %bb.0:
25602549 ; RV32IA-NEXT: addi sp, sp, -16
25612550 ; RV32IA-NEXT: sw ra, 12(sp)
2562 ; RV32IA-NEXT: mv a5, a4
25632551 ; RV32IA-NEXT: sw a2, 4(sp)
25642552 ; RV32IA-NEXT: sw a1, 0(sp)
25652553 ; RV32IA-NEXT: mv a1, sp
2554 ; RV32IA-NEXT: mv a2, a3
2555 ; RV32IA-NEXT: mv a3, a4
25662556 ; RV32IA-NEXT: addi a4, zero, 5
2567 ; RV32IA-NEXT: mv a2, a3
2568 ; RV32IA-NEXT: mv a3, a5
25692557 ; RV32IA-NEXT: mv a5, zero
25702558 ; RV32IA-NEXT: call __atomic_compare_exchange_8
25712559 ; RV32IA-NEXT: lw ra, 12(sp)
26042592 ; RV32I: # %bb.0:
26052593 ; RV32I-NEXT: addi sp, sp, -16
26062594 ; RV32I-NEXT: sw ra, 12(sp)
2607 ; RV32I-NEXT: mv a6, a4
26082595 ; RV32I-NEXT: sw a2, 4(sp)
26092596 ; RV32I-NEXT: sw a1, 0(sp)
26102597 ; RV32I-NEXT: mv a1, sp
2598 ; RV32I-NEXT: mv a2, a3
2599 ; RV32I-NEXT: mv a3, a4
26112600 ; RV32I-NEXT: addi a4, zero, 5
26122601 ; RV32I-NEXT: addi a5, zero, 2
2613 ; RV32I-NEXT: mv a2, a3
2614 ; RV32I-NEXT: mv a3, a6
26152602 ; RV32I-NEXT: call __atomic_compare_exchange_8
26162603 ; RV32I-NEXT: lw ra, 12(sp)
26172604 ; RV32I-NEXT: addi sp, sp, 16
26212608 ; RV32IA: # %bb.0:
26222609 ; RV32IA-NEXT: addi sp, sp, -16
26232610 ; RV32IA-NEXT: sw ra, 12(sp)
2624 ; RV32IA-NEXT: mv a6, a4
26252611 ; RV32IA-NEXT: sw a2, 4(sp)
26262612 ; RV32IA-NEXT: sw a1, 0(sp)
26272613 ; RV32IA-NEXT: mv a1, sp
2614 ; RV32IA-NEXT: mv a2, a3
2615 ; RV32IA-NEXT: mv a3, a4
26282616 ; RV32IA-NEXT: addi a4, zero, 5
26292617 ; RV32IA-NEXT: addi a5, zero, 2
2630 ; RV32IA-NEXT: mv a2, a3
2631 ; RV32IA-NEXT: mv a3, a6
26322618 ; RV32IA-NEXT: call __atomic_compare_exchange_8
26332619 ; RV32IA-NEXT: lw ra, 12(sp)
26342620 ; RV32IA-NEXT: addi sp, sp, 16
26692655 ; RV32I-NEXT: sw a2, 4(sp)
26702656 ; RV32I-NEXT: sw a1, 0(sp)
26712657 ; RV32I-NEXT: mv a1, sp
2672 ; RV32I-NEXT: addi a5, zero, 5
26732658 ; RV32I-NEXT: mv a2, a3
26742659 ; RV32I-NEXT: mv a3, a4
2675 ; RV32I-NEXT: mv a4, a5
2660 ; RV32I-NEXT: addi a4, zero, 5
2661 ; RV32I-NEXT: addi a5, zero, 5
26762662 ; RV32I-NEXT: call __atomic_compare_exchange_8
26772663 ; RV32I-NEXT: lw ra, 12(sp)
26782664 ; RV32I-NEXT: addi sp, sp, 16
26852671 ; RV32IA-NEXT: sw a2, 4(sp)
26862672 ; RV32IA-NEXT: sw a1, 0(sp)
26872673 ; RV32IA-NEXT: mv a1, sp
2688 ; RV32IA-NEXT: addi a5, zero, 5
26892674 ; RV32IA-NEXT: mv a2, a3
26902675 ; RV32IA-NEXT: mv a3, a4
2691 ; RV32IA-NEXT: mv a4, a5
2676 ; RV32IA-NEXT: addi a4, zero, 5
2677 ; RV32IA-NEXT: addi a5, zero, 5
26922678 ; RV32IA-NEXT: call __atomic_compare_exchange_8
26932679 ; RV32IA-NEXT: lw ra, 12(sp)
26942680 ; RV32IA-NEXT: addi sp, sp, 16
27012687 ; RV64I-NEXT: sd a1, 0(sp)
27022688 ; RV64I-NEXT: mv a1, sp
27032689 ; RV64I-NEXT: addi a3, zero, 5
2704 ; RV64I-NEXT: mv a4, a3
2690 ; RV64I-NEXT: addi a4, zero, 5
27052691 ; RV64I-NEXT: call __atomic_compare_exchange_8
27062692 ; RV64I-NEXT: ld ra, 8(sp)
27072693 ; RV64I-NEXT: addi sp, sp, 16
22262226 ; RV32I-NEXT: sw s2, 20(sp)
22272227 ; RV32I-NEXT: sw s3, 16(sp)
22282228 ; RV32I-NEXT: sw s4, 12(sp)
2229 ; RV32I-NEXT: sw s5, 8(sp)
22302229 ; RV32I-NEXT: mv s2, a1
22312230 ; RV32I-NEXT: mv s4, a0
22322231 ; RV32I-NEXT: lbu a0, 0(a0)
22332232 ; RV32I-NEXT: slli a1, a1, 24
2234 ; RV32I-NEXT: srai s5, a1, 24
2235 ; RV32I-NEXT: addi s3, sp, 7
2236 ; RV32I-NEXT: addi s1, zero, 2
2233 ; RV32I-NEXT: srai s1, a1, 24
2234 ; RV32I-NEXT: addi s3, sp, 11
22372235 ; RV32I-NEXT: .LBB36_1: # %atomicrmw.start
22382236 ; RV32I-NEXT: # =>This Inner Loop Header: Depth=1
22392237 ; RV32I-NEXT: slli a1, a0, 24
22402238 ; RV32I-NEXT: srai a1, a1, 24
22412239 ; RV32I-NEXT: mv a2, a0
2242 ; RV32I-NEXT: blt s5, a1, .LBB36_3
2240 ; RV32I-NEXT: blt s1, a1, .LBB36_3
22432241 ; RV32I-NEXT: # %bb.2: # %atomicrmw.start
22442242 ; RV32I-NEXT: # in Loop: Header=BB36_1 Depth=1
22452243 ; RV32I-NEXT: mv a2, s2
22462244 ; RV32I-NEXT: .LBB36_3: # %atomicrmw.start
22472245 ; RV32I-NEXT: # in Loop: Header=BB36_1 Depth=1
2248 ; RV32I-NEXT: sb a0, 7(sp)
2246 ; RV32I-NEXT: sb a0, 11(sp)
22492247 ; RV32I-NEXT: mv a0, s4
22502248 ; RV32I-NEXT: mv a1, s3
2251 ; RV32I-NEXT: mv a3, s1
2252 ; RV32I-NEXT: mv a4, s1
2249 ; RV32I-NEXT: addi a3, zero, 2
2250 ; RV32I-NEXT: addi a4, zero, 2
22532251 ; RV32I-NEXT: call __atomic_compare_exchange_1
22542252 ; RV32I-NEXT: mv a1, a0
2255 ; RV32I-NEXT: lb a0, 7(sp)
2253 ; RV32I-NEXT: lb a0, 11(sp)
22562254 ; RV32I-NEXT: beqz a1, .LBB36_1
22572255 ; RV32I-NEXT: # %bb.4: # %atomicrmw.end
2258 ; RV32I-NEXT: lw s5, 8(sp)
22592256 ; RV32I-NEXT: lw s4, 12(sp)
22602257 ; RV32I-NEXT: lw s3, 16(sp)
22612258 ; RV32I-NEXT: lw s2, 20(sp)
22962293 ;
22972294 ; RV64I-LABEL: atomicrmw_max_i8_acquire:
22982295 ; RV64I: # %bb.0:
2299 ; RV64I-NEXT: addi sp, sp, -64
2300 ; RV64I-NEXT: sd ra, 56(sp)
2301 ; RV64I-NEXT: sd s1, 48(sp)
2302 ; RV64I-NEXT: sd s2, 40(sp)
2303 ; RV64I-NEXT: sd s3, 32(sp)
2304 ; RV64I-NEXT: sd s4, 24(sp)
2305 ; RV64I-NEXT: sd s5, 16(sp)
2296 ; RV64I-NEXT: addi sp, sp, -48
2297 ; RV64I-NEXT: sd ra, 40(sp)
2298 ; RV64I-NEXT: sd s1, 32(sp)
2299 ; RV64I-NEXT: sd s2, 24(sp)
2300 ; RV64I-NEXT: sd s3, 16(sp)
2301 ; RV64I-NEXT: sd s4, 8(sp)
23062302 ; RV64I-NEXT: mv s2, a1
23072303 ; RV64I-NEXT: mv s4, a0
23082304 ; RV64I-NEXT: lbu a0, 0(a0)
23092305 ; RV64I-NEXT: slli a1, a1, 56
2310 ; RV64I-NEXT: srai s5, a1, 56
2311 ; RV64I-NEXT: addi s3, sp, 15
2312 ; RV64I-NEXT: addi s1, zero, 2
2306 ; RV64I-NEXT: srai s1, a1, 56
2307 ; RV64I-NEXT: addi s3, sp, 7
23132308 ; RV64I-NEXT: .LBB36_1: # %atomicrmw.start
23142309 ; RV64I-NEXT: # =>This Inner Loop Header: Depth=1
23152310 ; RV64I-NEXT: slli a1, a0, 56
23162311 ; RV64I-NEXT: srai a1, a1, 56
23172312 ; RV64I-NEXT: mv a2, a0
2318 ; RV64I-NEXT: blt s5, a1, .LBB36_3
2313 ; RV64I-NEXT: blt s1, a1, .LBB36_3
23192314 ; RV64I-NEXT: # %bb.2: # %atomicrmw.start
23202315 ; RV64I-NEXT: # in Loop: Header=BB36_1 Depth=1
23212316 ; RV64I-NEXT: mv a2, s2
23222317 ; RV64I-NEXT: .LBB36_3: # %atomicrmw.start
23232318 ; RV64I-NEXT: # in Loop: Header=BB36_1 Depth=1
2324 ; RV64I-NEXT: sb a0, 15(sp)
2319 ; RV64I-NEXT: sb a0, 7(sp)
23252320 ; RV64I-NEXT: mv a0, s4
23262321 ; RV64I-NEXT: mv a1, s3
2327 ; RV64I-NEXT: mv a3, s1
2328 ; RV64I-NEXT: mv a4, s1
2322 ; RV64I-NEXT: addi a3, zero, 2
2323 ; RV64I-NEXT: addi a4, zero, 2
23292324 ; RV64I-NEXT: call __atomic_compare_exchange_1
23302325 ; RV64I-NEXT: mv a1, a0
2331 ; RV64I-NEXT: lb a0, 15(sp)
2326 ; RV64I-NEXT: lb a0, 7(sp)
23322327 ; RV64I-NEXT: beqz a1, .LBB36_1
23332328 ; RV64I-NEXT: # %bb.4: # %atomicrmw.end
2334 ; RV64I-NEXT: ld s5, 16(sp)
2335 ; RV64I-NEXT: ld s4, 24(sp)
2336 ; RV64I-NEXT: ld s3, 32(sp)
2337 ; RV64I-NEXT: ld s2, 40(sp)
2338 ; RV64I-NEXT: ld s1, 48(sp)
2339 ; RV64I-NEXT: ld ra, 56(sp)
2340 ; RV64I-NEXT: addi sp, sp, 64
2329 ; RV64I-NEXT: ld s4, 8(sp)
2330 ; RV64I-NEXT: ld s3, 16(sp)
2331 ; RV64I-NEXT: ld s2, 24(sp)
2332 ; RV64I-NEXT: ld s1, 32(sp)
2333 ; RV64I-NEXT: ld ra, 40(sp)
2334 ; RV64I-NEXT: addi sp, sp, 48
23412335 ; RV64I-NEXT: ret
23422336 ;
23432337 ; RV64IA-LABEL: atomicrmw_max_i8_acquire:
23822376 ; RV32I-NEXT: sw s2, 20(sp)
23832377 ; RV32I-NEXT: sw s3, 16(sp)
23842378 ; RV32I-NEXT: sw s4, 12(sp)
2385 ; RV32I-NEXT: sw s5, 8(sp)
23862379 ; RV32I-NEXT: mv s2, a1
2387 ; RV32I-NEXT: mv s5, a0
2380 ; RV32I-NEXT: mv s4, a0
23882381 ; RV32I-NEXT: lbu a0, 0(a0)
23892382 ; RV32I-NEXT: slli a1, a1, 24
23902383 ; RV32I-NEXT: srai s1, a1, 24
2391 ; RV32I-NEXT: addi s3, sp, 7
2392 ; RV32I-NEXT: addi s4, zero, 3
2384 ; RV32I-NEXT: addi s3, sp, 11
23932385 ; RV32I-NEXT: .LBB37_1: # %atomicrmw.start
23942386 ; RV32I-NEXT: # =>This Inner Loop Header: Depth=1
23952387 ; RV32I-NEXT: slli a1, a0, 24
24012393 ; RV32I-NEXT: mv a2, s2
24022394 ; RV32I-NEXT: .LBB37_3: # %atomicrmw.start
24032395 ; RV32I-NEXT: # in Loop: Header=BB37_1 Depth=1
2404 ; RV32I-NEXT: sb a0, 7(sp)
2405 ; RV32I-NEXT: mv a0, s5
2396 ; RV32I-NEXT: sb a0, 11(sp)
2397 ; RV32I-NEXT: mv a0, s4
24062398 ; RV32I-NEXT: mv a1, s3
2407 ; RV32I-NEXT: mv a3, s4
2399 ; RV32I-NEXT: addi a3, zero, 3
24082400 ; RV32I-NEXT: mv a4, zero
24092401 ; RV32I-NEXT: call __atomic_compare_exchange_1
24102402 ; RV32I-NEXT: mv a1, a0
2411 ; RV32I-NEXT: lb a0, 7(sp)
2403 ; RV32I-NEXT: lb a0, 11(sp)
24122404 ; RV32I-NEXT: beqz a1, .LBB37_1
24132405 ; RV32I-NEXT: # %bb.4: # %atomicrmw.end
2414 ; RV32I-NEXT: lw s5, 8(sp)
24152406 ; RV32I-NEXT: lw s4, 12(sp)
24162407 ; RV32I-NEXT: lw s3, 16(sp)
24172408 ; RV32I-NEXT: lw s2, 20(sp)
24522443 ;
24532444 ; RV64I-LABEL: atomicrmw_max_i8_release:
24542445 ; RV64I: # %bb.0:
2455 ; RV64I-NEXT: addi sp, sp, -64
2456 ; RV64I-NEXT: sd ra, 56(sp)
2457 ; RV64I-NEXT: sd s1, 48(sp)
2458 ; RV64I-NEXT: sd s2, 40(sp)
2459 ; RV64I-NEXT: sd s3, 32(sp)
2460 ; RV64I-NEXT: sd s4, 24(sp)
2461 ; RV64I-NEXT: sd s5, 16(sp)
2446 ; RV64I-NEXT: addi sp, sp, -48
2447 ; RV64I-NEXT: sd ra, 40(sp)
2448 ; RV64I-NEXT: sd s1, 32(sp)
2449 ; RV64I-NEXT: sd s2, 24(sp)
2450 ; RV64I-NEXT: sd s3, 16(sp)
2451 ; RV64I-NEXT: sd s4, 8(sp)
24622452 ; RV64I-NEXT: mv s2, a1
2463 ; RV64I-NEXT: mv s5, a0
2453 ; RV64I-NEXT: mv s4, a0
24642454 ; RV64I-NEXT: lbu a0, 0(a0)
24652455 ; RV64I-NEXT: slli a1, a1, 56
24662456 ; RV64I-NEXT: srai s1, a1, 56
2467 ; RV64I-NEXT: addi s3, sp, 15
2468 ; RV64I-NEXT: addi s4, zero, 3
2457 ; RV64I-NEXT: addi s3, sp, 7
24692458 ; RV64I-NEXT: .LBB37_1: # %atomicrmw.start
24702459 ; RV64I-NEXT: # =>This Inner Loop Header: Depth=1
24712460 ; RV64I-NEXT: slli a1, a0, 56
24772466 ; RV64I-NEXT: mv a2, s2
24782467 ; RV64I-NEXT: .LBB37_3: # %atomicrmw.start
24792468 ; RV64I-NEXT: # in Loop: Header=BB37_1 Depth=1
2480 ; RV64I-NEXT: sb a0, 15(sp)
2481 ; RV64I-NEXT: mv a0, s5
2469 ; RV64I-NEXT: sb a0, 7(sp)
2470 ; RV64I-NEXT: mv a0, s4
24822471 ; RV64I-NEXT: mv a1, s3
2483 ; RV64I-NEXT: mv a3, s4
2472 ; RV64I-NEXT: addi a3, zero, 3
24842473 ; RV64I-NEXT: mv a4, zero
24852474 ; RV64I-NEXT: call __atomic_compare_exchange_1
24862475 ; RV64I-NEXT: mv a1, a0
2487 ; RV64I-NEXT: lb a0, 15(sp)
2476 ; RV64I-NEXT: lb a0, 7(sp)
24882477 ; RV64I-NEXT: beqz a1, .LBB37_1
24892478 ; RV64I-NEXT: # %bb.4: # %atomicrmw.end
2490 ; RV64I-NEXT: ld s5, 16(sp)
2491 ; RV64I-NEXT: ld s4, 24(sp)
2492 ; RV64I-NEXT: ld s3, 32(sp)
2493 ; RV64I-NEXT: ld s2, 40(sp)
2494 ; RV64I-NEXT: ld s1, 48(sp)
2495 ; RV64I-NEXT: ld ra, 56(sp)
2496 ; RV64I-NEXT: addi sp, sp, 64
2479 ; RV64I-NEXT: ld s4, 8(sp)
2480 ; RV64I-NEXT: ld s3, 16(sp)
2481 ; RV64I-NEXT: ld s2, 24(sp)
2482 ; RV64I-NEXT: ld s1, 32(sp)
2483 ; RV64I-NEXT: ld ra, 40(sp)
2484 ; RV64I-NEXT: addi sp, sp, 48
24972485 ; RV64I-NEXT: ret
24982486 ;
24992487 ; RV64IA-LABEL: atomicrmw_max_i8_release:
25382526 ; RV32I-NEXT: sw s2, 20(sp)
25392527 ; RV32I-NEXT: sw s3, 16(sp)
25402528 ; RV32I-NEXT: sw s4, 12(sp)
2541 ; RV32I-NEXT: sw s5, 8(sp)
2542 ; RV32I-NEXT: sw s6, 4(sp)
25432529 ; RV32I-NEXT: mv s2, a1
2544 ; RV32I-NEXT: mv s6, a0
2530 ; RV32I-NEXT: mv s4, a0
25452531 ; RV32I-NEXT: lbu a0, 0(a0)
25462532 ; RV32I-NEXT: slli a1, a1, 24
25472533 ; RV32I-NEXT: srai s1, a1, 24
2548 ; RV32I-NEXT: addi s3, sp, 3
2549 ; RV32I-NEXT: addi s4, zero, 4
2550 ; RV32I-NEXT: addi s5, zero, 2
2534 ; RV32I-NEXT: addi s3, sp, 11
25512535 ; RV32I-NEXT: .LBB38_1: # %atomicrmw.start
25522536 ; RV32I-NEXT: # =>This Inner Loop Header: Depth=1
25532537 ; RV32I-NEXT: slli a1, a0, 24
25592543 ; RV32I-NEXT: mv a2, s2
25602544 ; RV32I-NEXT: .LBB38_3: # %atomicrmw.start
25612545 ; RV32I-NEXT: # in Loop: Header=BB38_1 Depth=1
2562 ; RV32I-NEXT: sb a0, 3(sp)
2563 ; RV32I-NEXT: mv a0, s6
2546 ; RV32I-NEXT: sb a0, 11(sp)
2547 ; RV32I-NEXT: mv a0, s4
25642548 ; RV32I-NEXT: mv a1, s3
2565 ; RV32I-NEXT: mv a3, s4
2566 ; RV32I-NEXT: mv a4, s5
2549 ; RV32I-NEXT: addi a3, zero, 4
2550 ; RV32I-NEXT: addi a4, zero, 2
25672551 ; RV32I-NEXT: call __atomic_compare_exchange_1
25682552 ; RV32I-NEXT: mv a1, a0
2569 ; RV32I-NEXT: lb a0, 3(sp)
2553 ; RV32I-NEXT: lb a0, 11(sp)
25702554 ; RV32I-NEXT: beqz a1, .LBB38_1
25712555 ; RV32I-NEXT: # %bb.4: # %atomicrmw.end
2572 ; RV32I-NEXT: lw s6, 4(sp)
2573 ; RV32I-NEXT: lw s5, 8(sp)
25742556 ; RV32I-NEXT: lw s4, 12(sp)
25752557 ; RV32I-NEXT: lw s3, 16(sp)
25762558 ; RV32I-NEXT: lw s2, 20(sp)
26112593 ;
26122594 ; RV64I-LABEL: atomicrmw_max_i8_acq_rel:
26132595 ; RV64I: # %bb.0:
2614 ; RV64I-NEXT: addi sp, sp, -64
2615 ; RV64I-NEXT: sd ra, 56(sp)
2616 ; RV64I-NEXT: sd s1, 48(sp)
2617 ; RV64I-NEXT: sd s2, 40(sp)
2618 ; RV64I-NEXT: sd s3, 32(sp)
2619 ; RV64I-NEXT: sd s4, 24(sp)
2620 ; RV64I-NEXT: sd s5, 16(sp)
2621 ; RV64I-NEXT: sd s6, 8(sp)
2596 ; RV64I-NEXT: addi sp, sp, -48
2597 ; RV64I-NEXT: sd ra, 40(sp)
2598 ; RV64I-NEXT: sd s1, 32(sp)
2599 ; RV64I-NEXT: sd s2, 24(sp)
2600 ; RV64I-NEXT: sd s3, 16(sp)
2601 ; RV64I-NEXT: sd s4, 8(sp)
26222602 ; RV64I-NEXT: mv s2, a1
2623 ; RV64I-NEXT: mv s6, a0
2603 ; RV64I-NEXT: mv s4, a0
26242604 ; RV64I-NEXT: lbu a0, 0(a0)
26252605 ; RV64I-NEXT: slli a1, a1, 56
26262606 ; RV64I-NEXT: srai s1, a1, 56
26272607 ; RV64I-NEXT: addi s3, sp, 7
2628 ; RV64I-NEXT: addi s4, zero, 4
2629 ; RV64I-NEXT: addi s5, zero, 2
26302608 ; RV64I-NEXT: .LBB38_1: # %atomicrmw.start
26312609 ; RV64I-NEXT: # =>This Inner Loop Header: Depth=1
26322610 ; RV64I-NEXT: slli a1, a0, 56
26392617 ; RV64I-NEXT: .LBB38_3: # %atomicrmw.start
26402618 ; RV64I-NEXT: # in Loop: Header=BB38_1 Depth=1
26412619 ; RV64I-NEXT: sb a0, 7(sp)
2642 ; RV64I-NEXT: mv a0, s6
2620 ; RV64I-NEXT: mv a0, s4
26432621 ; RV64I-NEXT: mv a1, s3
2644 ; RV64I-NEXT: mv a3, s4
2645 ; RV64I-NEXT: mv a4, s5
2622 ; RV64I-NEXT: addi a3, zero, 4
2623 ; RV64I-NEXT: addi a4, zero, 2
26462624 ; RV64I-NEXT: call __atomic_compare_exchange_1
26472625 ; RV64I-NEXT: mv a1, a0
26482626 ; RV64I-NEXT: lb a0, 7(sp)
26492627 ; RV64I-NEXT: beqz a1, .LBB38_1
26502628 ; RV64I-NEXT: # %bb.4: # %atomicrmw.end
2651 ; RV64I-NEXT: ld s6, 8(sp)
2652 ; RV64I-NEXT: ld s5, 16(sp)
2653 ; RV64I-NEXT: ld s4, 24(sp)
2654 ; RV64I-NEXT: ld s3, 32(sp)
2655 ; RV64I-NEXT: ld s2, 40(sp)
2656 ; RV64I-NEXT: ld s1, 48(sp)
2657 ; RV64I-NEXT: ld ra, 56(sp)
2658 ; RV64I-NEXT: addi sp, sp, 64
2629 ; RV64I-NEXT: ld s4, 8(sp)
2630 ; RV64I-NEXT: ld s3, 16(sp)
2631 ; RV64I-NEXT: ld s2, 24(sp)
2632 ; RV64I-NEXT: ld s1, 32(sp)
2633 ; RV64I-NEXT: ld ra, 40(sp)
2634 ; RV64I-NEXT: addi sp, sp, 48
26592635 ; RV64I-NEXT: ret
26602636 ;
26612637 ; RV64IA-LABEL: atomicrmw_max_i8_acq_rel:
27002676 ; RV32I-NEXT: sw s2, 20(sp)
27012677 ; RV32I-NEXT: sw s3, 16(sp)
27022678 ; RV32I-NEXT: sw s4, 12(sp)
2703 ; RV32I-NEXT: sw s5, 8(sp)
27042679 ; RV32I-NEXT: mv s2, a1
27052680 ; RV32I-NEXT: mv s4, a0
27062681 ; RV32I-NEXT: lbu a0, 0(a0)
27072682 ; RV32I-NEXT: slli a1, a1, 24
2708 ; RV32I-NEXT: srai s5, a1, 24
2709 ; RV32I-NEXT: addi s3, sp, 7
2710 ; RV32I-NEXT: addi s1, zero, 5
2683 ; RV32I-NEXT: srai s1, a1, 24
2684 ; RV32I-NEXT: addi s3, sp, 11
27112685 ; RV32I-NEXT: .LBB39_1: # %atomicrmw.start
27122686 ; RV32I-NEXT: # =>This Inner Loop Header: Depth=1
27132687 ; RV32I-NEXT: slli a1, a0, 24
27142688 ; RV32I-NEXT: srai a1, a1, 24
27152689 ; RV32I-NEXT: mv a2, a0
2716 ; RV32I-NEXT: blt s5, a1, .LBB39_3
2690 ; RV32I-NEXT: blt s1, a1, .LBB39_3
27172691 ; RV32I-NEXT: # %bb.2: # %atomicrmw.start
27182692 ; RV32I-NEXT: # in Loop: Header=BB39_1 Depth=1
27192693 ; RV32I-NEXT: mv a2, s2
27202694 ; RV32I-NEXT: .LBB39_3: # %atomicrmw.start
27212695 ; RV32I-NEXT: # in Loop: Header=BB39_1 Depth=1
2722 ; RV32I-NEXT: sb a0, 7(sp)
2696 ; RV32I-NEXT: sb a0, 11(sp)
27232697 ; RV32I-NEXT: mv a0, s4
27242698 ; RV32I-NEXT: mv a1, s3
2725 ; RV32I-NEXT: mv a3, s1
2726 ; RV32I-NEXT: mv a4, s1
2699 ; RV32I-NEXT: addi a3, zero, 5
2700 ; RV32I-NEXT: addi a4, zero, 5
27272701 ; RV32I-NEXT: call __atomic_compare_exchange_1
27282702 ; RV32I-NEXT: mv a1, a0
2729 ; RV32I-NEXT: lb a0, 7(sp)
2703 ; RV32I-NEXT: lb a0, 11(sp)
27302704 ; RV32I-NEXT: beqz a1, .LBB39_1
27312705 ; RV32I-NEXT: # %bb.4: # %atomicrmw.end
2732 ; RV32I-NEXT: lw s5, 8(sp)
27332706 ; RV32I-NEXT: lw s4, 12(sp)
27342707 ; RV32I-NEXT: lw s3, 16(sp)
27352708 ; RV32I-NEXT: lw s2, 20(sp)
27702743 ;
27712744 ; RV64I-LABEL: atomicrmw_max_i8_seq_cst:
27722745 ; RV64I: # %bb.0:
2773 ; RV64I-NEXT: addi sp, sp, -64
2774 ; RV64I-NEXT: sd ra, 56(sp)
2775 ; RV64I-NEXT: sd s1, 48(sp)
2776 ; RV64I-NEXT: sd s2, 40(sp)
2777 ; RV64I-NEXT: sd s3, 32(sp)
2778 ; RV64I-NEXT: sd s4, 24(sp)
2779 ; RV64I-NEXT: sd s5, 16(sp)
2746 ; RV64I-NEXT: addi sp, sp, -48
2747 ; RV64I-NEXT: sd ra, 40(sp)
2748 ; RV64I-NEXT: sd s1, 32(sp)
2749 ; RV64I-NEXT: sd s2, 24(sp)
2750 ; RV64I-NEXT: sd s3, 16(sp)
2751 ; RV64I-NEXT: sd s4, 8(sp)
27802752 ; RV64I-NEXT: mv s2, a1
27812753 ; RV64I-NEXT: mv s4, a0
27822754 ; RV64I-NEXT: lbu a0, 0(a0)
27832755 ; RV64I-NEXT: slli a1, a1, 56
2784 ; RV64I-NEXT: srai s5, a1, 56
2785 ; RV64I-NEXT: addi s3, sp, 15
2786 ; RV64I-NEXT: addi s1, zero, 5
2756 ; RV64I-NEXT: srai s1, a1, 56
2757 ; RV64I-NEXT: addi s3, sp, 7
27872758 ; RV64I-NEXT: .LBB39_1: # %atomicrmw.start
27882759 ; RV64I-NEXT: # =>This Inner Loop Header: Depth=1
27892760 ; RV64I-NEXT: slli a1, a0, 56
27902761 ; RV64I-NEXT: srai a1, a1, 56
27912762 ; RV64I-NEXT: mv a2, a0
2792 ; RV64I-NEXT: blt s5, a1, .LBB39_3
2763 ; RV64I-NEXT: blt s1, a1, .LBB39_3
27932764 ; RV64I-NEXT: # %bb.2: # %atomicrmw.start
27942765 ; RV64I-NEXT: # in Loop: Header=BB39_1 Depth=1
27952766 ; RV64I-NEXT: mv a2, s2
27962767 ; RV64I-NEXT: .LBB39_3: # %atomicrmw.start
27972768 ; RV64I-NEXT: # in Loop: Header=BB39_1 Depth=1
2798 ; RV64I-NEXT: sb a0, 15(sp)
2769 ; RV64I-NEXT: sb a0, 7(sp)
27992770 ; RV64I-NEXT: mv a0, s4
28002771 ; RV64I-NEXT: mv a1, s3
2801 ; RV64I-NEXT: mv a3, s1
2802 ; RV64I-NEXT: mv a4, s1
2772 ; RV64I-NEXT: addi a3, zero, 5
2773 ; RV64I-NEXT: addi a4, zero, 5
28032774 ; RV64I-NEXT: call __atomic_compare_exchange_1
28042775 ; RV64I-NEXT: mv a1, a0
2805 ; RV64I-NEXT: lb a0, 15(sp)
2776 ; RV64I-NEXT: lb a0, 7(sp)
28062777 ; RV64I-NEXT: beqz a1, .LBB39_1
28072778 ; RV64I-NEXT: # %bb.4: # %atomicrmw.end
2808 ; RV64I-NEXT: ld s5, 16(sp)
2809 ; RV64I-NEXT: ld s4, 24(sp)
2810 ; RV64I-NEXT: ld s3, 32(sp)
2811 ; RV64I-NEXT: ld s2, 40(sp)
2812 ; RV64I-NEXT: ld s1, 48(sp)
2813 ; RV64I-NEXT: ld ra, 56(sp)
2814 ; RV64I-NEXT: addi sp, sp, 64
2779 ; RV64I-NEXT: ld s4, 8(sp)
2780 ; RV64I-NEXT: ld s3, 16(sp)
2781 ; RV64I-NEXT: ld s2, 24(sp)
2782 ; RV64I-NEXT: ld s1, 32(sp)
2783 ; RV64I-NEXT: ld ra, 40(sp)
2784 ; RV64I-NEXT: addi sp, sp, 48
28152785 ; RV64I-NEXT: ret
28162786 ;
28172787 ; RV64IA-LABEL: atomicrmw_max_i8_seq_cst:
30062976 ; RV32I-NEXT: sw s2, 20(sp)
30072977 ; RV32I-NEXT: sw s3, 16(sp)
30082978 ; RV32I-NEXT: sw s4, 12(sp)
3009 ; RV32I-NEXT: sw s5, 8(sp)
30102979 ; RV32I-NEXT: mv s2, a1
30112980 ; RV32I-NEXT: mv s4, a0
30122981 ; RV32I-NEXT: lbu a0, 0(a0)
30132982 ; RV32I-NEXT: slli a1, a1, 24
3014 ; RV32I-NEXT: srai s5, a1, 24
3015 ; RV32I-NEXT: addi s3, sp, 7
3016 ; RV32I-NEXT: addi s1, zero, 2
2983 ; RV32I-NEXT: srai s1, a1, 24
2984 ; RV32I-NEXT: addi s3, sp, 11
30172985 ; RV32I-NEXT: .LBB41_1: # %atomicrmw.start
30182986 ; RV32I-NEXT: # =>This Inner Loop Header: Depth=1
30192987 ; RV32I-NEXT: slli a1, a0, 24
30202988 ; RV32I-NEXT: srai a1, a1, 24
30212989 ; RV32I-NEXT: mv a2, a0
3022 ; RV32I-NEXT: bge s5, a1, .LBB41_3
2990 ; RV32I-NEXT: bge s1, a1, .LBB41_3
30232991 ; RV32I-NEXT: # %bb.2: # %atomicrmw.start
30242992 ; RV32I-NEXT: # in Loop: Header=BB41_1 Depth=1
30252993 ; RV32I-NEXT: mv a2, s2
30262994 ; RV32I-NEXT: .LBB41_3: # %atomicrmw.start
30272995 ; RV32I-NEXT: # in Loop: Header=BB41_1 Depth=1
3028 ; RV32I-NEXT: sb a0, 7(sp)
2996 ; RV32I-NEXT: sb a0, 11(sp)
30292997 ; RV32I-NEXT: mv a0, s4
30302998 ; RV32I-NEXT: mv a1, s3
3031 ; RV32I-NEXT: mv a3, s1
3032 ; RV32I-NEXT: mv a4, s1
2999 ; RV32I-NEXT: addi a3, zero, 2
3000 ; RV32I-NEXT: addi a4, zero, 2
30333001 ; RV32I-NEXT: call __atomic_compare_exchange_1
30343002 ; RV32I-NEXT: mv a1, a0
3035 ; RV32I-NEXT: lb a0, 7(sp)
3003 ; RV32I-NEXT: lb a0, 11(sp)
30363004 ; RV32I-NEXT: beqz a1, .LBB41_1
30373005 ; RV32I-NEXT: # %bb.4: # %atomicrmw.end
3038 ; RV32I-NEXT: lw s5, 8(sp)
30393006 ; RV32I-NEXT: lw s4, 12(sp)
30403007 ; RV32I-NEXT: lw s3, 16(sp)
30413008 ; RV32I-NEXT: lw s2, 20(sp)
30763043 ;
30773044 ; RV64I-LABEL: atomicrmw_min_i8_acquire:
30783045 ; RV64I: # %bb.0:
3079 ; RV64I-NEXT: addi sp, sp, -64
3080 ; RV64I-NEXT: sd ra, 56(sp)
3081 ; RV64I-NEXT: sd s1, 48(sp)
3082 ; RV64I-NEXT: sd s2, 40(sp)
3083 ; RV64I-NEXT: sd s3, 32(sp)
3084 ; RV64I-NEXT: sd s4, 24(sp)
3085 ; RV64I-NEXT: sd s5, 16(sp)
3046 ; RV64I-NEXT: addi sp, sp, -48
3047 ; RV64I-NEXT: sd ra, 40(sp)
3048 ; RV64I-NEXT: sd s1, 32(sp)
3049 ; RV64I-NEXT: sd s2, 24(sp)
3050 ; RV64I-NEXT: sd s3, 16(sp)
3051 ; RV64I-NEXT: sd s4, 8(sp)
30863052 ; RV64I-NEXT: mv s2, a1
30873053 ; RV64I-NEXT: mv s4, a0
30883054 ; RV64I-NEXT: lbu a0, 0(a0)
30893055 ; RV64I-NEXT: slli a1, a1, 56
3090 ; RV64I-NEXT: srai s5, a1, 56
3091 ; RV64I-NEXT: addi s3, sp, 15
3092 ; RV64I-NEXT: addi s1, zero, 2
3056 ; RV64I-NEXT: srai s1, a1, 56
3057 ; RV64I-NEXT: addi s3, sp, 7
30933058 ; RV64I-NEXT: .LBB41_1: # %atomicrmw.start
30943059 ; RV64I-NEXT: # =>This Inner Loop Header: Depth=1
30953060 ; RV64I-NEXT: slli a1, a0, 56
30963061 ; RV64I-NEXT: srai a1, a1, 56
30973062 ; RV64I-NEXT: mv a2, a0
3098 ; RV64I-NEXT: bge s5, a1, .LBB41_3
3063 ; RV64I-NEXT: bge s1, a1, .LBB41_3
30993064 ; RV64I-NEXT: # %bb.2: # %atomicrmw.start
31003065 ; RV64I-NEXT: # in Loop: Header=BB41_1 Depth=1
31013066 ; RV64I-NEXT: mv a2, s2
31023067 ; RV64I-NEXT: .LBB41_3: # %atomicrmw.start
31033068 ; RV64I-NEXT: # in Loop: Header=BB41_1 Depth=1
3104 ; RV64I-NEXT: sb a0, 15(sp)
3069 ; RV64I-NEXT: sb a0, 7(sp)
31053070 ; RV64I-NEXT: mv a0, s4
31063071 ; RV64I-NEXT: mv a1, s3
3107 ; RV64I-NEXT: mv a3, s1
3108 ; RV64I-NEXT: mv a4, s1
3072 ; RV64I-NEXT: addi a3, zero, 2
3073 ; RV64I-NEXT: addi a4, zero, 2
31093074 ; RV64I-NEXT: call __atomic_compare_exchange_1
31103075 ; RV64I-NEXT: mv a1, a0
3111 ; RV64I-NEXT: lb a0, 15(sp)
3076 ; RV64I-NEXT: lb a0, 7(sp)
31123077 ; RV64I-NEXT: beqz a1, .LBB41_1
31133078 ; RV64I-NEXT: # %bb.4: # %atomicrmw.end
3114 ; RV64I-NEXT: ld s5, 16(sp)
3115 ; RV64I-NEXT: ld s4, 24(sp)
3116 ; RV64I-NEXT: ld s3, 32(sp)
3117 ; RV64I-NEXT: ld s2, 40(sp)
3118 ; RV64I-NEXT: ld s1, 48(sp)
3119 ; RV64I-NEXT: ld ra, 56(sp)
3120 ; RV64I-NEXT: addi sp, sp, 64
3079 ; RV64I-NEXT: ld s4, 8(sp)
3080 ; RV64I-NEXT: ld s3, 16(sp)
3081 ; RV64I-NEXT: ld s2, 24(sp)
3082 ; RV64I-NEXT: ld s1, 32(sp)
3083 ; RV64I-NEXT: ld ra, 40(sp)
3084 ; RV64I-NEXT: addi sp, sp, 48
31213085 ; RV64I-NEXT: ret
31223086 ;
31233087 ; RV64IA-LABEL: atomicrmw_min_i8_acquire:
31623126 ; RV32I-NEXT: sw s2, 20(sp)
31633127 ; RV32I-NEXT: sw s3, 16(sp)
31643128 ; RV32I-NEXT: sw s4, 12(sp)
3165 ; RV32I-NEXT: sw s5, 8(sp)
31663129 ; RV32I-NEXT: mv s2, a1
3167 ; RV32I-NEXT: mv s5, a0
3130 ; RV32I-NEXT: mv s4, a0
31683131 ; RV32I-NEXT: lbu a0, 0(a0)
31693132 ; RV32I-NEXT: slli a1, a1, 24
31703133 ; RV32I-NEXT: srai s1, a1, 24
3171 ; RV32I-NEXT: addi s3, sp, 7
3172 ; RV32I-NEXT: addi s4, zero, 3
3134 ; RV32I-NEXT: addi s3, sp, 11
31733135 ; RV32I-NEXT: .LBB42_1: # %atomicrmw.start
31743136 ; RV32I-NEXT: # =>This Inner Loop Header: Depth=1
31753137 ; RV32I-NEXT: slli a1, a0, 24
31813143 ; RV32I-NEXT: mv a2, s2
31823144 ; RV32I-NEXT: .LBB42_3: # %atomicrmw.start
31833145 ; RV32I-NEXT: # in Loop: Header=BB42_1 Depth=1
3184 ; RV32I-NEXT: sb a0, 7(sp)
3185 ; RV32I-NEXT: mv a0, s5
3146 ; RV32I-NEXT: sb a0, 11(sp)
3147 ; RV32I-NEXT: mv a0, s4
31863148 ; RV32I-NEXT: mv a1, s3
3187 ; RV32I-NEXT: mv a3, s4
3149 ; RV32I-NEXT: addi a3, zero, 3
31883150 ; RV32I-NEXT: mv a4, zero
31893151 ; RV32I-NEXT: call __atomic_compare_exchange_1
31903152 ; RV32I-NEXT: mv a1, a0
3191 ; RV32I-NEXT: lb a0, 7(sp)
3153 ; RV32I-NEXT: lb a0, 11(sp)
31923154 ; RV32I-NEXT: beqz a1, .LBB42_1
31933155 ; RV32I-NEXT: # %bb.4: # %atomicrmw.end
3194 ; RV32I-NEXT: lw s5, 8(sp)
31953156 ; RV32I-NEXT: lw s4, 12(sp)
31963157 ; RV32I-NEXT: lw s3, 16(sp)
31973158 ; RV32I-NEXT: lw s2, 20(sp)
32323193 ;
32333194 ; RV64I-LABEL: atomicrmw_min_i8_release:
32343195 ; RV64I: # %bb.0:
3235 ; RV64I-NEXT: addi sp, sp, -64
3236 ; RV64I-NEXT: sd ra, 56(sp)
3237 ; RV64I-NEXT: sd s1, 48(sp)
3238 ; RV64I-NEXT: sd s2, 40(sp)
3239 ; RV64I-NEXT: sd s3, 32(sp)
3240 ; RV64I-NEXT: sd s4, 24(sp)
3241 ; RV64I-NEXT: sd s5, 16(sp)
3196 ; RV64I-NEXT: addi sp, sp, -48
3197 ; RV64I-NEXT: sd ra, 40(sp)
3198 ; RV64I-NEXT: sd s1, 32(sp)
3199 ; RV64I-NEXT: sd s2, 24(sp)
3200 ; RV64I-NEXT: sd s3, 16(sp)
3201 ; RV64I-NEXT: sd s4, 8(sp)
32423202 ; RV64I-NEXT: mv s2, a1
3243 ; RV64I-NEXT: mv s5, a0
3203 ; RV64I-NEXT: mv s4, a0
32443204 ; RV64I-NEXT: lbu a0, 0(a0)
32453205 ; RV64I-NEXT: slli a1, a1, 56
32463206 ; RV64I-NEXT: srai s1, a1, 56
3247 ; RV64I-NEXT: addi s3, sp, 15
3248 ; RV64I-NEXT: addi s4, zero, 3
3207 ; RV64I-NEXT: addi s3, sp, 7
32493208 ; RV64I-NEXT: .LBB42_1: # %atomicrmw.start
32503209 ; RV64I-NEXT: # =>This Inner Loop Header: Depth=1
32513210 ; RV64I-NEXT: slli a1, a0, 56
32573216 ; RV64I-NEXT: mv a2, s2
32583217 ; RV64I-NEXT: .LBB42_3: # %atomicrmw.start
32593218 ; RV64I-NEXT: # in Loop: Header=BB42_1 Depth=1
3260 ; RV64I-NEXT: sb a0, 15(sp)
3261 ; RV64I-NEXT: mv a0, s5
3219 ; RV64I-NEXT: sb a0, 7(sp)
3220 ; RV64I-NEXT: mv a0, s4
32623221 ; RV64I-NEXT: mv a1, s3
3263 ; RV64I-NEXT: mv a3, s4
3222 ; RV64I-NEXT: addi a3, zero, 3
32643223 ; RV64I-NEXT: mv a4, zero
32653224 ; RV64I-NEXT: call __atomic_compare_exchange_1
32663225 ; RV64I-NEXT: mv a1, a0
3267 ; RV64I-NEXT: lb a0, 15(sp)
3226 ; RV64I-NEXT: lb a0, 7(sp)
32683227 ; RV64I-NEXT: beqz a1, .LBB42_1
32693228 ; RV64I-NEXT: # %bb.4: # %atomicrmw.end
3270 ; RV64I-NEXT: ld s5, 16(sp)
3271 ; RV64I-NEXT: ld s4, 24(sp)
3272 ; RV64I-NEXT: ld s3, 32(sp)
3273 ; RV64I-NEXT: ld s2, 40(sp)
3274 ; RV64I-NEXT: ld s1, 48(sp)
3275 ; RV64I-NEXT: ld ra, 56(sp)
3276 ; RV64I-NEXT: addi sp, sp, 64
3229 ; RV64I-NEXT: ld s4, 8(sp)
3230 ; RV64I-NEXT: ld s3, 16(sp)
3231 ; RV64I-NEXT: ld s2, 24(sp)
3232 ; RV64I-NEXT: ld s1, 32(sp)
3233 ; RV64I-NEXT: ld ra, 40(sp)
3234 ; RV64I-NEXT: addi sp, sp, 48
32773235 ; RV64I-NEXT: ret
32783236 ;
32793237 ; RV64IA-LABEL: atomicrmw_min_i8_release:
33183276 ; RV32I-NEXT: sw s2, 20(sp)
33193277 ; RV32I-NEXT: sw s3, 16(sp)
33203278 ; RV32I-NEXT: sw s4, 12(sp)
3321 ; RV32I-NEXT: sw s5, 8(sp)
3322 ; RV32I-NEXT: sw s6, 4(sp)
33233279 ; RV32I-NEXT: mv s2, a1
3324 ; RV32I-NEXT: mv s6, a0
3280 ; RV32I-NEXT: mv s4, a0
33253281 ; RV32I-NEXT: lbu a0, 0(a0)
33263282 ; RV32I-NEXT: slli a1, a1, 24
33273283 ; RV32I-NEXT: srai s1, a1, 24
3328 ; RV32I-NEXT: addi s3, sp, 3
3329 ; RV32I-NEXT: addi s4, zero, 4
3330 ; RV32I-NEXT: addi s5, zero, 2
3284 ; RV32I-NEXT: addi s3, sp, 11
33313285 ; RV32I-NEXT: .LBB43_1: # %atomicrmw.start
33323286 ; RV32I-NEXT: # =>This Inner Loop Header: Depth=1
33333287 ; RV32I-NEXT: slli a1, a0, 24
33393293 ; RV32I-NEXT: mv a2, s2
33403294 ; RV32I-NEXT: .LBB43_3: # %atomicrmw.start
33413295 ; RV32I-NEXT: # in Loop: Header=BB43_1 Depth=1
3342 ; RV32I-NEXT: sb a0, 3(sp)
3343 ; RV32I-NEXT: mv a0, s6
3296 ; RV32I-NEXT: sb a0, 11(sp)
3297 ; RV32I-NEXT: mv a0, s4
33443298 ; RV32I-NEXT: mv a1, s3
3345 ; RV32I-NEXT: mv a3, s4
3346 ; RV32I-NEXT: mv a4, s5
3299 ; RV32I-NEXT: addi a3, zero, 4
3300 ; RV32I-NEXT: addi a4, zero, 2
33473301 ; RV32I-NEXT: call __atomic_compare_exchange_1
33483302 ; RV32I-NEXT: mv a1, a0
3349 ; RV32I-NEXT: lb a0, 3(sp)
3303 ; RV32I-NEXT: lb a0, 11(sp)
33503304 ; RV32I-NEXT: beqz a1, .LBB43_1
33513305 ; RV32I-NEXT: # %bb.4: # %atomicrmw.end
3352 ; RV32I-NEXT: lw s6, 4(sp)
3353 ; RV32I-NEXT: lw s5, 8(sp)
33543306 ; RV32I-NEXT: lw s4, 12(sp)
33553307 ; RV32I-NEXT: lw s3, 16(sp)
33563308 ; RV32I-NEXT: lw s2, 20(sp)
33913343 ;
33923344 ; RV64I-LABEL: atomicrmw_min_i8_acq_rel:
33933345 ; RV64I: # %bb.0:
3394 ; RV64I-NEXT: addi sp, sp, -64
3395 ; RV64I-NEXT: sd ra, 56(sp)
3396 ; RV64I-NEXT: sd s1, 48(sp)
3397 ; RV64I-NEXT: sd s2, 40(sp)
3398 ; RV64I-NEXT: sd s3, 32(sp)
3399 ; RV64I-NEXT: sd s4, 24(sp)
3400 ; RV64I-NEXT: sd s5, 16(sp)
3401 ; RV64I-NEXT: sd s6, 8(sp)
3346 ; RV64I-NEXT: addi sp, sp, -48
3347 ; RV64I-NEXT: sd ra, 40(sp)
3348 ; RV64I-NEXT: sd s1, 32(sp)
3349 ; RV64I-NEXT: sd s2, 24(sp)
3350 ; RV64I-NEXT: sd s3, 16(sp)
3351 ; RV64I-NEXT: sd s4, 8(sp)
34023352 ; RV64I-NEXT: mv s2, a1
3403 ; RV64I-NEXT: mv s6, a0
3353 ; RV64I-NEXT: mv s4, a0
34043354 ; RV64I-NEXT: lbu a0, 0(a0)
34053355 ; RV64I-NEXT: slli a1, a1, 56
34063356 ; RV64I-NEXT: srai s1, a1, 56
34073357 ; RV64I-NEXT: addi s3, sp, 7
3408 ; RV64I-NEXT: addi s4, zero, 4
3409 ; RV64I-NEXT: addi s5, zero, 2
34103358 ; RV64I-NEXT: .LBB43_1: # %atomicrmw.start
34113359 ; RV64I-NEXT: # =>This Inner Loop Header: Depth=1
34123360 ; RV64I-NEXT: slli a1, a0, 56
34193367 ; RV64I-NEXT: .LBB43_3: # %atomicrmw.start
34203368 ; RV64I-NEXT: # in Loop: Header=BB43_1 Depth=1
34213369 ; RV64I-NEXT: sb a0, 7(sp)
3422 ; RV64I-NEXT: mv a0, s6
3370 ; RV64I-NEXT: mv a0, s4
34233371 ; RV64I-NEXT: mv a1, s3
3424 ; RV64I-NEXT: mv a3, s4
3425 ; RV64I-NEXT: mv a4, s5
3372 ; RV64I-NEXT: addi a3, zero, 4
3373 ; RV64I-NEXT: addi a4, zero, 2
34263374 ; RV64I-NEXT: call __atomic_compare_exchange_1
34273375 ; RV64I-NEXT: mv a1, a0
34283376 ; RV64I-NEXT: lb a0, 7(sp)
34293377 ; RV64I-NEXT: beqz a1, .LBB43_1
34303378 ; RV64I-NEXT: # %bb.4: # %atomicrmw.end
3431 ; RV64I-NEXT: ld s6, 8(sp)
3432 ; RV64I-NEXT: ld s5, 16(sp)
3433 ; RV64I-NEXT: ld s4, 24(sp)
3434 ; RV64I-NEXT: ld s3, 32(sp)
3435 ; RV64I-NEXT: ld s2, 40(sp)
3436 ; RV64I-NEXT: ld s1, 48(sp)
3437 ; RV64I-NEXT: ld ra, 56(sp)
3438 ; RV64I-NEXT: addi sp, sp, 64
3379 ; RV64I-NEXT: ld s4, 8(sp)
3380 ; RV64I-NEXT: ld s3, 16(sp)
3381 ; RV64I-NEXT: ld s2, 24(sp)
3382 ; RV64I-NEXT: ld s1, 32(sp)
3383 ; RV64I-NEXT: ld ra, 40(sp)
3384 ; RV64I-NEXT: addi sp, sp, 48
34393385 ; RV64I-NEXT: ret
34403386 ;
34413387 ; RV64IA-LABEL: atomicrmw_min_i8_acq_rel:
34803426 ; RV32I-NEXT: sw s2, 20(sp)
34813427 ; RV32I-NEXT: sw s3, 16(sp)
34823428 ; RV32I-NEXT: sw s4, 12(sp)
3483 ; RV32I-NEXT: sw s5, 8(sp)
34843429 ; RV32I-NEXT: mv s2, a1
34853430 ; RV32I-NEXT: mv s4, a0
34863431 ; RV32I-NEXT: lbu a0, 0(a0)
34873432 ; RV32I-NEXT: slli a1, a1, 24
3488 ; RV32I-NEXT: srai s5, a1, 24
3489 ; RV32I-NEXT: addi s3, sp, 7
3490 ; RV32I-NEXT: addi s1, zero, 5
3433 ; RV32I-NEXT: srai s1, a1, 24
3434 ; RV32I-NEXT: addi s3, sp, 11
34913435 ; RV32I-NEXT: .LBB44_1: # %atomicrmw.start
34923436 ; RV32I-NEXT: # =>This Inner Loop Header: Depth=1
34933437 ; RV32I-NEXT: slli a1, a0, 24
34943438 ; RV32I-NEXT: srai a1, a1, 24
34953439 ; RV32I-NEXT: mv a2, a0
3496 ; RV32I-NEXT: bge s5, a1, .LBB44_3
3440 ; RV32I-NEXT: bge s1, a1, .LBB44_3
34973441 ; RV32I-NEXT: # %bb.2: # %atomicrmw.start
34983442 ; RV32I-NEXT: # in Loop: Header=BB44_1 Depth=1
34993443 ; RV32I-NEXT: mv a2, s2
35003444 ; RV32I-NEXT: .LBB44_3: # %atomicrmw.start
35013445 ; RV32I-NEXT: # in Loop: Header=BB44_1 Depth=1
3502 ; RV32I-NEXT: sb a0, 7(sp)
3446 ; RV32I-NEXT: sb a0, 11(sp)
35033447 ; RV32I-NEXT: mv a0, s4
35043448 ; RV32I-NEXT: mv a1, s3
3505 ; RV32I-NEXT: mv a3, s1
3506 ; RV32I-NEXT: mv a4, s1
3449 ; RV32I-NEXT: addi a3, zero, 5
3450 ; RV32I-NEXT: addi a4, zero, 5
35073451 ; RV32I-NEXT: call __atomic_compare_exchange_1
35083452 ; RV32I-NEXT: mv a1, a0
3509 ; RV32I-NEXT: lb a0, 7(sp)
3453 ; RV32I-NEXT: lb a0, 11(sp)
35103454 ; RV32I-NEXT: beqz a1, .LBB44_1
35113455 ; RV32I-NEXT: # %bb.4: # %atomicrmw.end
3512 ; RV32I-NEXT: lw s5, 8(sp)
35133456 ; RV32I-NEXT: lw s4, 12(sp)
35143457 ; RV32I-NEXT: lw s3, 16(sp)
35153458 ; RV32I-NEXT: lw s2, 20(sp)
35503493 ;
35513494 ; RV64I-LABEL: atomicrmw_min_i8_seq_cst:
35523495 ; RV64I: # %bb.0:
3553 ; RV64I-NEXT: addi sp, sp, -64
3554 ; RV64I-NEXT: sd ra, 56(sp)
3555 ; RV64I-NEXT: sd s1, 48(sp)
3556 ; RV64I-NEXT: sd s2, 40(sp)
3557 ; RV64I-NEXT: sd s3, 32(sp)
3558 ; RV64I-NEXT: sd s4, 24(sp)
3559 ; RV64I-NEXT: sd s5, 16(sp)
3496 ; RV64I-NEXT: addi sp, sp, -48
3497 ; RV64I-NEXT: sd ra, 40(sp)
3498 ; RV64I-NEXT: sd s1, 32(sp)
3499 ; RV64I-NEXT: sd s2, 24(sp)
3500 ; RV64I-NEXT: sd s3, 16(sp)
3501 ; RV64I-NEXT: sd s4, 8(sp)
35603502 ; RV64I-NEXT: mv s2, a1
35613503 ; RV64I-NEXT: mv s4, a0
35623504 ; RV64I-NEXT: lbu a0, 0(a0)
35633505 ; RV64I-NEXT: slli a1, a1, 56
3564 ; RV64I-NEXT: srai s5, a1, 56
3565 ; RV64I-NEXT: addi s3, sp, 15
3566 ; RV64I-NEXT: addi s1, zero, 5
3506 ; RV64I-NEXT: srai s1, a1, 56
3507 ; RV64I-NEXT: addi s3, sp, 7
35673508 ; RV64I-NEXT: .LBB44_1: # %atomicrmw.start
35683509 ; RV64I-NEXT: # =>This Inner Loop Header: Depth=1
35693510 ; RV64I-NEXT: slli a1, a0, 56
35703511 ; RV64I-NEXT: srai a1, a1, 56
35713512 ; RV64I-NEXT: mv a2, a0
3572 ; RV64I-NEXT: bge s5, a1, .LBB44_3
3513 ; RV64I-NEXT: bge s1, a1, .LBB44_3
35733514 ; RV64I-NEXT: # %bb.2: # %atomicrmw.start
35743515 ; RV64I-NEXT: # in Loop: Header=BB44_1 Depth=1
35753516 ; RV64I-NEXT: mv a2, s2
35763517 ; RV64I-NEXT: .LBB44_3: # %atomicrmw.start
35773518 ; RV64I-NEXT: # in Loop: Header=BB44_1 Depth=1
3578 ; RV64I-NEXT: sb a0, 15(sp)
3519 ; RV64I-NEXT: sb a0, 7(sp)
35793520 ; RV64I-NEXT: mv a0, s4
35803521 ; RV64I-NEXT: mv a1, s3
3581 ; RV64I-NEXT: mv a3, s1
3582 ; RV64I-NEXT: mv a4, s1
3522 ; RV64I-NEXT: addi a3, zero, 5
3523 ; RV64I-NEXT: addi a4, zero, 5
35833524 ; RV64I-NEXT: call __atomic_compare_exchange_1
35843525 ; RV64I-NEXT: mv a1, a0
3585 ; RV64I-NEXT: lb a0, 15(sp)
3526 ; RV64I-NEXT: lb a0, 7(sp)
35863527 ; RV64I-NEXT: beqz a1, .LBB44_1
35873528 ; RV64I-NEXT: # %bb.4: # %atomicrmw.end
3588 ; RV64I-NEXT: ld s5, 16(sp)
3589 ; RV64I-NEXT: ld s4, 24(sp)
3590 ; RV64I-NEXT: ld s3, 32(sp)
3591 ; RV64I-NEXT: ld s2, 40(sp)
3592 ; RV64I-NEXT: ld s1, 48(sp)
3593 ; RV64I-NEXT: ld ra, 56(sp)
3594 ; RV64I-NEXT: addi sp, sp, 64
3529 ; RV64I-NEXT: ld s4, 8(sp)
3530 ; RV64I-NEXT: ld s3, 16(sp)
3531 ; RV64I-NEXT: ld s2, 24(sp)
3532 ; RV64I-NEXT: ld s1, 32(sp)
3533 ; RV64I-NEXT: ld ra, 40(sp)
3534 ; RV64I-NEXT: addi sp, sp, 48
35953535 ; RV64I-NEXT: ret
35963536 ;
35973537 ; RV64IA-LABEL: atomicrmw_min_i8_seq_cst:
37723712 ; RV32I-NEXT: sw s2, 20(sp)
37733713 ; RV32I-NEXT: sw s3, 16(sp)
37743714 ; RV32I-NEXT: sw s4, 12(sp)
3775 ; RV32I-NEXT: sw s5, 8(sp)
37763715 ; RV32I-NEXT: mv s2, a1
37773716 ; RV32I-NEXT: mv s4, a0
37783717 ; RV32I-NEXT: lbu a0, 0(a0)
3779 ; RV32I-NEXT: andi s5, a1, 255
3780 ; RV32I-NEXT: addi s3, sp, 7
3781 ; RV32I-NEXT: addi s1, zero, 2
3718 ; RV32I-NEXT: andi s1, a1, 255
3719 ; RV32I-NEXT: addi s3, sp, 11
37823720 ; RV32I-NEXT: .LBB46_1: # %atomicrmw.start
37833721 ; RV32I-NEXT: # =>This Inner Loop Header: Depth=1
37843722 ; RV32I-NEXT: andi a1, a0, 255
37853723 ; RV32I-NEXT: mv a2, a0
3786 ; RV32I-NEXT: bltu s5, a1, .LBB46_3
3724 ; RV32I-NEXT: bltu s1, a1, .LBB46_3
37873725 ; RV32I-NEXT: # %bb.2: # %atomicrmw.start
37883726 ; RV32I-NEXT: # in Loop: Header=BB46_1 Depth=1
37893727 ; RV32I-NEXT: mv a2, s2
37903728 ; RV32I-NEXT: .LBB46_3: # %atomicrmw.start
37913729 ; RV32I-NEXT: # in Loop: Header=BB46_1 Depth=1
3792 ; RV32I-NEXT: sb a0, 7(sp)
3730 ; RV32I-NEXT: sb a0, 11(sp)
37933731 ; RV32I-NEXT: mv a0, s4
37943732 ; RV32I-NEXT: mv a1, s3
3795 ; RV32I-NEXT: mv a3, s1
3796 ; RV32I-NEXT: mv a4, s1
3733 ; RV32I-NEXT: addi a3, zero, 2
3734 ; RV32I-NEXT: addi a4, zero, 2
37973735 ; RV32I-NEXT: call __atomic_compare_exchange_1
37983736 ; RV32I-NEXT: mv a1, a0
3799 ; RV32I-NEXT: lb a0, 7(sp)
3737 ; RV32I-NEXT: lb a0, 11(sp)
38003738 ; RV32I-NEXT: beqz a1, .LBB46_1
38013739 ; RV32I-NEXT: # %bb.4: # %atomicrmw.end
3802 ; RV32I-NEXT: lw s5, 8(sp)
38033740 ; RV32I-NEXT: lw s4, 12(sp)
38043741 ; RV32I-NEXT: lw s3, 16(sp)
38053742 ; RV32I-NEXT: lw s2, 20(sp)
38353772 ;
38363773 ; RV64I-LABEL: atomicrmw_umax_i8_acquire:
38373774 ; RV64I: # %bb.0:
3838 ; RV64I-NEXT: addi sp, sp, -64
3839 ; RV64I-NEXT: sd ra, 56(sp)
3840 ; RV64I-NEXT: sd s1, 48(sp)
3841 ; RV64I-NEXT: sd s2, 40(sp)
3842 ; RV64I-NEXT: sd s3, 32(sp)
3843 ; RV64I-NEXT: sd s4, 24(sp)
3844 ; RV64I-NEXT: sd s5, 16(sp)
3775 ; RV64I-NEXT: addi sp, sp, -48
3776 ; RV64I-NEXT: sd ra, 40(sp)
3777 ; RV64I-NEXT: sd s1, 32(sp)
3778 ; RV64I-NEXT: sd s2, 24(sp)
3779 ; RV64I-NEXT: sd s3, 16(sp)
3780 ; RV64I-NEXT: sd s4, 8(sp)
38453781 ; RV64I-NEXT: mv s2, a1
38463782 ; RV64I-NEXT: mv s4, a0
38473783 ; RV64I-NEXT: lbu a0, 0(a0)
3848 ; RV64I-NEXT: andi s5, a1, 255
3849 ; RV64I-NEXT: addi s3, sp, 15
3850 ; RV64I-NEXT: addi s1, zero, 2
3784 ; RV64I-NEXT: andi s1, a1, 255
3785 ; RV64I-NEXT: addi s3, sp, 7
38513786 ; RV64I-NEXT: .LBB46_1: # %atomicrmw.start
38523787 ; RV64I-NEXT: # =>This Inner Loop Header: Depth=1
38533788 ; RV64I-NEXT: andi a1, a0, 255
38543789 ; RV64I-NEXT: mv a2, a0
3855 ; RV64I-NEXT: bltu s5, a1, .LBB46_3
3790 ; RV64I-NEXT: bltu s1, a1, .LBB46_3
38563791 ; RV64I-NEXT: # %bb.2: # %atomicrmw.start
38573792 ; RV64I-NEXT: # in Loop: Header=BB46_1 Depth=1
38583793 ; RV64I-NEXT: mv a2, s2
38593794 ; RV64I-NEXT: .LBB46_3: # %atomicrmw.start
38603795 ; RV64I-NEXT: # in Loop: Header=BB46_1 Depth=1
3861 ; RV64I-NEXT: sb a0, 15(sp)
3796 ; RV64I-NEXT: sb a0, 7(sp)
38623797 ; RV64I-NEXT: mv a0, s4
38633798 ; RV64I-NEXT: mv a1, s3
3864 ; RV64I-NEXT: mv a3, s1
3865 ; RV64I-NEXT: mv a4, s1
3799 ; RV64I-NEXT: addi a3, zero, 2
3800 ; RV64I-NEXT: addi a4, zero, 2
38663801 ; RV64I-NEXT: call __atomic_compare_exchange_1
38673802 ; RV64I-NEXT: mv a1, a0
3868 ; RV64I-NEXT: lb a0, 15(sp)
3803 ; RV64I-NEXT: lb a0, 7(sp)
38693804 ; RV64I-NEXT: beqz a1, .LBB46_1
38703805 ; RV64I-NEXT: # %bb.4: # %atomicrmw.end
3871 ; RV64I-NEXT: ld s5, 16(sp)
3872 ; RV64I-NEXT: ld s4, 24(sp)
3873 ; RV64I-NEXT: ld s3, 32(sp)
3874 ; RV64I-NEXT: ld s2, 40(sp)
3875 ; RV64I-NEXT: ld s1, 48(sp)
3876 ; RV64I-NEXT: ld ra, 56(sp)
3877 ; RV64I-NEXT: addi sp, sp, 64
3806 ; RV64I-NEXT: ld s4, 8(sp)
3807 ; RV64I-NEXT: ld s3, 16(sp)
3808 ; RV64I-NEXT: ld s2, 24(sp)
3809 ; RV64I-NEXT: ld s1, 32(sp)
3810 ; RV64I-NEXT: ld ra, 40(sp)
3811 ; RV64I-NEXT: addi sp, sp, 48
38783812 ; RV64I-NEXT: ret
38793813 ;
38803814 ; RV64IA-LABEL: atomicrmw_umax_i8_acquire:
39143848 ; RV32I-NEXT: sw s2, 20(sp)
39153849 ; RV32I-NEXT: sw s3, 16(sp)
39163850 ; RV32I-NEXT: sw s4, 12(sp)
3917 ; RV32I-NEXT: sw s5, 8(sp)
39183851 ; RV32I-NEXT: mv s2, a1
3919 ; RV32I-NEXT: mv s5, a0
3852 ; RV32I-NEXT: mv s4, a0
39203853 ; RV32I-NEXT: lbu a0, 0(a0)
39213854 ; RV32I-NEXT: andi s1, a1, 255
3922 ; RV32I-NEXT: addi s3, sp, 7
3923 ; RV32I-NEXT: addi s4, zero, 3
3855 ; RV32I-NEXT: addi s3, sp, 11
39243856 ; RV32I-NEXT: .LBB47_1: # %atomicrmw.start
39253857 ; RV32I-NEXT: # =>This Inner Loop Header: Depth=1
39263858 ; RV32I-NEXT: andi a1, a0, 255
39313863 ; RV32I-NEXT: mv a2, s2
39323864 ; RV32I-NEXT: .LBB47_3: # %atomicrmw.start
39333865 ; RV32I-NEXT: # in Loop: Header=BB47_1 Depth=1
3934 ; RV32I-NEXT: sb a0, 7(sp)
3935 ; RV32I-NEXT: mv a0, s5
3866 ; RV32I-NEXT: sb a0, 11(sp)
3867 ; RV32I-NEXT: mv a0, s4
39363868 ; RV32I-NEXT: mv a1, s3
3937 ; RV32I-NEXT: mv a3, s4
3869 ; RV32I-NEXT: addi a3, zero, 3
39383870 ; RV32I-NEXT: mv a4, zero
39393871 ; RV32I-NEXT: call __atomic_compare_exchange_1
39403872 ; RV32I-NEXT: mv a1, a0
3941 ; RV32I-NEXT: lb a0, 7(sp)
3873 ; RV32I-NEXT: lb a0, 11(sp)
39423874 ; RV32I-NEXT: beqz a1, .LBB47_1
39433875 ; RV32I-NEXT: # %bb.4: # %atomicrmw.end
3944 ; RV32I-NEXT: lw s5, 8(sp)
39453876 ; RV32I-NEXT: lw s4, 12(sp)
39463877 ; RV32I-NEXT: lw s3, 16(sp)
39473878 ; RV32I-NEXT: lw s2, 20(sp)
39773908 ;
39783909 ; RV64I-LABEL: atomicrmw_umax_i8_release:
39793910 ; RV64I: # %bb.0:
3980 ; RV64I-NEXT: addi sp, sp, -64
3981 ; RV64I-NEXT: sd ra, 56(sp)
3982 ; RV64I-NEXT: sd s1, 48(sp)
3983 ; RV64I-NEXT: sd s2, 40(sp)
3984 ; RV64I-NEXT: sd s3, 32(sp)
3985 ; RV64I-NEXT: sd s4, 24(sp)
3986 ; RV64I-NEXT: sd s5, 16(sp)
3911 ; RV64I-NEXT: addi sp, sp, -48
3912 ; RV64I-NEXT: sd ra, 40(sp)
3913 ; RV64I-NEXT: sd s1, 32(sp)
3914 ; RV64I-NEXT: sd s2, 24(sp)
3915 ; RV64I-NEXT: sd s3, 16(sp)
3916 ; RV64I-NEXT: sd s4, 8(sp)
39873917 ; RV64I-NEXT: mv s2, a1
3988 ; RV64I-NEXT: mv s5, a0
3918 ; RV64I-NEXT: mv s4, a0
39893919 ; RV64I-NEXT: lbu a0, 0(a0)
39903920 ; RV64I-NEXT: andi s1, a1, 255
3991 ; RV64I-NEXT: addi s3, sp, 15
3992 ; RV64I-NEXT: addi s4, zero, 3
3921 ; RV64I-NEXT: addi s3, sp, 7
39933922 ; RV64I-NEXT: .LBB47_1: # %atomicrmw.start
39943923 ; RV64I-NEXT: # =>This Inner Loop Header: Depth=1
39953924 ; RV64I-NEXT: andi a1, a0, 255
40003929 ; RV64I-NEXT: mv a2, s2
40013930 ; RV64I-NEXT: .LBB47_3: # %atomicrmw.start
40023931 ; RV64I-NEXT: # in Loop: Header=BB47_1 Depth=1
4003 ; RV64I-NEXT: sb a0, 15(sp)
4004 ; RV64I-NEXT: mv a0, s5
3932 ; RV64I-NEXT: sb a0, 7(sp)
3933 ; RV64I-NEXT: mv a0, s4
40053934 ; RV64I-NEXT: mv a1, s3
4006 ; RV64I-NEXT: mv a3, s4
3935 ; RV64I-NEXT: addi a3, zero, 3
40073936 ; RV64I-NEXT: mv a4, zero
40083937 ; RV64I-NEXT: call __atomic_compare_exchange_1
40093938 ; RV64I-NEXT: mv a1, a0
4010 ; RV64I-NEXT: lb a0, 15(sp)
3939 ; RV64I-NEXT: lb a0, 7(sp)
40113940 ; RV64I-NEXT: beqz a1, .LBB47_1
40123941 ; RV64I-NEXT: # %bb.4: # %atomicrmw.end
4013 ; RV64I-NEXT: ld s5, 16(sp)
4014 ; RV64I-NEXT: ld s4, 24(sp)
4015 ; RV64I-NEXT: ld s3, 32(sp)
4016 ; RV64I-NEXT: ld s2, 40(sp)
4017 ; RV64I-NEXT: ld s1, 48(sp)
4018 ; RV64I-NEXT: ld ra, 56(sp)
4019 ; RV64I-NEXT: addi sp, sp, 64
3942 ; RV64I-NEXT: ld s4, 8(sp)
3943 ; RV64I-NEXT: ld s3, 16(sp)
3944 ; RV64I-NEXT: ld s2, 24(sp)
3945 ; RV64I-NEXT: ld s1, 32(sp)
3946 ; RV64I-NEXT: ld ra, 40(sp)
3947 ; RV64I-NEXT: addi sp, sp, 48
40203948 ; RV64I-NEXT: ret
40213949 ;
40223950 ; RV64IA-LABEL: atomicrmw_umax_i8_release:
40563984 ; RV32I-NEXT: sw s2, 20(sp)
40573985 ; RV32I-NEXT: sw s3, 16(sp)
40583986 ; RV32I-NEXT: sw s4, 12(sp)
4059 ; RV32I-NEXT: sw s5, 8(sp)
4060 ; RV32I-NEXT: sw s6, 4(sp)
40613987 ; RV32I-NEXT: mv s2, a1
4062 ; RV32I-NEXT: mv s6, a0
3988 ; RV32I-NEXT: mv s4, a0
40633989 ; RV32I-NEXT: lbu a0, 0(a0)
40643990 ; RV32I-NEXT: andi s1, a1, 255
4065 ; RV32I-NEXT: addi s3, sp, 3
4066 ; RV32I-NEXT: addi s4, zero, 4
4067 ; RV32I-NEXT: addi s5, zero, 2
3991 ; RV32I-NEXT: addi s3, sp, 11
40683992 ; RV32I-NEXT: .LBB48_1: # %atomicrmw.start
40693993 ; RV32I-NEXT: # =>This Inner Loop Header: Depth=1
40703994 ; RV32I-NEXT: andi a1, a0, 255
40753999 ; RV32I-NEXT: mv a2, s2
40764000 ; RV32I-NEXT: .LBB48_3: # %atomicrmw.start
40774001 ; RV32I-NEXT: # in Loop: Header=BB48_1 Depth=1
4078 ; RV32I-NEXT: sb a0, 3(sp)
4079 ; RV32I-NEXT: mv a0, s6
4002 ; RV32I-NEXT: sb a0, 11(sp)
4003 ; RV32I-NEXT: mv a0, s4
40804004 ; RV32I-NEXT: mv a1, s3
4081 ; RV32I-NEXT: mv a3, s4
4082 ; RV32I-NEXT: mv a4, s5
4005 ; RV32I-NEXT: addi a3, zero, 4
4006 ; RV32I-NEXT: addi a4, zero, 2
40834007 ; RV32I-NEXT: call __atomic_compare_exchange_1
40844008 ; RV32I-NEXT: mv a1, a0
4085 ; RV32I-NEXT: lb a0, 3(sp)
4009 ; RV32I-NEXT: lb a0, 11(sp)
40864010 ; RV32I-NEXT: beqz a1, .LBB48_1
40874011 ; RV32I-NEXT: # %bb.4: # %atomicrmw.end
4088 ; RV32I-NEXT: lw s6, 4(sp)
4089 ; RV32I-NEXT: lw s5, 8(sp)
40904012 ; RV32I-NEXT: lw s4, 12(sp)
40914013 ; RV32I-NEXT: lw s3, 16(sp)
40924014 ; RV32I-NEXT: lw s2, 20(sp)
41224044 ;
41234045 ; RV64I-LABEL: atomicrmw_umax_i8_acq_rel:
41244046 ; RV64I: # %bb.0:
4125 ; RV64I-NEXT: addi sp, sp, -64
4126 ; RV64I-NEXT: sd ra, 56(sp)
4127 ; RV64I-NEXT: sd s1, 48(sp)
4128 ; RV64I-NEXT: sd s2, 40(sp)
4129 ; RV64I-NEXT: sd s3, 32(sp)
4130 ; RV64I-NEXT: sd s4, 24(sp)
4131 ; RV64I-NEXT: sd s5, 16(sp)
4132 ; RV64I-NEXT: sd s6, 8(sp)
4047 ; RV64I-NEXT: addi sp, sp, -48
4048 ; RV64I-NEXT: sd ra, 40(sp)
4049 ; RV64I-NEXT: sd s1, 32(sp)
4050 ; RV64I-NEXT: sd s2, 24(sp)
4051 ; RV64I-NEXT: sd s3, 16(sp)
4052 ; RV64I-NEXT: sd s4, 8(sp)
41334053 ; RV64I-NEXT: mv s2, a1
4134 ; RV64I-NEXT: mv s6, a0
4054 ; RV64I-NEXT: mv s4, a0
41354055 ; RV64I-NEXT: lbu a0, 0(a0)
41364056 ; RV64I-NEXT: andi s1, a1, 255
41374057 ; RV64I-NEXT: addi s3, sp, 7
4138 ; RV64I-NEXT: addi s4, zero, 4
4139 ; RV64I-NEXT: addi s5, zero, 2
41404058 ; RV64I-NEXT: .LBB48_1: # %atomicrmw.start
41414059 ; RV64I-NEXT: # =>This Inner Loop Header: Depth=1
41424060 ; RV64I-NEXT: andi a1, a0, 255
41484066 ; RV64I-NEXT: .LBB48_3: # %atomicrmw.start
41494067 ; RV64I-NEXT: # in Loop: Header=BB48_1 Depth=1
41504068 ; RV64I-NEXT: sb a0, 7(sp)
4151 ; RV64I-NEXT: mv a0, s6
4069 ; RV64I-NEXT: mv a0, s4
41524070 ; RV64I-NEXT: mv a1, s3
4153 ; RV64I-NEXT: mv a3, s4
4154 ; RV64I-NEXT: mv a4, s5
4071 ; RV64I-NEXT: addi a3, zero, 4
4072 ; RV64I-NEXT: addi a4, zero, 2
41554073 ; RV64I-NEXT: call __atomic_compare_exchange_1
41564074 ; RV64I-NEXT: mv a1, a0
41574075 ; RV64I-NEXT: lb a0, 7(sp)
41584076 ; RV64I-NEXT: beqz a1, .LBB48_1
41594077 ; RV64I-NEXT: # %bb.4: # %atomicrmw.end
4160 ; RV64I-NEXT: ld s6, 8(sp)
4161 ; RV64I-NEXT: ld s5, 16(sp)
4162 ; RV64I-NEXT: ld s4, 24(sp)
4163 ; RV64I-NEXT: ld s3, 32(sp)
4164 ; RV64I-NEXT: ld s2, 40(sp)
4165 ; RV64I-NEXT: ld s1, 48(sp)
4166 ; RV64I-NEXT: ld ra, 56(sp)
4167 ; RV64I-NEXT: addi sp, sp, 64
4078 ; RV64I-NEXT: ld s4, 8(sp)
4079 ; RV64I-NEXT: ld s3, 16(sp)
4080 ; RV64I-NEXT: ld s2, 24(sp)
4081 ; RV64I-NEXT: ld s1, 32(sp)
4082 ; RV64I-NEXT: ld ra, 40(sp)
4083 ; RV64I-NEXT: addi sp, sp, 48
41684084 ; RV64I-NEXT: ret
41694085 ;
41704086 ; RV64IA-LABEL: atomicrmw_umax_i8_acq_rel:
42044120 ; RV32I-NEXT: sw s2, 20(sp)
42054121 ; RV32I-NEXT: sw s3, 16(sp)
42064122 ; RV32I-NEXT: sw s4, 12(sp)
4207 ; RV32I-NEXT: sw s5, 8(sp)
42084123 ; RV32I-NEXT: mv s2, a1
42094124 ; RV32I-NEXT: mv s4, a0
42104125 ; RV32I-NEXT: lbu a0, 0(a0)
4211 ; RV32I-NEXT: andi s5, a1, 255
4212 ; RV32I-NEXT: addi s3, sp, 7
4213 ; RV32I-NEXT: addi s1, zero, 5
4126 ; RV32I-NEXT: andi s1, a1, 255
4127 ; RV32I-NEXT: addi s3, sp, 11
42144128 ; RV32I-NEXT: .LBB49_1: # %atomicrmw.start
42154129 ; RV32I-NEXT: # =>This Inner Loop Header: Depth=1
42164130 ; RV32I-NEXT: andi a1, a0, 255
42174131 ; RV32I-NEXT: mv a2, a0
4218 ; RV32I-NEXT: bltu s5, a1, .LBB49_3
4132 ; RV32I-NEXT: bltu s1, a1, .LBB49_3
42194133 ; RV32I-NEXT: # %bb.2: # %atomicrmw.start
42204134 ; RV32I-NEXT: # in Loop: Header=BB49_1 Depth=1
42214135 ; RV32I-NEXT: mv a2, s2
42224136 ; RV32I-NEXT: .LBB49_3: # %atomicrmw.start
42234137 ; RV32I-NEXT: # in Loop: Header=BB49_1 Depth=1
4224 ; RV32I-NEXT: sb a0, 7(sp)
4138 ; RV32I-NEXT: sb a0, 11(sp)
42254139 ; RV32I-NEXT: mv a0, s4
42264140 ; RV32I-NEXT: mv a1, s3
4227 ; RV32I-NEXT: mv a3, s1
4228 ; RV32I-NEXT: mv a4, s1
4141 ; RV32I-NEXT: addi a3, zero, 5
4142 ; RV32I-NEXT: addi a4, zero, 5
42294143 ; RV32I-NEXT: call __atomic_compare_exchange_1
42304144 ; RV32I-NEXT: mv a1, a0
4231 ; RV32I-NEXT: lb a0, 7(sp)
4145 ; RV32I-NEXT: lb a0, 11(sp)
42324146 ; RV32I-NEXT: beqz a1, .LBB49_1
42334147 ; RV32I-NEXT: # %bb.4: # %atomicrmw.end
4234 ; RV32I-NEXT: lw s5, 8(sp)
42354148 ; RV32I-NEXT: lw s4, 12(sp)
42364149 ; RV32I-NEXT: lw s3, 16(sp)
42374150 ; RV32I-NEXT: lw s2, 20(sp)
42674180 ;
42684181 ; RV64I-LABEL: atomicrmw_umax_i8_seq_cst:
42694182 ; RV64I: # %bb.0:
4270 ; RV64I-NEXT: addi sp, sp, -64
4271 ; RV64I-NEXT: sd ra, 56(sp)
4272 ; RV64I-NEXT: sd s1, 48(sp)
4273 ; RV64I-NEXT: sd s2, 40(sp)
4274 ; RV64I-NEXT: sd s3, 32(sp)
4275 ; RV64I-NEXT: sd s4, 24(sp)
4276 ; RV64I-NEXT: sd s5, 16(sp)
4183 ; RV64I-NEXT: addi sp, sp, -48
4184 ; RV64I-NEXT: sd ra, 40(sp)
4185 ; RV64I-NEXT: sd s1, 32(sp)
4186 ; RV64I-NEXT: sd s2, 24(sp)
4187 ; RV64I-NEXT: sd s3, 16(sp)
4188 ; RV64I-NEXT: sd s4, 8(sp)
42774189 ; RV64I-NEXT: mv s2, a1
42784190 ; RV64I-NEXT: mv s4, a0
42794191 ; RV64I-NEXT: lbu a0, 0(a0)
4280 ; RV64I-NEXT: andi s5, a1, 255
4281 ; RV64I-NEXT: addi s3, sp, 15
4282 ; RV64I-NEXT: addi s1, zero, 5
4192 ; RV64I-NEXT: andi s1, a1, 255
4193 ; RV64I-NEXT: addi s3, sp, 7
42834194 ; RV64I-NEXT: .LBB49_1: # %atomicrmw.start
42844195 ; RV64I-NEXT: # =>This Inner Loop Header: Depth=1
42854196 ; RV64I-NEXT: andi a1, a0, 255
42864197 ; RV64I-NEXT: mv a2, a0
4287 ; RV64I-NEXT: bltu s5, a1, .LBB49_3
4198 ; RV64I-NEXT: bltu s1, a1, .LBB49_3
42884199 ; RV64I-NEXT: # %bb.2: # %atomicrmw.start
42894200 ; RV64I-NEXT: # in Loop: Header=BB49_1 Depth=1
42904201 ; RV64I-NEXT: mv a2, s2
42914202 ; RV64I-NEXT: .LBB49_3: # %atomicrmw.start
42924203 ; RV64I-NEXT: # in Loop: Header=BB49_1 Depth=1
4293 ; RV64I-NEXT: sb a0, 15(sp)
4204 ; RV64I-NEXT: sb a0, 7(sp)
42944205 ; RV64I-NEXT: mv a0, s4
42954206 ; RV64I-NEXT: mv a1, s3
4296 ; RV64I-NEXT: mv a3, s1
4297 ; RV64I-NEXT: mv a4, s1
4207 ; RV64I-NEXT: addi a3, zero, 5
4208 ; RV64I-NEXT: addi a4, zero, 5
42984209 ; RV64I-NEXT: call __atomic_compare_exchange_1
42994210 ; RV64I-NEXT: mv a1, a0
4300 ; RV64I-NEXT: lb a0, 15(sp)
4211 ; RV64I-NEXT: lb a0, 7(sp)
43014212 ; RV64I-NEXT: beqz a1, .LBB49_1
43024213 ; RV64I-NEXT: # %bb.4: # %atomicrmw.end
4303 ; RV64I-NEXT: ld s5, 16(sp)
4304 ; RV64I-NEXT: ld s4, 24(sp)
4305 ; RV64I-NEXT: ld s3, 32(sp)
4306 ; RV64I-NEXT: ld s2, 40(sp)
4307 ; RV64I-NEXT: ld s1, 48(sp)
4308 ; RV64I-NEXT: ld ra, 56(sp)
4309 ; RV64I-NEXT: addi sp, sp, 64
4214 ; RV64I-NEXT: ld s4, 8(sp)
4215 ; RV64I-NEXT: ld s3, 16(sp)
4216 ; RV64I-NEXT: ld s2, 24(sp)
4217 ; RV64I-NEXT: ld s1, 32(sp)
4218 ; RV64I-NEXT: ld ra, 40(sp)
4219 ; RV64I-NEXT: addi sp, sp, 48
43104220 ; RV64I-NEXT: ret
43114221 ;
43124222 ; RV64IA-LABEL: atomicrmw_umax_i8_seq_cst:
44824392 ; RV32I-NEXT: sw s2, 20(sp)
44834393 ; RV32I-NEXT: sw s3, 16(sp)
44844394 ; RV32I-NEXT: sw s4, 12(sp)
4485 ; RV32I-NEXT: sw s5, 8(sp)
44864395 ; RV32I-NEXT: mv s2, a1
44874396 ; RV32I-NEXT: mv s4, a0
44884397 ; RV32I-NEXT: lbu a0, 0(a0)
4489 ; RV32I-NEXT: andi s5, a1, 255
4490 ; RV32I-NEXT: addi s3, sp, 7
4491 ; RV32I-NEXT: addi s1, zero, 2
4398 ; RV32I-NEXT: andi s1, a1, 255
4399 ; RV32I-NEXT: addi s3, sp, 11
44924400 ; RV32I-NEXT: .LBB51_1: # %atomicrmw.start
44934401 ; RV32I-NEXT: # =>This Inner Loop Header: Depth=1
44944402 ; RV32I-NEXT: andi a1, a0, 255
44954403 ; RV32I-NEXT: mv a2, a0
4496 ; RV32I-NEXT: bgeu s5, a1, .LBB51_3
4404 ; RV32I-NEXT: bgeu s1, a1, .LBB51_3
44974405 ; RV32I-NEXT: # %bb.2: # %atomicrmw.start
44984406 ; RV32I-NEXT: # in Loop: Header=BB51_1 Depth=1
44994407 ; RV32I-NEXT: mv a2, s2
45004408 ; RV32I-NEXT: .LBB51_3: # %atomicrmw.start
45014409 ; RV32I-NEXT: # in Loop: Header=BB51_1 Depth=1
4502 ; RV32I-NEXT: sb a0, 7(sp)
4410 ; RV32I-NEXT: sb a0, 11(sp)
45034411 ; RV32I-NEXT: mv a0, s4
45044412 ; RV32I-NEXT: mv a1, s3
4505 ; RV32I-NEXT: mv a3, s1
4506 ; RV32I-NEXT: mv a4, s1
4413 ; RV32I-NEXT: addi a3, zero, 2
4414 ; RV32I-NEXT: addi a4, zero, 2
45074415 ; RV32I-NEXT: call __atomic_compare_exchange_1
45084416 ; RV32I-NEXT: mv a1, a0
4509 ; RV32I-NEXT: lb a0, 7(sp)
4417 ; RV32I-NEXT: lb a0, 11(sp)
45104418 ; RV32I-NEXT: beqz a1, .LBB51_1
45114419 ; RV32I-NEXT: # %bb.4: # %atomicrmw.end
4512 ; RV32I-NEXT: lw s5, 8(sp)
45134420 ; RV32I-NEXT: lw s4, 12(sp)
45144421 ; RV32I-NEXT: lw s3, 16(sp)
45154422 ; RV32I-NEXT: lw s2, 20(sp)
45454452 ;
45464453 ; RV64I-LABEL: atomicrmw_umin_i8_acquire:
45474454 ; RV64I: # %bb.0:
4548 ; RV64I-NEXT: addi sp, sp, -64
4549 ; RV64I-NEXT: sd ra, 56(sp)
4550 ; RV64I-NEXT: sd s1, 48(sp)
4551 ; RV64I-NEXT: sd s2, 40(sp)
4552 ; RV64I-NEXT: sd s3, 32(sp)
4553 ; RV64I-NEXT: sd s4, 24(sp)
4554 ; RV64I-NEXT: sd s5, 16(sp)
4455 ; RV64I-NEXT: addi sp, sp, -48
4456 ; RV64I-NEXT: sd ra, 40(sp)
4457 ; RV64I-NEXT: sd s1, 32(sp)
4458 ; RV64I-NEXT: sd s2, 24(sp)
4459 ; RV64I-NEXT: sd s3, 16(sp)
4460 ; RV64I-NEXT: sd s4, 8(sp)
45554461 ; RV64I-NEXT: mv s2, a1
45564462 ; RV64I-NEXT: mv s4, a0
45574463 ; RV64I-NEXT: lbu a0, 0(a0)
4558 ; RV64I-NEXT: andi s5, a1, 255
4559 ; RV64I-NEXT: addi s3, sp, 15
4560 ; RV64I-NEXT: addi s1, zero, 2
4464 ; RV64I-NEXT: andi s1, a1, 255
4465 ; RV64I-NEXT: addi s3, sp, 7
45614466 ; RV64I-NEXT: .LBB51_1: # %atomicrmw.start
45624467 ; RV64I-NEXT: # =>This Inner Loop Header: Depth=1
45634468 ; RV64I-NEXT: andi a1, a0, 255
45644469 ; RV64I-NEXT: mv a2, a0
4565 ; RV64I-NEXT: bgeu s5, a1, .LBB51_3
4470 ; RV64I-NEXT: bgeu s1, a1, .LBB51_3
45664471 ; RV64I-NEXT: # %bb.2: # %atomicrmw.start
45674472 ; RV64I-NEXT: # in Loop: Header=BB51_1 Depth=1
45684473 ; RV64I-NEXT: mv a2, s2
45694474 ; RV64I-NEXT: .LBB51_3: # %atomicrmw.start
45704475 ; RV64I-NEXT: # in Loop: Header=BB51_1 Depth=1
4571 ; RV64I-NEXT: sb a0, 15(sp)
4476 ; RV64I-NEXT: sb a0, 7(sp)
45724477 ; RV64I-NEXT: mv a0, s4
45734478 ; RV64I-NEXT: mv a1, s3
4574 ; RV64I-NEXT: mv a3, s1
4575 ; RV64I-NEXT: mv a4, s1
4479 ; RV64I-NEXT: addi a3, zero, 2
4480 ; RV64I-NEXT: addi a4, zero, 2
45764481 ; RV64I-NEXT: call __atomic_compare_exchange_1
45774482 ; RV64I-NEXT: mv a1, a0
4578 ; RV64I-NEXT: lb a0, 15(sp)
4483 ; RV64I-NEXT: lb a0, 7(sp)
45794484 ; RV64I-NEXT: beqz a1, .LBB51_1
45804485 ; RV64I-NEXT: # %bb.4: # %atomicrmw.end
4581 ; RV64I-NEXT: ld s5, 16(sp)
4582 ; RV64I-NEXT: ld s4, 24(sp)
4583 ; RV64I-NEXT: ld s3, 32(sp)
4584 ; RV64I-NEXT: ld s2, 40(sp)
4585 ; RV64I-NEXT: ld s1, 48(sp)
4586 ; RV64I-NEXT: ld ra, 56(sp)
4587 ; RV64I-NEXT: addi sp, sp, 64
4486 ; RV64I-NEXT: ld s4, 8(sp)
4487 ; RV64I-NEXT: ld s3, 16(sp)
4488 ; RV64I-NEXT: ld s2, 24(sp)
4489 ; RV64I-NEXT: ld s1, 32(sp)
4490 ; RV64I-NEXT: ld ra, 40(sp)
4491 ; RV64I-NEXT: addi sp, sp, 48
45884492 ; RV64I-NEXT: ret
45894493 ;
45904494 ; RV64IA-LABEL: atomicrmw_umin_i8_acquire:
46244528 ; RV32I-NEXT: sw s2, 20(sp)
46254529 ; RV32I-NEXT: sw s3, 16(sp)
46264530 ; RV32I-NEXT: sw s4, 12(sp)
4627 ; RV32I-NEXT: sw s5, 8(sp)
46284531 ; RV32I-NEXT: mv s2, a1
4629 ; RV32I-NEXT: mv s5, a0
4532 ; RV32I-NEXT: mv s4, a0
46304533 ; RV32I-NEXT: lbu a0, 0(a0)
46314534 ; RV32I-NEXT: andi s1, a1, 255
4632 ; RV32I-NEXT: addi s3, sp, 7
4633 ; RV32I-NEXT: addi s4, zero, 3
4535 ; RV32I-NEXT: addi s3, sp, 11
46344536 ; RV32I-NEXT: .LBB52_1: # %atomicrmw.start
46354537 ; RV32I-NEXT: # =>This Inner Loop Header: Depth=1
46364538 ; RV32I-NEXT: andi a1, a0, 255
46414543 ; RV32I-NEXT: mv a2, s2
46424544 ; RV32I-NEXT: .LBB52_3: # %atomicrmw.start
46434545 ; RV32I-NEXT: # in Loop: Header=BB52_1 Depth=1
4644 ; RV32I-NEXT: sb a0, 7(sp)
4645 ; RV32I-NEXT: mv a0, s5
4546 ; RV32I-NEXT: sb a0, 11(sp)
4547 ; RV32I-NEXT: mv a0, s4
46464548 ; RV32I-NEXT: mv a1, s3
4647 ; RV32I-NEXT: mv a3, s4
4549 ; RV32I-NEXT: addi a3, zero, 3
46484550 ; RV32I-NEXT: mv a4, zero
46494551 ; RV32I-NEXT: call __atomic_compare_exchange_1
46504552 ; RV32I-NEXT: mv a1, a0
4651 ; RV32I-NEXT: lb a0, 7(sp)
4553 ; RV32I-NEXT: lb a0, 11(sp)
46524554 ; RV32I-NEXT: beqz a1, .LBB52_1
46534555 ; RV32I-NEXT: # %bb.4: # %atomicrmw.end
4654 ; RV32I-NEXT: lw s5, 8(sp)
46554556 ; RV32I-NEXT: lw s4, 12(sp)
46564557 ; RV32I-NEXT: lw s3, 16(sp)
46574558 ; RV32I-NEXT: lw s2, 20(sp)
46874588 ;
46884589 ; RV64I-LABEL: atomicrmw_umin_i8_release:
46894590 ; RV64I: # %bb.0:
4690 ; RV64I-NEXT: addi sp, sp, -64
4691 ; RV64I-NEXT: sd ra, 56(sp)
4692 ; RV64I-NEXT: sd s1, 48(sp)
4693 ; RV64I-NEXT: sd s2, 40(sp)
4694 ; RV64I-NEXT: sd s3, 32(sp)
4695 ; RV64I-NEXT: sd s4, 24(sp)
4696 ; RV64I-NEXT: sd s5, 16(sp)
4591 ; RV64I-NEXT: addi sp, sp, -48
4592 ; RV64I-NEXT: sd ra, 40(sp)
4593 ; RV64I-NEXT: sd s1, 32(sp)
4594 ; RV64I-NEXT: sd s2, 24(sp)
4595 ; RV64I-NEXT: sd s3, 16(sp)
4596 ; RV64I-NEXT: sd s4, 8(sp)
46974597 ; RV64I-NEXT: mv s2, a1
4698 ; RV64I-NEXT: mv s5, a0
4598 ; RV64I-NEXT: mv s4, a0
46994599 ; RV64I-NEXT: lbu a0, 0(a0)
47004600 ; RV64I-NEXT: andi s1, a1, 255
4701 ; RV64I-NEXT: addi s3, sp, 15
4702 ; RV64I-NEXT: addi s4, zero, 3
4601 ; RV64I-NEXT: addi s3, sp, 7
47034602 ; RV64I-NEXT: .LBB52_1: # %atomicrmw.start
47044603 ; RV64I-NEXT: # =>This Inner Loop Header: Depth=1
47054604 ; RV64I-NEXT: andi a1, a0, 255
47104609 ; RV64I-NEXT: mv a2, s2
47114610 ; RV64I-NEXT: .LBB52_3: # %atomicrmw.start
47124611 ; RV64I-NEXT: # in Loop: Header=BB52_1 Depth=1
4713 ; RV64I-NEXT: sb a0, 15(sp)
4714 ; RV64I-NEXT: mv a0, s5
4612 ; RV64I-NEXT: sb a0, 7(sp)
4613 ; RV64I-NEXT: mv a0, s4
47154614 ; RV64I-NEXT: mv a1, s3
4716 ; RV64I-NEXT: mv a3, s4
4615 ; RV64I-NEXT: addi a3, zero, 3
47174616 ; RV64I-NEXT: mv a4, zero
47184617 ; RV64I-NEXT: call __atomic_compare_exchange_1
47194618 ; RV64I-NEXT: mv a1, a0
4720 ; RV64I-NEXT: lb a0, 15(sp)
4619 ; RV64I-NEXT: lb a0, 7(sp)
47214620 ; RV64I-NEXT: beqz a1, .LBB52_1
47224621 ; RV64I-NEXT: # %bb.4: # %atomicrmw.end
4723 ; RV64I-NEXT: ld s5, 16(sp)
4724 ; RV64I-NEXT: ld s4, 24(sp)
4725 ; RV64I-NEXT: ld s3, 32(sp)
4726 ; RV64I-NEXT: ld s2, 40(sp)
4727 ; RV64I-NEXT: ld s1, 48(sp)
4728 ; RV64I-NEXT: ld ra, 56(sp)
4729 ; RV64I-NEXT: addi sp, sp, 64
4622 ; RV64I-NEXT: ld s4, 8(sp)
4623 ; RV64I-NEXT: ld s3, 16(sp)
4624 ; RV64I-NEXT: ld s2, 24(sp)
4625 ; RV64I-NEXT: ld s1, 32(sp)
4626 ; RV64I-NEXT: ld ra, 40(sp)
4627 ; RV64I-NEXT: addi sp, sp, 48
47304628 ; RV64I-NEXT: ret
47314629 ;
47324630 ; RV64IA-LABEL: atomicrmw_umin_i8_release:
47664664 ; RV32I-NEXT: sw s2, 20(sp)
47674665 ; RV32I-NEXT: sw s3, 16(sp)
47684666 ; RV32I-NEXT: sw s4, 12(sp)
4769 ; RV32I-NEXT: sw s5, 8(sp)
4770 ; RV32I-NEXT: sw s6, 4(sp)
47714667 ; RV32I-NEXT: mv s2, a1
4772 ; RV32I-NEXT: mv s6, a0
4668 ; RV32I-NEXT: mv s4, a0
47734669 ; RV32I-NEXT: lbu a0, 0(a0)
47744670 ; RV32I-NEXT: andi s1, a1, 255
4775 ; RV32I-NEXT: addi s3, sp, 3
4776 ; RV32I-NEXT: addi s4, zero, 4
4777 ; RV32I-NEXT: addi s5, zero, 2
4671 ; RV32I-NEXT: addi s3, sp, 11
47784672 ; RV32I-NEXT: .LBB53_1: # %atomicrmw.start
47794673 ; RV32I-NEXT: # =>This Inner Loop Header: Depth=1
47804674 ; RV32I-NEXT: andi a1, a0, 255
47854679 ; RV32I-NEXT: mv a2, s2
47864680 ; RV32I-NEXT: .LBB53_3: # %atomicrmw.start
47874681 ; RV32I-NEXT: # in Loop: Header=BB53_1 Depth=1
4788 ; RV32I-NEXT: sb a0, 3(sp)
4789 ; RV32I-NEXT: mv a0, s6
4682 ; RV32I-NEXT: sb a0, 11(sp)
4683 ; RV32I-NEXT: mv a0, s4
47904684 ; RV32I-NEXT: mv a1, s3
4791 ; RV32I-NEXT: mv a3, s4
4792 ; RV32I-NEXT: mv a4, s5
4685 ; RV32I-NEXT: addi a3, zero, 4
4686 ; RV32I-NEXT: addi a4, zero, 2
47934687 ; RV32I-NEXT: call __atomic_compare_exchange_1
47944688 ; RV32I-NEXT: mv a1, a0
4795 ; RV32I-NEXT: lb a0, 3(sp)
4689 ; RV32I-NEXT: lb a0, 11(sp)
47964690 ; RV32I-NEXT: beqz a1, .LBB53_1
47974691 ; RV32I-NEXT: # %bb.4: # %atomicrmw.end
4798 ; RV32I-NEXT: lw s6, 4(sp)
4799 ; RV32I-NEXT: lw s5, 8(sp)
48004692 ; RV32I-NEXT: lw s4, 12(sp)
48014693 ; RV32I-NEXT: lw s3, 16(sp)
48024694 ; RV32I-NEXT: lw s2, 20(sp)
48324724 ;
48334725 ; RV64I-LABEL: atomicrmw_umin_i8_acq_rel:
48344726 ; RV64I: # %bb.0:
4835 ; RV64I-NEXT: addi sp, sp, -64
4836 ; RV64I-NEXT: sd ra, 56(sp)
4837 ; RV64I-NEXT: sd s1, 48(sp)
4838 ; RV64I-NEXT: sd s2, 40(sp)
4839 ; RV64I-NEXT: sd s3, 32(sp)
4840 ; RV64I-NEXT: sd s4, 24(sp)
4841 ; RV64I-NEXT: sd s5, 16(sp)
4842 ; RV64I-NEXT: sd s6, 8(sp)
4727 ; RV64I-NEXT: addi sp, sp, -48
4728 ; RV64I-NEXT: sd ra, 40(sp)
4729 ; RV64I-NEXT: sd s1, 32(sp)
4730 ; RV64I-NEXT: sd s2, 24(sp)
4731 ; RV64I-NEXT: sd s3, 16(sp)
4732 ; RV64I-NEXT: sd s4, 8(sp)
48434733 ; RV64I-NEXT: mv s2, a1
4844 ; RV64I-NEXT: mv s6, a0
4734 ; RV64I-NEXT: mv s4, a0
48454735 ; RV64I-NEXT: lbu a0, 0(a0)
48464736 ; RV64I-NEXT: andi s1, a1, 255
48474737 ; RV64I-NEXT: addi s3, sp, 7
4848 ; RV64I-NEXT: addi s4, zero, 4
4849 ; RV64I-NEXT: addi s5, zero, 2
48504738 ; RV64I-NEXT: .LBB53_1: # %atomicrmw.start
48514739 ; RV64I-NEXT: # =>This Inner Loop Header: Depth=1
48524740 ; RV64I-NEXT: andi a1, a0, 255
48584746 ; RV64I-NEXT: .LBB53_3: # %atomicrmw.start
48594747 ; RV64I-NEXT: # in Loop: Header=BB53_1 Depth=1
48604748 ; RV64I-NEXT: sb a0, 7(sp)
4861 ; RV64I-NEXT: mv a0, s6
4749 ; RV64I-NEXT: mv a0, s4
48624750 ; RV64I-NEXT: mv a1, s3
4863 ; RV64I-NEXT: mv a3, s4
4864 ; RV64I-NEXT: mv a4, s5
4751 ; RV64I-NEXT: addi a3, zero, 4
4752 ; RV64I-NEXT: addi a4, zero, 2
48654753 ; RV64I-NEXT: call __atomic_compare_exchange_1
48664754 ; RV64I-NEXT: mv a1, a0
48674755 ; RV64I-NEXT: lb a0, 7(sp)
48684756 ; RV64I-NEXT: beqz a1, .LBB53_1
48694757 ; RV64I-NEXT: # %bb.4: # %atomicrmw.end
4870 ; RV64I-NEXT: ld s6, 8(sp)
4871 ; RV64I-NEXT: ld s5, 16(sp)
4872 ; RV64I-NEXT: ld s4, 24(sp)
4873 ; RV64I-NEXT: ld s3, 32(sp)
4874 ; RV64I-NEXT: ld s2, 40(sp)
4875 ; RV64I-NEXT: ld s1, 48(sp)
4876 ; RV64I-NEXT: ld ra, 56(sp)
4877 ; RV64I-NEXT: addi sp, sp, 64
4758 ; RV64I-NEXT: ld s4, 8(sp)
4759 ; RV64I-NEXT: ld s3, 16(sp)
4760 ; RV64I-NEXT: ld s2, 24(sp)
4761 ; RV64I-NEXT: ld s1, 32(sp)
4762 ; RV64I-NEXT: ld ra, 40(sp)
4763 ; RV64I-NEXT: addi sp, sp, 48
48784764 ; RV64I-NEXT: ret
48794765 ;
48804766 ; RV64IA-LABEL: atomicrmw_umin_i8_acq_rel:
49144800 ; RV32I-NEXT: sw s2, 20(sp)
49154801 ; RV32I-NEXT: sw s3, 16(sp)
49164802 ; RV32I-NEXT: sw s4, 12(sp)
4917 ; RV32I-NEXT: sw s5, 8(sp)
49184803 ; RV32I-NEXT: mv s2, a1
49194804 ; RV32I-NEXT: mv s4, a0
49204805 ; RV32I-NEXT: lbu a0, 0(a0)
4921 ; RV32I-NEXT: andi s5, a1, 255
4922 ; RV32I-NEXT: addi s3, sp, 7
4923 ; RV32I-NEXT: addi s1, zero, 5
4806 ; RV32I-NEXT: andi s1, a1, 255
4807 ; RV32I-NEXT: addi s3, sp, 11
49244808 ; RV32I-NEXT: .LBB54_1: # %atomicrmw.start
49254809 ; RV32I-NEXT: # =>This Inner Loop Header: Depth=1
49264810 ; RV32I-NEXT: andi a1, a0, 255
49274811 ; RV32I-NEXT: mv a2, a0
4928 ; RV32I-NEXT: bgeu s5, a1, .LBB54_3
4812 ; RV32I-NEXT: bgeu s1, a1, .LBB54_3
49294813 ; RV32I-NEXT: # %bb.2: # %atomicrmw.start
49304814 ; RV32I-NEXT: # in Loop: Header=BB54_1 Depth=1
49314815 ; RV32I-NEXT: mv a2, s2
49324816 ; RV32I-NEXT: .LBB54_3: # %atomicrmw.start
49334817 ; RV32I-NEXT: # in Loop: Header=BB54_1 Depth=1
4934 ; RV32I-NEXT: sb a0, 7(sp)
4818 ; RV32I-NEXT: sb a0, 11(sp)
49354819 ; RV32I-NEXT: mv a0, s4
49364820 ; RV32I-NEXT: mv a1, s3
4937 ; RV32I-NEXT: mv a3, s1
4938 ; RV32I-NEXT: mv a4, s1
4821 ; RV32I-NEXT: addi a3, zero, 5
4822 ; RV32I-NEXT: addi a4, zero, 5
49394823 ; RV32I-NEXT: call __atomic_compare_exchange_1
49404824 ; RV32I-NEXT: mv a1, a0
4941 ; RV32I-NEXT: lb a0, 7(sp)
4825 ; RV32I-NEXT: lb a0, 11(sp)
49424826 ; RV32I-NEXT: beqz a1, .LBB54_1
49434827 ; RV32I-NEXT: # %bb.4: # %atomicrmw.end
4944 ; RV32I-NEXT: lw s5, 8(sp)
49454828 ; RV32I-NEXT: lw s4, 12(sp)
49464829 ; RV32I-NEXT: lw s3, 16(sp)
49474830 ; RV32I-NEXT: lw s2, 20(sp)
49774860 ;
49784861 ; RV64I-LABEL: atomicrmw_umin_i8_seq_cst:
49794862 ; RV64I: # %bb.0:
4980 ; RV64I-NEXT: addi sp, sp, -64
4981 ; RV64I-NEXT: sd ra, 56(sp)
4982 ; RV64I-NEXT: sd s1, 48(sp)
4983 ; RV64I-NEXT: sd s2, 40(sp)
4984 ; RV64I-NEXT: sd s3, 32(sp)
4985 ; RV64I-NEXT: sd s4, 24(sp)
4986 ; RV64I-NEXT: sd s5, 16(sp)
4863 ; RV64I-NEXT: addi sp, sp, -48
4864 ; RV64I-NEXT: sd ra, 40(sp)
4865 ; RV64I-NEXT: sd s1, 32(sp)
4866 ; RV64I-NEXT: sd s2, 24(sp)
4867 ; RV64I-NEXT: sd s3, 16(sp)
4868 ; RV64I-NEXT: sd s4, 8(sp)
49874869 ; RV64I-NEXT: mv s2, a1
49884870 ; RV64I-NEXT: mv s4, a0
49894871 ; RV64I-NEXT: lbu a0, 0(a0)
4990 ; RV64I-NEXT: andi s5, a1, 255
4991 ; RV64I-NEXT: addi s3, sp, 15
4992 ; RV64I-NEXT: addi s1, zero, 5
4872 ; RV64I-NEXT: andi s1, a1, 255
4873 ; RV64I-NEXT: addi s3, sp, 7
49934874 ; RV64I-NEXT: .LBB54_1: # %atomicrmw.start
49944875 ; RV64I-NEXT: # =>This Inner Loop Header: Depth=1
49954876 ; RV64I-NEXT: andi a1, a0, 255
49964877 ; RV64I-NEXT: mv a2, a0
4997 ; RV64I-NEXT: bgeu s5, a1, .LBB54_3
4878 ; RV64I-NEXT: bgeu s1, a1, .LBB54_3
49984879 ; RV64I-NEXT: # %bb.2: # %atomicrmw.start
49994880 ; RV64I-NEXT: # in Loop: Header=BB54_1 Depth=1
50004881 ; RV64I-NEXT: mv a2, s2
50014882 ; RV64I-NEXT: .LBB54_3: # %atomicrmw.start
50024883 ; RV64I-NEXT: # in Loop: Header=BB54_1 Depth=1
5003 ; RV64I-NEXT: sb a0, 15(sp)
4884 ; RV64I-NEXT: sb a0, 7(sp)
50044885 ; RV64I-NEXT: mv a0, s4
50054886 ; RV64I-NEXT: mv a1, s3
5006 ; RV64I-NEXT: mv a3, s1
5007 ; RV64I-NEXT: mv a4, s1
4887 ; RV64I-NEXT: addi a3, zero, 5
4888 ; RV64I-NEXT: addi a4, zero, 5
50084889 ; RV64I-NEXT: call __atomic_compare_exchange_1
50094890 ; RV64I-NEXT: mv a1, a0
5010 ; RV64I-NEXT: lb a0, 15(sp)
4891 ; RV64I-NEXT: lb a0, 7(sp)
50114892 ; RV64I-NEXT: beqz a1, .LBB54_1
50124893 ; RV64I-NEXT: # %bb.4: # %atomicrmw.end
5013 ; RV64I-NEXT: ld s5, 16(sp)
5014 ; RV64I-NEXT: ld s4, 24(sp)
5015 ; RV64I-NEXT: ld s3, 32(sp)
5016 ; RV64I-NEXT: ld s2, 40(sp)
5017 ; RV64I-NEXT: ld s1, 48(sp)
5018 ; RV64I-NEXT: ld ra, 56(sp)
5019 ; RV64I-NEXT: addi sp, sp, 64
4894 ; RV64I-NEXT: ld s4, 8(sp)
4895 ; RV64I-NEXT: ld s3, 16(sp)
4896 ; RV64I-NEXT: ld s2, 24(sp)
4897 ; RV64I-NEXT: ld s1, 32(sp)
4898 ; RV64I-NEXT: ld ra, 40(sp)
4899 ; RV64I-NEXT: addi sp, sp, 48
50204900 ; RV64I-NEXT: ret
50214901 ;
50224902 ; RV64IA-LABEL: atomicrmw_umin_i8_seq_cst:
73587238 ; RV32I-NEXT: sw s2, 20(sp)
73597239 ; RV32I-NEXT: sw s3, 16(sp)
73607240 ; RV32I-NEXT: sw s4, 12(sp)
7361 ; RV32I-NEXT: sw s5, 8(sp)
73627241 ; RV32I-NEXT: mv s2, a1
73637242 ; RV32I-NEXT: mv s4, a0
73647243 ; RV32I-NEXT: lhu a0, 0(a0)
73657244 ; RV32I-NEXT: slli a1, a1, 16
7366 ; RV32I-NEXT: srai s5, a1, 16
7367 ; RV32I-NEXT: addi s3, sp, 6
7368 ; RV32I-NEXT: addi s1, zero, 2
7245 ; RV32I-NEXT: srai s1, a1, 16
7246 ; RV32I-NEXT: addi s3, sp, 10
73697247 ; RV32I-NEXT: .LBB91_1: # %atomicrmw.start
73707248 ; RV32I-NEXT: # =>This Inner Loop Header: Depth=1
73717249 ; RV32I-NEXT: slli a1, a0, 16
73727250 ; RV32I-NEXT: srai a1, a1, 16
73737251 ; RV32I-NEXT: mv a2, a0
7374 ; RV32I-NEXT: blt s5, a1, .LBB91_3
7252 ; RV32I-NEXT: blt s1, a1, .LBB91_3
73757253 ; RV32I-NEXT: # %bb.2: # %atomicrmw.start
73767254 ; RV32I-NEXT: # in Loop: Header=BB91_1 Depth=1
73777255 ; RV32I-NEXT: mv a2, s2
73787256 ; RV32I-NEXT: .LBB91_3: # %atomicrmw.start
73797257 ; RV32I-NEXT: # in Loop: Header=BB91_1 Depth=1
7380 ; RV32I-NEXT: sh a0, 6(sp)
7258 ; RV32I-NEXT: sh a0, 10(sp)
73817259 ; RV32I-NEXT: mv a0, s4
73827260 ; RV32I-NEXT: mv a1, s3
7383 ; RV32I-NEXT: mv a3, s1
7384 ; RV32I-NEXT: mv a4, s1
7261 ; RV32I-NEXT: addi a3, zero, 2
7262 ; RV32I-NEXT: addi a4, zero, 2
73857263 ; RV32I-NEXT: call __atomic_compare_exchange_2
73867264 ; RV32I-NEXT: mv a1, a0
7387 ; RV32I-NEXT: lh a0, 6(sp)
7265 ; RV32I-NEXT: lh a0, 10(sp)
73887266 ; RV32I-NEXT: beqz a1, .LBB91_1
73897267 ; RV32I-NEXT: # %bb.4: # %atomicrmw.end
7390 ; RV32I-NEXT: lw s5, 8(sp)
73917268 ; RV32I-NEXT: lw s4, 12(sp)
73927269 ; RV32I-NEXT: lw s3, 16(sp)
73937270 ; RV32I-NEXT: lw s2, 20(sp)
74297306 ;
74307307 ; RV64I-LABEL: atomicrmw_max_i16_acquire:
74317308 ; RV64I: # %bb.0:
7432 ; RV64I-NEXT: addi sp, sp, -64
7433 ; RV64I-NEXT: sd ra, 56(sp)
7434 ; RV64I-NEXT: sd s1, 48(sp)
7435 ; RV64I-NEXT: sd s2, 40(sp)
7436 ; RV64I-NEXT: sd s3, 32(sp)
7437 ; RV64I-NEXT: sd s4, 24(sp)
7438 ; RV64I-NEXT: sd s5, 16(sp)
7309 ; RV64I-NEXT: addi sp, sp, -48
7310 ; RV64I-NEXT: sd ra, 40(sp)
7311 ; RV64I-NEXT: sd s1, 32(sp)
7312 ; RV64I-NEXT: sd s2, 24(sp)
7313 ; RV64I-NEXT: sd s3, 16(sp)
7314 ; RV64I-NEXT: sd s4, 8(sp)
74397315 ; RV64I-NEXT: mv s2, a1
74407316 ; RV64I-NEXT: mv s4, a0
74417317 ; RV64I-NEXT: lhu a0, 0(a0)
74427318 ; RV64I-NEXT: slli a1, a1, 48
7443 ; RV64I-NEXT: srai s5, a1, 48
7444 ; RV64I-NEXT: addi s3, sp, 14
7445 ; RV64I-NEXT: addi s1, zero, 2
7319 ; RV64I-NEXT: srai s1, a1, 48
7320 ; RV64I-NEXT: addi s3, sp, 6
74467321 ; RV64I-NEXT: .LBB91_1: # %atomicrmw.start
74477322 ; RV64I-NEXT: # =>This Inner Loop Header: Depth=1
74487323 ; RV64I-NEXT: slli a1, a0, 48
74497324 ; RV64I-NEXT: srai a1, a1, 48
74507325 ; RV64I-NEXT: mv a2, a0
7451 ; RV64I-NEXT: blt s5, a1, .LBB91_3
7326 ; RV64I-NEXT: blt s1, a1, .LBB91_3
74527327 ; RV64I-NEXT: # %bb.2: # %atomicrmw.start
74537328 ; RV64I-NEXT: # in Loop: Header=BB91_1 Depth=1
74547329 ; RV64I-NEXT: mv a2, s2
74557330 ; RV64I-NEXT: .LBB91_3: # %atomicrmw.start
74567331 ; RV64I-NEXT: # in Loop: Header=BB91_1 Depth=1
7457 ; RV64I-NEXT: sh a0, 14(sp)
7332 ; RV64I-NEXT: sh a0, 6(sp)
74587333 ; RV64I-NEXT: mv a0, s4
74597334 ; RV64I-NEXT: mv a1, s3
7460 ; RV64I-NEXT: mv a3, s1
7461 ; RV64I-NEXT: mv a4, s1
7335 ; RV64I-NEXT: addi a3, zero, 2
7336 ; RV64I-NEXT: addi a4, zero, 2
74627337 ; RV64I-NEXT: call __atomic_compare_exchange_2
74637338 ; RV64I-NEXT: mv a1, a0
7464 ; RV64I-NEXT: lh a0, 14(sp)
7339 ; RV64I-NEXT: lh a0, 6(sp)
74657340 ; RV64I-NEXT: beqz a1, .LBB91_1
74667341 ; RV64I-NEXT: # %bb.4: # %atomicrmw.end
7467 ; RV64I-NEXT: ld s5, 16(sp)
7468 ; RV64I-NEXT: ld s4, 24(sp)
7469 ; RV64I-NEXT: ld s3, 32(sp)
7470 ; RV64I-NEXT: ld s2, 40(sp)
7471 ; RV64I-NEXT: ld s1, 48(sp)
7472 ; RV64I-NEXT: ld ra, 56(sp)
7473 ; RV64I-NEXT: addi sp, sp, 64
7342 ; RV64I-NEXT: ld s4, 8(sp)
7343 ; RV64I-NEXT: ld s3, 16(sp)
7344 ; RV64I-NEXT: ld s2, 24(sp)
7345 ; RV64I-NEXT: ld s1, 32(sp)
7346 ; RV64I-NEXT: ld ra, 40(sp)
7347 ; RV64I-NEXT: addi sp, sp, 48
74747348 ; RV64I-NEXT: ret
74757349 ;
74767350 ; RV64IA-LABEL: atomicrmw_max_i16_acquire:
75167390 ; RV32I-NEXT: sw s2, 20(sp)
75177391 ; RV32I-NEXT: sw s3, 16(sp)
75187392 ; RV32I-NEXT: sw s4, 12(sp)
7519 ; RV32I-NEXT: sw s5, 8(sp)
75207393 ; RV32I-NEXT: mv s2, a1
7521 ; RV32I-NEXT: mv s5, a0
7394 ; RV32I-NEXT: mv s4, a0
75227395 ; RV32I-NEXT: lhu a0, 0(a0)
75237396 ; RV32I-NEXT: slli a1, a1, 16
75247397 ; RV32I-NEXT: srai s1, a1, 16
7525 ; RV32I-NEXT: addi s3, sp, 6
7526 ; RV32I-NEXT: addi s4, zero, 3
7398 ; RV32I-NEXT: addi s3, sp, 10
75277399 ; RV32I-NEXT: .LBB92_1: # %atomicrmw.start
75287400 ; RV32I-NEXT: # =>This Inner Loop Header: Depth=1
75297401 ; RV32I-NEXT: slli a1, a0, 16
75357407 ; RV32I-NEXT: mv a2, s2
75367408 ; RV32I-NEXT: .LBB92_3: # %atomicrmw.start
75377409 ; RV32I-NEXT: # in Loop: Header=BB92_1 Depth=1
7538 ; RV32I-NEXT: sh a0, 6(sp)
7539 ; RV32I-NEXT: mv a0, s5
7410 ; RV32I-NEXT: sh a0, 10(sp)
7411 ; RV32I-NEXT: mv a0, s4
75407412 ; RV32I-NEXT: mv a1, s3
7541 ; RV32I-NEXT: mv a3, s4
7413 ; RV32I-NEXT: addi a3, zero, 3
75427414 ; RV32I-NEXT: mv a4, zero
75437415 ; RV32I-NEXT: call __atomic_compare_exchange_2
75447416 ; RV32I-NEXT: mv a1, a0
7545 ; RV32I-NEXT: lh a0, 6(sp)
7417 ; RV32I-NEXT: lh a0, 10(sp)
75467418 ; RV32I-NEXT: beqz a1, .LBB92_1
75477419 ; RV32I-NEXT: # %bb.4: # %atomicrmw.end
7548 ; RV32I-NEXT: lw s5, 8(sp)
75497420 ; RV32I-NEXT: lw s4, 12(sp)
75507421 ; RV32I-NEXT: lw s3, 16(sp)
75517422 ; RV32I-NEXT: lw s2, 20(sp)
75877458 ;
75887459 ; RV64I-LABEL: atomicrmw_max_i16_release:
75897460 ; RV64I: # %bb.0:
7590 ; RV64I-NEXT: addi sp, sp, -64
7591 ; RV64I-NEXT: sd ra, 56(sp)
7592 ; RV64I-NEXT: sd s1, 48(sp)
7593 ; RV64I-NEXT: sd s2, 40(sp)
7594 ; RV64I-NEXT: sd s3, 32(sp)
7595 ; RV64I-NEXT: sd s4, 24(sp)
7596 ; RV64I-NEXT: sd s5, 16(sp)
7461 ; RV64I-NEXT: addi sp, sp, -48
7462 ; RV64I-NEXT: sd ra, 40(sp)
7463 ; RV64I-NEXT: sd s1, 32(sp)
7464 ; RV64I-NEXT: sd s2, 24(sp)
7465 ; RV64I-NEXT: sd s3, 16(sp)
7466 ; RV64I-NEXT: sd s4, 8(sp)
75977467 ; RV64I-NEXT: mv s2, a1
7598 ; RV64I-NEXT: mv s5, a0
7468 ; RV64I-NEXT: mv s4, a0
75997469 ; RV64I-NEXT: lhu a0, 0(a0)
76007470 ; RV64I-NEXT: slli a1, a1, 48
76017471 ; RV64I-NEXT: srai s1, a1, 48
7602 ; RV64I-NEXT: addi s3, sp, 14
7603 ; RV64I-NEXT: addi s4, zero, 3
7472 ; RV64I-NEXT: addi s3, sp, 6
76047473 ; RV64I-NEXT: .LBB92_1: # %atomicrmw.start
76057474 ; RV64I-NEXT: # =>This Inner Loop Header: Depth=1
76067475 ; RV64I-NEXT: slli a1, a0, 48
76127481 ; RV64I-NEXT: mv a2, s2
76137482 ; RV64I-NEXT: .LBB92_3: # %atomicrmw.start
76147483 ; RV64I-NEXT: # in Loop: Header=BB92_1 Depth=1
7615 ; RV64I-NEXT: sh a0, 14(sp)
7616 ; RV64I-NEXT: mv a0, s5
7484 ; RV64I-NEXT: sh a0, 6(sp)
7485 ; RV64I-NEXT: mv a0, s4
76177486 ; RV64I-NEXT: mv a1, s3
7618 ; RV64I-NEXT: mv a3, s4
7487 ; RV64I-NEXT: addi a3, zero, 3
76197488 ; RV64I-NEXT: mv a4, zero
76207489 ; RV64I-NEXT: call __atomic_compare_exchange_2
76217490 ; RV64I-NEXT: mv a1, a0
7622 ; RV64I-NEXT: lh a0, 14(sp)
7491 ; RV64I-NEXT: lh a0, 6(sp)
76237492 ; RV64I-NEXT: beqz a1, .LBB92_1
76247493 ; RV64I-NEXT: # %bb.4: # %atomicrmw.end
7625 ; RV64I-NEXT: ld s5, 16(sp)
7626 ; RV64I-NEXT: ld s4, 24(sp)
7627 ; RV64I-NEXT: ld s3, 32(sp)
7628 ; RV64I-NEXT: ld s2, 40(sp)
7629 ; RV64I-NEXT: ld s1, 48(sp)
7630 ; RV64I-NEXT: ld ra, 56(sp)
7631 ; RV64I-NEXT: addi sp, sp, 64
7494 ; RV64I-NEXT: ld s4, 8(sp)
7495 ; RV64I-NEXT: ld s3, 16(sp)
7496 ; RV64I-NEXT: ld s2, 24(sp)
7497 ; RV64I-NEXT: ld s1, 32(sp)
7498 ; RV64I-NEXT: ld ra, 40(sp)
7499 ; RV64I-NEXT: addi sp, sp, 48
76327500 ; RV64I-NEXT: ret
76337501 ;
76347502 ; RV64IA-LABEL: atomicrmw_max_i16_release:
76747542 ; RV32I-NEXT: sw s2, 20(sp)
76757543 ; RV32I-NEXT: sw s3, 16(sp)
76767544 ; RV32I-NEXT: sw s4, 12(sp)
7677 ; RV32I-NEXT: sw s5, 8(sp)
7678 ; RV32I-NEXT: sw s6, 4(sp)
76797545 ; RV32I-NEXT: mv s2, a1
7680 ; RV32I-NEXT: mv s6, a0
7546 ; RV32I-NEXT: mv s4, a0
76817547 ; RV32I-NEXT: lhu a0, 0(a0)
76827548 ; RV32I-NEXT: slli a1, a1, 16
76837549 ; RV32I-NEXT: srai s1, a1, 16
7684 ; RV32I-NEXT: addi s3, sp, 2
7685 ; RV32I-NEXT: addi s4, zero, 4
7686 ; RV32I-NEXT: addi s5, zero, 2
7550 ; RV32I-NEXT: addi s3, sp, 10
76877551 ; RV32I-NEXT: .LBB93_1: # %atomicrmw.start
76887552 ; RV32I-NEXT: # =>This Inner Loop Header: Depth=1
76897553 ; RV32I-NEXT: slli a1, a0, 16
76957559 ; RV32I-NEXT: mv a2, s2
76967560 ; RV32I-NEXT: .LBB93_3: # %atomicrmw.start
76977561 ; RV32I-NEXT: # in Loop: Header=BB93_1 Depth=1
7698 ; RV32I-NEXT: sh a0, 2(sp)
7699 ; RV32I-NEXT: mv a0, s6
7562 ; RV32I-NEXT: sh a0, 10(sp)
7563 ; RV32I-NEXT: mv a0, s4
77007564 ; RV32I-NEXT: mv a1, s3
7701 ; RV32I-NEXT: mv a3, s4
7702 ; RV32I-NEXT: mv a4, s5
7565 ; RV32I-NEXT: addi a3, zero, 4
7566 ; RV32I-NEXT: addi a4, zero, 2
77037567 ; RV32I-NEXT: call __atomic_compare_exchange_2
77047568 ; RV32I-NEXT: mv a1, a0
7705 ; RV32I-NEXT: lh a0, 2(sp)
7569 ; RV32I-NEXT: lh a0, 10(sp)
77067570 ; RV32I-NEXT: beqz a1, .LBB93_1
77077571 ; RV32I-NEXT: # %bb.4: # %atomicrmw.end
7708 ; RV32I-NEXT: lw s6, 4(sp)
7709 ; RV32I-NEXT: lw s5, 8(sp)
77107572 ; RV32I-NEXT: lw s4, 12(sp)
77117573 ; RV32I-NEXT: lw s3, 16(sp)
77127574 ; RV32I-NEXT: lw s2, 20(sp)
77487610 ;
77497611 ; RV64I-LABEL: atomicrmw_max_i16_acq_rel:
77507612 ; RV64I: # %bb.0:
7751 ; RV64I-NEXT: addi sp, sp, -64
7752 ; RV64I-NEXT: sd ra, 56(sp)
7753 ; RV64I-NEXT: sd s1, 48(sp)
7754 ; RV64I-NEXT: sd s2, 40(sp)
7755 ; RV64I-NEXT: sd s3, 32(sp)
7756 ; RV64I-NEXT: sd s4, 24(sp)
7757 ; RV64I-NEXT: sd s5, 16(sp)
7758 ; RV64I-NEXT: sd s6, 8(sp)
7613 ; RV64I-NEXT: addi sp, sp, -48
7614 ; RV64I-NEXT: sd ra, 40(sp)
7615 ; RV64I-NEXT: sd s1, 32(sp)
7616 ; RV64I-NEXT: sd s2, 24(sp)
7617 ; RV64I-NEXT: sd s3, 16(sp)
7618 ; RV64I-NEXT: sd s4, 8(sp)
77597619 ; RV64I-NEXT: mv s2, a1
7760 ; RV64I-NEXT: mv s6, a0
7620 ; RV64I-NEXT: mv s4, a0
77617621 ; RV64I-NEXT: lhu a0, 0(a0)
77627622 ; RV64I-NEXT: slli a1, a1, 48
77637623 ; RV64I-NEXT: srai s1, a1, 48
77647624 ; RV64I-NEXT: addi s3, sp, 6
7765 ; RV64I-NEXT: addi s4, zero, 4
7766 ; RV64I-NEXT: addi s5, zero, 2
77677625 ; RV64I-NEXT: .LBB93_1: # %atomicrmw.start
77687626 ; RV64I-NEXT: # =>This Inner Loop Header: Depth=1
77697627 ; RV64I-NEXT: slli a1, a0, 48
77767634 ; RV64I-NEXT: .LBB93_3: # %atomicrmw.start
77777635 ; RV64I-NEXT: # in Loop: Header=BB93_1 Depth=1
77787636 ; RV64I-NEXT: sh a0, 6(sp)
7779 ; RV64I-NEXT: mv a0, s6
7637 ; RV64I-NEXT: mv a0, s4
77807638 ; RV64I-NEXT: mv a1, s3
7781 ; RV64I-NEXT: mv a3, s4
7782 ; RV64I-NEXT: mv a4, s5
7639 ; RV64I-NEXT: addi a3, zero, 4
7640 ; RV64I-NEXT: addi a4, zero, 2
77837641 ; RV64I-NEXT: call __atomic_compare_exchange_2
77847642 ; RV64I-NEXT: mv a1, a0
77857643 ; RV64I-NEXT: lh a0, 6(sp)
77867644 ; RV64I-NEXT: beqz a1, .LBB93_1
77877645 ; RV64I-NEXT: # %bb.4: # %atomicrmw.end
7788 ; RV64I-NEXT: ld s6, 8(sp)
7789 ; RV64I-NEXT: ld s5, 16(sp)
7790 ; RV64I-NEXT: ld s4, 24(sp)
7791 ; RV64I-NEXT: ld s3, 32(sp)
7792 ; RV64I-NEXT: ld s2, 40(sp)
7793 ; RV64I-NEXT: ld s1, 48(sp)
7794 ; RV64I-NEXT: ld ra, 56(sp)
7795 ; RV64I-NEXT: addi sp, sp, 64
7646 ; RV64I-NEXT: ld s4, 8(sp)
7647 ; RV64I-NEXT: ld s3, 16(sp)
7648 ; RV64I-NEXT: ld s2, 24(sp)
7649 ; RV64I-NEXT: ld s1, 32(sp)
7650 ; RV64I-NEXT: ld ra, 40(sp)
7651 ; RV64I-NEXT: addi sp, sp, 48
77967652 ; RV64I-NEXT: ret
77977653 ;
77987654 ; RV64IA-LABEL: atomicrmw_max_i16_acq_rel:
78387694 ; RV32I-NEXT: sw s2, 20(sp)
78397695 ; RV32I-NEXT: sw s3, 16(sp)
78407696 ; RV32I-NEXT: sw s4, 12(sp)
7841 ; RV32I-NEXT: sw s5, 8(sp)
78427697 ; RV32I-NEXT: mv s2, a1
78437698 ; RV32I-NEXT: mv s4, a0
78447699 ; RV32I-NEXT: lhu a0, 0(a0)
78457700 ; RV32I-NEXT: slli a1, a1, 16
7846 ; RV32I-NEXT: srai s5, a1, 16
7847 ; RV32I-NEXT: addi s3, sp, 6
7848 ; RV32I-NEXT: addi s1, zero, 5
7701 ; RV32I-NEXT: srai s1, a1, 16
7702 ; RV32I-NEXT: addi s3, sp, 10
78497703 ; RV32I-NEXT: .LBB94_1: # %atomicrmw.start
78507704 ; RV32I-NEXT: # =>This Inner Loop Header: Depth=1
78517705 ; RV32I-NEXT: slli a1, a0, 16
78527706 ; RV32I-NEXT: srai a1, a1, 16
78537707 ; RV32I-NEXT: mv a2, a0
7854 ; RV32I-NEXT: blt s5, a1, .LBB94_3
7708 ; RV32I-NEXT: blt s1, a1, .LBB94_3
78557709 ; RV32I-NEXT: # %bb.2: # %atomicrmw.start
78567710 ; RV32I-NEXT: # in Loop: Header=BB94_1 Depth=1
78577711 ; RV32I-NEXT: mv a2, s2
78587712 ; RV32I-NEXT: .LBB94_3: # %atomicrmw.start
78597713 ; RV32I-NEXT: # in Loop: Header=BB94_1 Depth=1
7860 ; RV32I-NEXT: sh a0, 6(sp)
7714 ; RV32I-NEXT: sh a0, 10(sp)
78617715 ; RV32I-NEXT: mv a0, s4
78627716 ; RV32I-NEXT: mv a1, s3
7863 ; RV32I-NEXT: mv a3, s1
7864 ; RV32I-NEXT: mv a4, s1
7717 ; RV32I-NEXT: addi a3, zero, 5
7718 ; RV32I-NEXT: addi a4, zero, 5
78657719 ; RV32I-NEXT: call __atomic_compare_exchange_2
78667720 ; RV32I-NEXT: mv a1, a0
7867 ; RV32I-NEXT: lh a0, 6(sp)
7721 ; RV32I-NEXT: lh a0, 10(sp)
78687722 ; RV32I-NEXT: beqz a1, .LBB94_1
78697723 ; RV32I-NEXT: # %bb.4: # %atomicrmw.end
7870 ; RV32I-NEXT: lw s5, 8(sp)
78717724 ; RV32I-NEXT: lw s4, 12(sp)
78727725 ; RV32I-NEXT: lw s3, 16(sp)
78737726 ; RV32I-NEXT: lw s2, 20(sp)
79097762 ;
79107763 ; RV64I-LABEL: atomicrmw_max_i16_seq_cst:
79117764 ; RV64I: # %bb.0:
7912 ; RV64I-NEXT: addi sp, sp, -64
7913 ; RV64I-NEXT: sd ra, 56(sp)
7914 ; RV64I-NEXT: sd s1, 48(sp)
7915 ; RV64I-NEXT: sd s2, 40(sp)
7916 ; RV64I-NEXT: sd s3, 32(sp)
7917 ; RV64I-NEXT: sd s4, 24(sp)
7918 ; RV64I-NEXT: sd s5, 16(sp)
7765 ; RV64I-NEXT: addi sp, sp, -48
7766 ; RV64I-NEXT: sd ra, 40(sp)
7767 ; RV64I-NEXT: sd s1, 32(sp)
7768 ; RV64I-NEXT: sd s2, 24(sp)
7769 ; RV64I-NEXT: sd s3, 16(sp)
7770 ; RV64I-NEXT: sd s4, 8(sp)
79197771 ; RV64I-NEXT: mv s2, a1
79207772 ; RV64I-NEXT: mv s4, a0
79217773 ; RV64I-NEXT: lhu a0, 0(a0)
79227774 ; RV64I-NEXT: slli a1, a1, 48
7923 ; RV64I-NEXT: srai s5, a1, 48
7924 ; RV64I-NEXT: addi s3, sp, 14
7925 ; RV64I-NEXT: addi s1, zero, 5
7775 ; RV64I-NEXT: srai s1, a1, 48
7776 ; RV64I-NEXT: addi s3, sp, 6
79267777 ; RV64I-NEXT: .LBB94_1: # %atomicrmw.start
79277778 ; RV64I-NEXT: # =>This Inner Loop Header: Depth=1
79287779 ; RV64I-NEXT: slli a1, a0, 48
79297780 ; RV64I-NEXT: srai a1, a1, 48
79307781 ; RV64I-NEXT: mv a2, a0
7931 ; RV64I-NEXT: blt s5, a1, .LBB94_3
7782 ; RV64I-NEXT: blt s1, a1, .LBB94_3
79327783 ; RV64I-NEXT: # %bb.2: # %atomicrmw.start
79337784 ; RV64I-NEXT: # in Loop: Header=BB94_1 Depth=1
79347785 ; RV64I-NEXT: mv a2, s2
79357786 ; RV64I-NEXT: .LBB94_3: # %atomicrmw.start
79367787 ; RV64I-NEXT: # in Loop: Header=BB94_1 Depth=1
7937 ; RV64I-NEXT: sh a0, 14(sp)
7788 ; RV64I-NEXT: sh a0, 6(sp)
79387789 ; RV64I-NEXT: mv a0, s4
79397790 ; RV64I-NEXT: mv a1, s3
7940 ; RV64I-NEXT: mv a3, s1
7941 ; RV64I-NEXT: mv a4, s1
7791 ; RV64I-NEXT: addi a3, zero, 5
7792 ; RV64I-NEXT: addi a4, zero, 5
79427793 ; RV64I-NEXT: call __atomic_compare_exchange_2
79437794 ; RV64I-NEXT: mv a1, a0
7944 ; RV64I-NEXT: lh a0, 14(sp)
7795 ; RV64I-NEXT: lh a0, 6(sp)
79457796 ; RV64I-NEXT: beqz a1, .LBB94_1
79467797 ; RV64I-NEXT: # %bb.4: # %atomicrmw.end
7947 ; RV64I-NEXT: ld s5, 16(sp)
7948 ; RV64I-NEXT: ld s4, 24(sp)
7949 ; RV64I-NEXT: ld s3, 32(sp)
7950 ; RV64I-NEXT: ld s2, 40(sp)
7951 ; RV64I-NEXT: ld s1, 48(sp)
7952 ; RV64I-NEXT: ld ra, 56(sp)
7953 ; RV64I-NEXT: addi sp, sp, 64
7798 ; RV64I-NEXT: ld s4, 8(sp)
7799 ; RV64I-NEXT: ld s3, 16(sp)
7800 ; RV64I-NEXT: ld s2, 24(sp)
7801 ; RV64I-NEXT: ld s1, 32(sp)
7802 ; RV64I-NEXT: ld ra, 40(sp)
7803 ; RV64I-NEXT: addi sp, sp, 48
79547804 ; RV64I-NEXT: ret
79557805 ;
79567806 ; RV64IA-LABEL: atomicrmw_max_i16_seq_cst:
81487998 ; RV32I-NEXT: sw s2, 20(sp)
81497999 ; RV32I-NEXT: sw s3, 16(sp)
81508000 ; RV32I-NEXT: sw s4, 12(sp)
8151 ; RV32I-NEXT: sw s5, 8(sp)
81528001 ; RV32I-NEXT: mv s2, a1
81538002 ; RV32I-NEXT: mv s4, a0
81548003 ; RV32I-NEXT: lhu a0, 0(a0)
81558004 ; RV32I-NEXT: slli a1, a1, 16
8156 ; RV32I-NEXT: srai s5, a1, 16
8157 ; RV32I-NEXT: addi s3, sp, 6
8158 ; RV32I-NEXT: addi s1, zero, 2
8005 ; RV32I-NEXT: srai s1, a1, 16
8006 ; RV32I-NEXT: addi s3, sp, 10
81598007 ; RV32I-NEXT: .LBB96_1: # %atomicrmw.start
81608008 ; RV32I-NEXT: # =>This Inner Loop Header: Depth=1
81618009 ; RV32I-NEXT: slli a1, a0, 16
81628010 ; RV32I-NEXT: srai a1, a1, 16
81638011 ; RV32I-NEXT: mv a2, a0
8164 ; RV32I-NEXT: bge s5, a1, .LBB96_3
8012 ; RV32I-NEXT: bge s1, a1, .LBB96_3
81658013 ; RV32I-NEXT: # %bb.2: # %atomicrmw.start
81668014 ; RV32I-NEXT: # in Loop: Header=BB96_1 Depth=1
81678015 ; RV32I-NEXT: mv a2, s2
81688016 ; RV32I-NEXT: .LBB96_3: # %atomicrmw.start
81698017 ; RV32I-NEXT: # in Loop: Header=BB96_1 Depth=1
8170 ; RV32I-NEXT: sh a0, 6(sp)
8018 ; RV32I-NEXT: sh a0, 10(sp)
81718019 ; RV32I-NEXT: mv a0, s4
81728020 ; RV32I-NEXT: mv a1, s3
8173 ; RV32I-NEXT: mv a3, s1
8174 ; RV32I-NEXT: mv a4, s1
8021 ; RV32I-NEXT: addi a3, zero, 2
8022 ; RV32I-NEXT: addi a4, zero, 2
81758023 ; RV32I-NEXT: call __atomic_compare_exchange_2
81768024 ; RV32I-NEXT: mv a1, a0
8177 ; RV32I-NEXT: lh a0, 6(sp)
8025 ; RV32I-NEXT: lh a0, 10(sp)
81788026 ; RV32I-NEXT: beqz a1, .LBB96_1
81798027 ; RV32I-NEXT: # %bb.4: # %atomicrmw.end
8180 ; RV32I-NEXT: lw s5, 8(sp)
81818028 ; RV32I-NEXT: lw s4, 12(sp)
81828029 ; RV32I-NEXT: lw s3, 16(sp)
81838030 ; RV32I-NEXT: lw s2, 20(sp)
82198066 ;
82208067 ; RV64I-LABEL: atomicrmw_min_i16_acquire:
82218068 ; RV64I: # %bb.0:
8222 ; RV64I-NEXT: addi sp, sp, -64
8223 ; RV64I-NEXT: sd ra, 56(sp)
8224 ; RV64I-NEXT: sd s1, 48(sp)
8225 ; RV64I-NEXT: sd s2, 40(sp)
8226 ; RV64I-NEXT: sd s3, 32(sp)
8227 ; RV64I-NEXT: sd s4, 24(sp)
8228 ; RV64I-NEXT: sd s5, 16(sp)
8069 ; RV64I-NEXT: addi sp, sp, -48
8070 ; RV64I-NEXT: sd ra, 40(sp)
8071 ; RV64I-NEXT: sd s1, 32(sp)
8072 ; RV64I-NEXT: sd s2, 24(sp)
8073 ; RV64I-NEXT: sd s3, 16(sp)
8074 ; RV64I-NEXT: sd s4, 8(sp)
82298075 ; RV64I-NEXT: mv s2, a1
82308076 ; RV64I-NEXT: mv s4, a0
82318077 ; RV64I-NEXT: lhu a0, 0(a0)
82328078 ; RV64I-NEXT: slli a1, a1, 48
8233 ; RV64I-NEXT: srai s5, a1, 48
8234 ; RV64I-NEXT: addi s3, sp, 14
8235 ; RV64I-NEXT: addi s1, zero, 2
8079 ; RV64I-NEXT: srai s1, a1, 48
8080 ; RV64I-NEXT: addi s3, sp, 6
82368081 ; RV64I-NEXT: .LBB96_1: # %atomicrmw.start
82378082 ; RV64I-NEXT: # =>This Inner Loop Header: Depth=1
82388083 ; RV64I-NEXT: slli a1, a0, 48
82398084 ; RV64I-NEXT: srai a1, a1, 48
82408085 ; RV64I-NEXT: mv a2, a0
8241 ; RV64I-NEXT: bge s5, a1, .LBB96_3
8086 ; RV64I-NEXT: bge s1, a1, .LBB96_3
82428087 ; RV64I-NEXT: # %bb.2: # %atomicrmw.start
82438088 ; RV64I-NEXT: # in Loop: Header=BB96_1 Depth=1
82448089 ; RV64I-NEXT: mv a2, s2
82458090 ; RV64I-NEXT: .LBB96_3: # %atomicrmw.start
82468091 ; RV64I-NEXT: # in Loop: Header=BB96_1 Depth=1
8247 ; RV64I-NEXT: sh a0, 14(sp)
8092 ; RV64I-NEXT: sh a0, 6(sp)
82488093 ; RV64I-NEXT: mv a0, s4
82498094 ; RV64I-NEXT: mv a1, s3
8250 ; RV64I-NEXT: mv a3, s1
8251 ; RV64I-NEXT: mv a4, s1
8095 ; RV64I-NEXT: addi a3, zero, 2
8096 ; RV64I-NEXT: addi a4, zero, 2
82528097 ; RV64I-NEXT: call __atomic_compare_exchange_2
82538098 ; RV64I-NEXT: mv a1, a0
8254 ; RV64I-NEXT: lh a0, 14(sp)
8099 ; RV64I-NEXT: lh a0, 6(sp)
82558100 ; RV64I-NEXT: beqz a1, .LBB96_1
82568101 ; RV64I-NEXT: # %bb.4: # %atomicrmw.end
8257 ; RV64I-NEXT: ld s5, 16(sp)
8258 ; RV64I-NEXT: ld s4, 24(sp)
8259 ; RV64I-NEXT: ld s3, 32(sp)
8260 ; RV64I-NEXT: ld s2, 40(sp)
8261 ; RV64I-NEXT: ld s1, 48(sp)
8262 ; RV64I-NEXT: ld ra, 56(sp)
8263 ; RV64I-NEXT: addi sp, sp, 64
8102 ; RV64I-NEXT: ld s4, 8(sp)
8103 ; RV64I-NEXT: ld s3, 16(sp)
8104 ; RV64I-NEXT: ld s2, 24(sp)
8105 ; RV64I-NEXT: ld s1, 32(sp)
8106 ; RV64I-NEXT: ld ra, 40(sp)
8107 ; RV64I-NEXT: addi sp, sp, 48
82648108 ; RV64I-NEXT: ret
82658109 ;
82668110 ; RV64IA-LABEL: atomicrmw_min_i16_acquire:
83068150 ; RV32I-NEXT: sw s2, 20(sp)
83078151 ; RV32I-NEXT: sw s3, 16(sp)
83088152 ; RV32I-NEXT: sw s4, 12(sp)
8309 ; RV32I-NEXT: sw s5, 8(sp)
83108153 ; RV32I-NEXT: mv s2, a1
8311 ; RV32I-NEXT: mv s5, a0
8154 ; RV32I-NEXT: mv s4, a0
83128155 ; RV32I-NEXT: lhu a0, 0(a0)
83138156 ; RV32I-NEXT: slli a1, a1, 16
83148157 ; RV32I-NEXT: srai s1, a1, 16
8315 ; RV32I-NEXT: addi s3, sp, 6
8316 ; RV32I-NEXT: addi s4, zero, 3
8158 ; RV32I-NEXT: addi s3, sp, 10
83178159 ; RV32I-NEXT: .LBB97_1: # %atomicrmw.start
83188160 ; RV32I-NEXT: # =>This Inner Loop Header: Depth=1
83198161 ; RV32I-NEXT: slli a1, a0, 16
83258167 ; RV32I-NEXT: mv a2, s2
83268168 ; RV32I-NEXT: .LBB97_3: # %atomicrmw.start
83278169 ; RV32I-NEXT: # in Loop: Header=BB97_1 Depth=1
8328 ; RV32I-NEXT: sh a0, 6(sp)
8329 ; RV32I-NEXT: mv a0, s5
8170 ; RV32I-NEXT: sh a0, 10(sp)
8171 ; RV32I-NEXT: mv a0, s4
83308172 ; RV32I-NEXT: mv a1, s3
8331 ; RV32I-NEXT: mv a3, s4
8173 ; RV32I-NEXT: addi a3, zero, 3
83328174 ; RV32I-NEXT: mv a4, zero
83338175 ; RV32I-NEXT: call __atomic_compare_exchange_2
83348176 ; RV32I-NEXT: mv a1, a0
8335 ; RV32I-NEXT: lh a0, 6(sp)
8177 ; RV32I-NEXT: lh a0, 10(sp)
83368178 ; RV32I-NEXT: beqz a1, .LBB97_1
83378179 ; RV32I-NEXT: # %bb.4: # %atomicrmw.end
8338 ; RV32I-NEXT: lw s5, 8(sp)
83398180 ; RV32I-NEXT: lw s4, 12(sp)
83408181 ; RV32I-NEXT: lw s3, 16(sp)
83418182 ; RV32I-NEXT: lw s2, 20(sp)
83778218 ;
83788219 ; RV64I-LABEL: atomicrmw_min_i16_release:
83798220 ; RV64I: # %bb.0:
8380 ; RV64I-NEXT: addi sp, sp, -64
8381 ; RV64I-NEXT: sd ra, 56(sp)
8382 ; RV64I-NEXT: sd s1, 48(sp)
8383 ; RV64I-NEXT: sd s2, 40(sp)
8384 ; RV64I-NEXT: sd s3, 32(sp)
8385 ; RV64I-NEXT: sd s4, 24(sp)
8386 ; RV64I-NEXT: sd s5, 16(sp)
8221 ; RV64I-NEXT: addi sp, sp, -48
8222 ; RV64I-NEXT: sd ra, 40(sp)
8223 ; RV64I-NEXT: sd s1, 32(sp)
8224 ; RV64I-NEXT: sd s2, 24(sp)
8225 ; RV64I-NEXT: sd s3, 16(sp)
8226 ; RV64I-NEXT: sd s4, 8(sp)
83878227 ; RV64I-NEXT: mv s2, a1
8388 ; RV64I-NEXT: mv s5, a0
8228 ; RV64I-NEXT: mv s4, a0
83898229 ; RV64I-NEXT: lhu a0, 0(a0)
83908230 ; RV64I-NEXT: slli a1, a1, 48
83918231 ; RV64I-NEXT: srai s1, a1, 48
8392 ; RV64I-NEXT: addi s3, sp, 14
8393 ; RV64I-NEXT: addi s4, zero, 3
8232 ; RV64I-NEXT: addi s3, sp, 6
83948233 ; RV64I-NEXT: .LBB97_1: # %atomicrmw.start
83958234 ; RV64I-NEXT: # =>This Inner Loop Header: Depth=1
83968235 ; RV64I-NEXT: slli a1, a0, 48
84028241 ; RV64I-NEXT: mv a2, s2
84038242 ; RV64I-NEXT: .LBB97_3: # %atomicrmw.start
84048243 ; RV64I-NEXT: # in Loop: Header=BB97_1 Depth=1
8405 ; RV64I-NEXT: sh a0, 14(sp)
8406 ; RV64I-NEXT: mv a0, s5
8244 ; RV64I-NEXT: sh a0, 6(sp)
8245 ; RV64I-NEXT: mv a0, s4
84078246 ; RV64I-NEXT: mv a1, s3
8408 ; RV64I-NEXT: mv a3, s4
8247 ; RV64I-NEXT: addi a3, zero, 3
84098248 ; RV64I-NEXT: mv a4, zero
84108249 ; RV64I-NEXT: call __atomic_compare_exchange_2
84118250 ; RV64I-NEXT: mv a1, a0
8412 ; RV64I-NEXT: lh a0, 14(sp)
8251 ; RV64I-NEXT: lh a0, 6(sp)
84138252 ; RV64I-NEXT: beqz a1, .LBB97_1
84148253 ; RV64I-NEXT: # %bb.4: # %atomicrmw.end
8415 ; RV64I-NEXT: ld s5, 16(sp)
8416 ; RV64I-NEXT: ld s4, 24(sp)
8417 ; RV64I-NEXT: ld s3, 32(sp)
8418 ; RV64I-NEXT: ld s2, 40(sp)
8419 ; RV64I-NEXT: ld s1, 48(sp)
8420 ; RV64I-NEXT: ld ra, 56(sp)
8421 ; RV64I-NEXT: addi sp, sp, 64
8254 ; RV64I-NEXT: ld s4, 8(sp)
8255 ; RV64I-NEXT: ld s3, 16(sp)
8256 ; RV64I-NEXT: ld s2, 24(sp)
8257 ; RV64I-NEXT: ld s1, 32(sp)
8258 ; RV64I-NEXT: ld ra, 40(sp)
8259 ; RV64I-NEXT: addi sp, sp, 48
84228260 ; RV64I-NEXT: ret
84238261 ;
84248262 ; RV64IA-LABEL: atomicrmw_min_i16_release:
84648302 ; RV32I-NEXT: sw s2, 20(sp)
84658303 ; RV32I-NEXT: sw s3, 16(sp)
84668304 ; RV32I-NEXT: sw s4, 12(sp)
8467 ; RV32I-NEXT: sw s5, 8(sp)
8468 ; RV32I-NEXT: sw s6, 4(sp)
84698305 ; RV32I-NEXT: mv s2, a1
8470 ; RV32I-NEXT: mv s6, a0
8306 ; RV32I-NEXT: mv s4, a0
84718307 ; RV32I-NEXT: lhu a0, 0(a0)
84728308 ; RV32I-NEXT: slli a1, a1, 16
84738309 ; RV32I-NEXT: srai s1, a1, 16
8474 ; RV32I-NEXT: addi s3, sp, 2
8475 ; RV32I-NEXT: addi s4, zero, 4
8476 ; RV32I-NEXT: addi s5, zero, 2
8310 ; RV32I-NEXT: addi s3, sp, 10
84778311 ; RV32I-NEXT: .LBB98_1: # %atomicrmw.start
84788312 ; RV32I-NEXT: # =>This Inner Loop Header: Depth=1
84798313 ; RV32I-NEXT: slli a1, a0, 16
84858319 ; RV32I-NEXT: mv a2, s2
84868320 ; RV32I-NEXT: .LBB98_3: # %atomicrmw.start
84878321 ; RV32I-NEXT: # in Loop: Header=BB98_1 Depth=1
8488 ; RV32I-NEXT: sh a0, 2(sp)
8489 ; RV32I-NEXT: mv a0, s6
8322 ; RV32I-NEXT: sh a0, 10(sp)
8323 ; RV32I-NEXT: mv a0, s4
84908324 ; RV32I-NEXT: mv a1, s3
8491 ; RV32I-NEXT: mv a3, s4
8492 ; RV32I-NEXT: mv a4, s5
8325 ; RV32I-NEXT: addi a3, zero, 4
8326 ; RV32I-NEXT: addi a4, zero, 2
84938327 ; RV32I-NEXT: call __atomic_compare_exchange_2
84948328 ; RV32I-NEXT: mv a1, a0
8495 ; RV32I-NEXT: lh a0, 2(sp)
8329 ; RV32I-NEXT: lh a0, 10(sp)
84968330 ; RV32I-NEXT: beqz a1, .LBB98_1
84978331 ; RV32I-NEXT: # %bb.4: # %atomicrmw.end
8498 ; RV32I-NEXT: lw s6, 4(sp)
8499 ; RV32I-NEXT: lw s5, 8(sp)
85008332 ; RV32I-NEXT: lw s4, 12(sp)
85018333 ; RV32I-NEXT: lw s3, 16(sp)
85028334 ; RV32I-NEXT: lw s2, 20(sp)
85388370 ;
85398371 ; RV64I-LABEL: atomicrmw_min_i16_acq_rel:
85408372 ; RV64I: # %bb.0:
8541 ; RV64I-NEXT: addi sp, sp, -64
8542 ; RV64I-NEXT: sd ra, 56(sp)
8543 ; RV64I-NEXT: sd s1, 48(sp)
8544 ; RV64I-NEXT: sd s2, 40(sp)
8545 ; RV64I-NEXT: sd s3, 32(sp)
8546 ; RV64I-NEXT: sd s4, 24(sp)
8547 ; RV64I-NEXT: sd s5, 16(sp)
8548 ; RV64I-NEXT: sd s6, 8(sp)
8373 ; RV64I-NEXT: addi sp, sp, -48
8374 ; RV64I-NEXT: sd ra, 40(sp)
8375 ; RV64I-NEXT: sd s1, 32(sp)
8376 ; RV64I-NEXT: sd s2, 24(sp)
8377 ; RV64I-NEXT: sd s3, 16(sp)
8378 ; RV64I-NEXT: sd s4, 8(sp)
85498379 ; RV64I-NEXT: mv s2, a1
8550 ; RV64I-NEXT: mv s6, a0
8380 ; RV64I-NEXT: mv s4, a0
85518381 ; RV64I-NEXT: lhu a0, 0(a0)
85528382 ; RV64I-NEXT: slli a1, a1, 48
85538383 ; RV64I-NEXT: srai s1, a1, 48
85548384 ; RV64I-NEXT: addi s3, sp, 6
8555 ; RV64I-NEXT: addi s4, zero, 4
8556 ; RV64I-NEXT: addi s5, zero, 2
85578385 ; RV64I-NEXT: .LBB98_1: # %atomicrmw.start
85588386 ; RV64I-NEXT: # =>This Inner Loop Header: Depth=1
85598387 ; RV64I-NEXT: slli a1, a0, 48
85668394 ; RV64I-NEXT: .LBB98_3: # %atomicrmw.start
85678395 ; RV64I-NEXT: # in Loop: Header=BB98_1 Depth=1
85688396 ; RV64I-NEXT: sh a0, 6(sp)
8569 ; RV64I-NEXT: mv a0, s6
8397 ; RV64I-NEXT: mv a0, s4
85708398 ; RV64I-NEXT: mv a1, s3
8571 ; RV64I-NEXT: mv a3, s4
8572 ; RV64I-NEXT: mv a4, s5
8399 ; RV64I-NEXT: addi a3, zero, 4
8400 ; RV64I-NEXT: addi a4, zero, 2
85738401 ; RV64I-NEXT: call __atomic_compare_exchange_2
85748402 ; RV64I-NEXT: mv a1, a0
85758403 ; RV64I-NEXT: lh a0, 6(sp)
85768404 ; RV64I-NEXT: beqz a1, .LBB98_1
85778405 ; RV64I-NEXT: # %bb.4: # %atomicrmw.end
8578 ; RV64I-NEXT: ld s6, 8(sp)
8579 ; RV64I-NEXT: ld s5, 16(sp)
8580 ; RV64I-NEXT: ld s4, 24(sp)
8581 ; RV64I-NEXT: ld s3, 32(sp)
8582 ; RV64I-NEXT: ld s2, 40(sp)
8583 ; RV64I-NEXT: ld s1, 48(sp)
8584 ; RV64I-NEXT: ld ra, 56(sp)
8585 ; RV64I-NEXT: addi sp, sp, 64
8406 ; RV64I-NEXT: ld s4, 8(sp)
8407 ; RV64I-NEXT: ld s3, 16(sp)
8408 ; RV64I-NEXT: ld s2, 24(sp)
8409 ; RV64I-NEXT: ld s1, 32(sp)
8410 ; RV64I-NEXT: ld ra, 40(sp)
8411 ; RV64I-NEXT: addi sp, sp, 48
85868412 ; RV64I-NEXT: ret
85878413 ;
85888414 ; RV64IA-LABEL: atomicrmw_min_i16_acq_rel:
86288454 ; RV32I-NEXT: sw s2, 20(sp)
86298455 ; RV32I-NEXT: sw s3, 16(sp)
86308456 ; RV32I-NEXT: sw s4, 12(sp)
8631 ; RV32I-NEXT: sw s5, 8(sp)
86328457 ; RV32I-NEXT: mv s2, a1
86338458 ; RV32I-NEXT: mv s4, a0
86348459 ; RV32I-NEXT: lhu a0, 0(a0)
86358460 ; RV32I-NEXT: slli a1, a1, 16
8636 ; RV32I-NEXT: srai s5, a1, 16
8637 ; RV32I-NEXT: addi s3, sp, 6
8638 ; RV32I-NEXT: addi s1, zero, 5
8461 ; RV32I-NEXT: srai s1, a1, 16
8462 ; RV32I-NEXT: addi s3, sp, 10
86398463 ; RV32I-NEXT: .LBB99_1: # %atomicrmw.start
86408464 ; RV32I-NEXT: # =>This Inner Loop Header: Depth=1
86418465 ; RV32I-NEXT: slli a1, a0, 16
86428466 ; RV32I-NEXT: srai a1, a1, 16
86438467 ; RV32I-NEXT: mv a2, a0
8644 ; RV32I-NEXT: bge s5, a1, .LBB99_3
8468 ; RV32I-NEXT: bge s1, a1, .LBB99_3
86458469 ; RV32I-NEXT: # %bb.2: # %atomicrmw.start
86468470 ; RV32I-NEXT: # in Loop: Header=BB99_1 Depth=1
86478471 ; RV32I-NEXT: mv a2, s2
86488472 ; RV32I-NEXT: .LBB99_3: # %atomicrmw.start
86498473 ; RV32I-NEXT: # in Loop: Header=BB99_1 Depth=1
8650 ; RV32I-NEXT: sh a0, 6(sp)
8474 ; RV32I-NEXT: sh a0, 10(sp)
86518475 ; RV32I-NEXT: mv a0, s4
86528476 ; RV32I-NEXT: mv a1, s3
8653 ; RV32I-NEXT: mv a3, s1
8654 ; RV32I-NEXT: mv a4, s1
8477 ; RV32I-NEXT: addi a3, zero, 5
8478 ; RV32I-NEXT: addi a4, zero, 5
86558479 ; RV32I-NEXT: call __atomic_compare_exchange_2
86568480 ; RV32I-NEXT: mv a1, a0
8657 ; RV32I-NEXT: lh a0, 6(sp)
8481 ; RV32I-NEXT: lh a0, 10(sp)
86588482 ; RV32I-NEXT: beqz a1, .LBB99_1
86598483 ; RV32I-NEXT: # %bb.4: # %atomicrmw.end
8660 ; RV32I-NEXT: lw s5, 8(sp)
86618484 ; RV32I-NEXT: lw s4, 12(sp)
86628485 ; RV32I-NEXT: lw s3, 16(sp)
86638486 ; RV32I-NEXT: lw s2, 20(sp)
86998522 ;
87008523 ; RV64I-LABEL: atomicrmw_min_i16_seq_cst:
87018524 ; RV64I: # %bb.0:
8702 ; RV64I-NEXT: addi sp, sp, -64
8703 ; RV64I-NEXT: sd ra, 56(sp)
8704 ; RV64I-NEXT: sd s1, 48(sp)
8705 ; RV64I-NEXT: sd s2, 40(sp)
8706 ; RV64I-NEXT: sd s3, 32(sp)
8707 ; RV64I-NEXT: sd s4, 24(sp)
8708 ; RV64I-NEXT: sd s5, 16(sp)
8525 ; RV64I-NEXT: addi sp, sp, -48
8526 ; RV64I-NEXT: sd ra, 40(sp)
8527 ; RV64I-NEXT: sd s1, 32(sp)
8528 ; RV64I-NEXT: sd s2, 24(sp)
8529 ; RV64I-NEXT: sd s3, 16(sp)
8530 ; RV64I-NEXT: sd s4, 8(sp)
87098531 ; RV64I-NEXT: mv s2, a1
87108532 ; RV64I-NEXT: mv s4, a0
87118533 ; RV64I-NEXT: lhu a0, 0(a0)
87128534 ; RV64I-NEXT: slli a1, a1, 48
8713 ; RV64I-NEXT: srai s5, a1, 48
8714 ; RV64I-NEXT: addi s3, sp, 14
8715 ; RV64I-NEXT: addi s1, zero, 5
8535 ; RV64I-NEXT: srai s1, a1, 48
8536 ; RV64I-NEXT: addi s3, sp, 6
87168537 ; RV64I-NEXT: .LBB99_1: # %atomicrmw.start
87178538 ; RV64I-NEXT: # =>This Inner Loop Header: Depth=1
87188539 ; RV64I-NEXT: slli a1, a0, 48
87198540 ; RV64I-NEXT: srai a1, a1, 48
87208541 ; RV64I-NEXT: mv a2, a0
8721 ; RV64I-NEXT: bge s5, a1, .LBB99_3
8542 ; RV64I-NEXT: bge s1, a1, .LBB99_3
87228543 ; RV64I-NEXT: # %bb.2: # %atomicrmw.start
87238544 ; RV64I-NEXT: # in Loop: Header=BB99_1 Depth=1
87248545 ; RV64I-NEXT: mv a2, s2
87258546 ; RV64I-NEXT: .LBB99_3: # %atomicrmw.start
87268547 ; RV64I-NEXT: # in Loop: Header=BB99_1 Depth=1
8727 ; RV64I-NEXT: sh a0, 14(sp)
8548 ; RV64I-NEXT: sh a0, 6(sp)
87288549 ; RV64I-NEXT: mv a0, s4
87298550 ; RV64I-NEXT: mv a1, s3
8730 ; RV64I-NEXT: mv a3, s1
8731 ; RV64I-NEXT: mv a4, s1
8551 ; RV64I-NEXT: addi a3, zero, 5
8552 ; RV64I-NEXT: addi a4, zero, 5
87328553 ; RV64I-NEXT: call __atomic_compare_exchange_2
87338554 ; RV64I-NEXT: mv a1, a0
8734 ; RV64I-NEXT: lh a0, 14(sp)
8555 ; RV64I-NEXT: lh a0, 6(sp)
87358556 ; RV64I-NEXT: beqz a1, .LBB99_1
87368557 ; RV64I-NEXT: # %bb.4: # %atomicrmw.end
8737 ; RV64I-NEXT: ld s5, 16(sp)
8738 ; RV64I-NEXT: ld s4, 24(sp)
8739 ; RV64I-NEXT: ld s3, 32(sp)
8740 ; RV64I-NEXT: ld s2, 40(sp)
8741 ; RV64I-NEXT: ld s1, 48(sp)
8742 ; RV64I-NEXT: ld ra, 56(sp)
8743 ; RV64I-NEXT: addi sp, sp, 64
8558 ; RV64I-NEXT: ld s4, 8(sp)
8559 ; RV64I-NEXT: ld s3, 16(sp)
8560 ; RV64I-NEXT: ld s2, 24(sp)
8561 ; RV64I-NEXT: ld s1, 32(sp)
8562 ; RV64I-NEXT: ld ra, 40(sp)
8563 ; RV64I-NEXT: addi sp, sp, 48
87448564 ; RV64I-NEXT: ret
87458565 ;
87468566 ; RV64IA-LABEL: atomicrmw_min_i16_seq_cst:
89338753 ; RV32I-NEXT: sw s3, 16(sp)
89348754 ; RV32I-NEXT: sw s4, 12(sp)
89358755 ; RV32I-NEXT: sw s5, 8(sp)
8936 ; RV32I-NEXT: sw s6, 4(sp)
89378756 ; RV32I-NEXT: mv s2, a1
89388757 ; RV32I-NEXT: mv s4, a0
89398758 ; RV32I-NEXT: lhu a0, 0(a0)
89408759 ; RV32I-NEXT: lui a1, 16
8941 ; RV32I-NEXT: addi s5, a1, -1
8942 ; RV32I-NEXT: and s6, s2, s5
8943 ; RV32I-NEXT: addi s3, sp, 2
8944 ; RV32I-NEXT: addi s1, zero, 2
8760 ; RV32I-NEXT: addi s1, a1, -1
8761 ; RV32I-NEXT: and s5, s2, s1
8762 ; RV32I-NEXT: addi s3, sp, 6
89458763 ; RV32I-NEXT: .LBB101_1: # %atomicrmw.start
89468764 ; RV32I-NEXT: # =>This Inner Loop Header: Depth=1
8947 ; RV32I-NEXT: and a1, a0, s5
8765 ; RV32I-NEXT: and a1, a0, s1
89488766 ; RV32I-NEXT: mv a2, a0
8949 ; RV32I-NEXT: bltu s6, a1, .LBB101_3
8767 ; RV32I-NEXT: bltu s5, a1, .LBB101_3
89508768 ; RV32I-NEXT: # %bb.2: # %atomicrmw.start
89518769 ; RV32I-NEXT: # in Loop: Header=BB101_1 Depth=1
89528770 ; RV32I-NEXT: mv a2, s2
89538771 ; RV32I-NEXT: .LBB101_3: # %atomicrmw.start
89548772 ; RV32I-NEXT: # in Loop: Header=BB101_1 Depth=1
8955 ; RV32I-NEXT: sh a0, 2(sp)
8773 ; RV32I-NEXT: sh a0, 6(sp)
89568774 ; RV32I-NEXT: mv a0, s4
89578775 ; RV32I-NEXT: mv a1, s3
8958 ; RV32I-NEXT: mv a3, s1
8959 ; RV32I-NEXT: mv a4, s1
8776 ; RV32I-NEXT: addi a3, zero, 2
8777 ; RV32I-NEXT: addi a4, zero, 2
89608778 ; RV32I-NEXT: call __atomic_compare_exchange_2
89618779 ; RV32I-NEXT: mv a1, a0
8962 ; RV32I-NEXT: lh a0, 2(sp)
8780 ; RV32I-NEXT: lh a0, 6(sp)
89638781 ; RV32I-NEXT: beqz a1, .LBB101_1
89648782 ; RV32I-NEXT: # %bb.4: # %atomicrmw.end
8965 ; RV32I-NEXT: lw s6, 4(sp)
89668783 ; RV32I-NEXT: lw s5, 8(sp)
89678784 ; RV32I-NEXT: lw s4, 12(sp)
89688785 ; RV32I-NEXT: lw s3, 16(sp)
90078824 ; RV64I-NEXT: sd s3, 32(sp)
90088825 ; RV64I-NEXT: sd s4, 24(sp)
90098826 ; RV64I-NEXT: sd s5, 16(sp)
9010 ; RV64I-NEXT: sd s6, 8(sp)
90118827 ; RV64I-NEXT: mv s2, a1
90128828 ; RV64I-NEXT: mv s4, a0
90138829 ; RV64I-NEXT: lhu a0, 0(a0)
90148830 ; RV64I-NEXT: lui a1, 16
9015 ; RV64I-NEXT: addiw s5, a1, -1
9016 ; RV64I-NEXT: and s6, s2, s5
9017 ; RV64I-NEXT: addi s3, sp, 6
9018 ; RV64I-NEXT: addi s1, zero, 2
8831 ; RV64I-NEXT: addiw s1, a1, -1
8832 ; RV64I-NEXT: and s5, s2, s1
8833 ; RV64I-NEXT: addi s3, sp, 14
90198834 ; RV64I-NEXT: .LBB101_1: # %atomicrmw.start
90208835 ; RV64I-NEXT: # =>This Inner Loop Header: Depth=1
9021 ; RV64I-NEXT: and a1, a0, s5
8836 ; RV64I-NEXT: and a1, a0, s1
90228837 ; RV64I-NEXT: mv a2, a0
9023 ; RV64I-NEXT: bltu s6, a1, .LBB101_3
8838 ; RV64I-NEXT: bltu s5, a1, .LBB101_3
90248839 ; RV64I-NEXT: # %bb.2: # %atomicrmw.start
90258840 ; RV64I-NEXT: # in Loop: Header=BB101_1 Depth=1
90268841 ; RV64I-NEXT: mv a2, s2
90278842 ; RV64I-NEXT: .LBB101_3: # %atomicrmw.start
90288843 ; RV64I-NEXT: # in Loop: Header=BB101_1 Depth=1
9029 ; RV64I-NEXT: sh a0, 6(sp)
8844 ; RV64I-NEXT: sh a0, 14(sp)
90308845 ; RV64I-NEXT: mv a0, s4
90318846 ; RV64I-NEXT: mv a1, s3
9032 ; RV64I-NEXT: mv a3, s1
9033 ; RV64I-NEXT: mv a4, s1
8847 ; RV64I-NEXT: addi a3, zero, 2
8848 ; RV64I-NEXT: addi a4, zero, 2
90348849 ; RV64I-NEXT: call __atomic_compare_exchange_2
90358850 ; RV64I-NEXT: mv a1, a0
9036 ; RV64I-NEXT: lh a0, 6(sp)
8851 ; RV64I-NEXT: lh a0, 14(sp)
90378852 ; RV64I-NEXT: beqz a1, .LBB101_1
90388853 ; RV64I-NEXT: # %bb.4: # %atomicrmw.end
9039 ; RV64I-NEXT: ld s6, 8(sp)
90408854 ; RV64I-NEXT: ld s5, 16(sp)
90418855 ; RV64I-NEXT: ld s4, 24(sp)
90428856 ; RV64I-NEXT: ld s3, 32(sp)
90858899 ; RV32I-NEXT: sw s3, 16(sp)
90868900 ; RV32I-NEXT: sw s4, 12(sp)
90878901 ; RV32I-NEXT: sw s5, 8(sp)
9088 ; RV32I-NEXT: sw s6, 4(sp)
90898902 ; RV32I-NEXT: mv s2, a1
9090 ; RV32I-NEXT: mv s5, a0
8903 ; RV32I-NEXT: mv s4, a0
90918904 ; RV32I-NEXT: lhu a0, 0(a0)
90928905 ; RV32I-NEXT: lui a1, 16
90938906 ; RV32I-NEXT: addi s1, a1, -1
9094 ; RV32I-NEXT: and s6, s2, s1
9095 ; RV32I-NEXT: addi s3, sp, 2
9096 ; RV32I-NEXT: addi s4, zero, 3
8907 ; RV32I-NEXT: and s5, s2, s1
8908 ; RV32I-NEXT: addi s3, sp, 6
90978909 ; RV32I-NEXT: .LBB102_1: # %atomicrmw.start
90988910 ; RV32I-NEXT: # =>This Inner Loop Header: Depth=1
90998911 ; RV32I-NEXT: and a1, a0, s1
91008912 ; RV32I-NEXT: mv a2, a0
9101 ; RV32I-NEXT: bltu s6, a1, .LBB102_3
8913 ; RV32I-NEXT: bltu s5, a1, .LBB102_3
91028914 ; RV32I-NEXT: # %bb.2: # %atomicrmw.start
91038915 ; RV32I-NEXT: # in Loop: Header=BB102_1 Depth=1
91048916 ; RV32I-NEXT: mv a2, s2
91058917 ; RV32I-NEXT: .LBB102_3: # %atomicrmw.start
91068918 ; RV32I-NEXT: # in Loop: Header=BB102_1 Depth=1
9107 ; RV32I-NEXT: sh a0, 2(sp)
9108 ; RV32I-NEXT: mv a0, s5
8919 ; RV32I-NEXT: sh a0, 6(sp)
8920 ; RV32I-NEXT: mv a0, s4
91098921 ; RV32I-NEXT: mv a1, s3
9110 ; RV32I-NEXT: mv a3, s4
8922 ; RV32I-NEXT: addi a3, zero, 3
91118923 ; RV32I-NEXT: mv a4, zero
91128924 ; RV32I-NEXT: call __atomic_compare_exchange_2
91138925 ; RV32I-NEXT: mv a1, a0
9114 ; RV32I-NEXT: lh a0, 2(sp)
8926 ; RV32I-NEXT: lh a0, 6(sp)
91158927 ; RV32I-NEXT: beqz a1, .LBB102_1
91168928 ; RV32I-NEXT: # %bb.4: # %atomicrmw.end
9117 ; RV32I-NEXT: lw s6, 4(sp)
91188929 ; RV32I-NEXT: lw s5, 8(sp)
91198930 ; RV32I-NEXT: lw s4, 12(sp)
91208931 ; RV32I-NEXT: lw s3, 16(sp)
91598970 ; RV64I-NEXT: sd s3, 32(sp)
91608971 ; RV64I-NEXT: sd s4, 24(sp)
91618972 ; RV64I-NEXT: sd s5, 16(sp)
9162 ; RV64I-NEXT: sd s6, 8(sp)
91638973 ; RV64I-NEXT: mv s2, a1
9164 ; RV64I-NEXT: mv s5, a0
8974 ; RV64I-NEXT: mv s4, a0
91658975 ; RV64I-NEXT: lhu a0, 0(a0)
91668976 ; RV64I-NEXT: lui a1, 16
91678977 ; RV64I-NEXT: addiw s1, a1, -1
9168 ; RV64I-NEXT: and s6, s2, s1
9169 ; RV64I-NEXT: addi s3, sp, 6
9170 ; RV64I-NEXT: addi s4, zero, 3
8978 ; RV64I-NEXT: and s5, s2, s1
8979 ; RV64I-NEXT: addi s3, sp, 14
91718980 ; RV64I-NEXT: .LBB102_1: # %atomicrmw.start
91728981 ; RV64I-NEXT: # =>This Inner Loop Header: Depth=1
91738982 ; RV64I-NEXT: and a1, a0, s1
91748983 ; RV64I-NEXT: mv a2, a0
9175 ; RV64I-NEXT: bltu s6, a1, .LBB102_3
8984 ; RV64I-NEXT: bltu s5, a1, .LBB102_3
91768985 ; RV64I-NEXT: # %bb.2: # %atomicrmw.start
91778986 ; RV64I-NEXT: # in Loop: Header=BB102_1 Depth=1
91788987 ; RV64I-NEXT: mv a2, s2
91798988 ; RV64I-NEXT: .LBB102_3: # %atomicrmw.start
91808989 ; RV64I-NEXT: # in Loop: Header=BB102_1 Depth=1
9181 ; RV64I-NEXT: sh a0, 6(sp)
9182 ; RV64I-NEXT: mv a0, s5
8990 ; RV64I-NEXT: sh a0, 14(sp)
8991 ; RV64I-NEXT: mv a0, s4
91838992 ; RV64I-NEXT: mv a1, s3
9184 ; RV64I-NEXT: mv a3, s4
8993 ; RV64I-NEXT: addi a3, zero, 3
91858994 ; RV64I-NEXT: mv a4, zero
91868995 ; RV64I-NEXT: call __atomic_compare_exchange_2
91878996 ; RV64I-NEXT: mv a1, a0
9188 ; RV64I-NEXT: lh a0, 6(sp)
8997 ; RV64I-NEXT: lh a0, 14(sp)
91898998 ; RV64I-NEXT: beqz a1, .LBB102_1
91908999 ; RV64I-NEXT: # %bb.4: # %atomicrmw.end
9191 ; RV64I-NEXT: ld s6, 8(sp)
91929000 ; RV64I-NEXT: ld s5, 16(sp)
91939001 ; RV64I-NEXT: ld s4, 24(sp)
91949002 ; RV64I-NEXT: ld s3, 32(sp)
92309038 define i16 @atomicrmw_umax_i16_acq_rel(i16 *%a, i16 %b) nounwind {
92319039 ; RV32I-LABEL: atomicrmw_umax_i16_acq_rel:
92329040 ; RV32I: # %bb.0:
9233 ; RV32I-NEXT: addi sp, sp, -48
9234 ; RV32I-NEXT: sw ra, 44(sp)
9235 ; RV32I-NEXT: sw s1, 40(sp)
9236 ; RV32I-NEXT: sw s2, 36(sp)
9237 ; RV32I-NEXT: sw s3, 32(sp)
9238 ; RV32I-NEXT: sw s4, 28(sp)
9239 ; RV32I-NEXT: sw s5, 24(sp)
9240 ; RV32I-NEXT: sw s6, 20(sp)
9241 ; RV32I-NEXT: sw s7, 16(sp)
9041 ; RV32I-NEXT: addi sp, sp, -32
9042 ; RV32I-NEXT: sw ra, 28(sp)
9043 ; RV32I-NEXT: sw s1, 24(sp)
9044 ; RV32I-NEXT: sw s2, 20(sp)
9045 ; RV32I-NEXT: sw s3, 16(sp)
9046 ; RV32I-NEXT: sw s4, 12(sp)
9047 ; RV32I-NEXT: sw s5, 8(sp)
92429048 ; RV32I-NEXT: mv s2, a1
9243 ; RV32I-NEXT: mv s6, a0
9049 ; RV32I-NEXT: mv s4, a0
92449050 ; RV32I-NEXT: lhu a0, 0(a0)
92459051 ; RV32I-NEXT: lui a1, 16
92469052 ; RV32I-NEXT: addi s1, a1, -1
9247 ; RV32I-NEXT: and s7, s2, s1
9248 ; RV32I-NEXT: addi s3, sp, 14
9249 ; RV32I-NEXT: addi s4, zero, 4
9250 ; RV32I-NEXT: addi s5, zero, 2
9053 ; RV32I-NEXT: and s5, s2, s1
9054 ; RV32I-NEXT: addi s3, sp, 6
92519055 ; RV32I-NEXT: .LBB103_1: # %atomicrmw.start
92529056 ; RV32I-NEXT: # =>This Inner Loop Header: Depth=1
92539057 ; RV32I-NEXT: and a1, a0, s1
92549058 ; RV32I-NEXT: mv a2, a0
9255 ; RV32I-NEXT: bltu s7, a1, .LBB103_3
9059 ; RV32I-NEXT: bltu s5, a1, .LBB103_3
92569060 ; RV32I-NEXT: # %bb.2: # %atomicrmw.start
92579061 ; RV32I-NEXT: # in Loop: Header=BB103_1 Depth=1
92589062 ; RV32I-NEXT: mv a2, s2
92599063 ; RV32I-NEXT: .LBB103_3: # %atomicrmw.start
92609064 ; RV32I-NEXT: # in Loop: Header=BB103_1 Depth=1
9261 ; RV32I-NEXT: sh a0, 14(sp)
9262 ; RV32I-NEXT: mv a0, s6
9065 ; RV32I-NEXT: sh a0, 6(sp)
9066 ; RV32I-NEXT: mv a0, s4
92639067 ; RV32I-NEXT: mv a1, s3
9264 ; RV32I-NEXT: mv a3, s4
9265 ; RV32I-NEXT: mv a4, s5
9068 ; RV32I-NEXT: addi a3, zero, 4
9069 ; RV32I-NEXT: addi a4, zero, 2
92669070 ; RV32I-NEXT: call __atomic_compare_exchange_2
92679071 ; RV32I-NEXT: mv a1, a0
9268 ; RV32I-NEXT: lh a0, 14(sp)
9072 ; RV32I-NEXT: lh a0, 6(sp)
92699073 ; RV32I-NEXT: beqz a1, .LBB103_1
92709074 ; RV32I-NEXT: # %bb.4: # %atomicrmw.end
9271 ; RV32I-NEXT: lw s7, 16(sp)
9272 ; RV32I-NEXT: lw s6, 20(sp)
9273 ; RV32I-NEXT: lw s5, 24(sp)
9274 ; RV32I-NEXT: lw s4, 28(sp)
9275 ; RV32I-NEXT: lw s3, 32(sp)
9276 ; RV32I-NEXT: lw s2, 36(sp)
9277 ; RV32I-NEXT: lw s1, 40(sp)
9278 ; RV32I-NEXT: lw ra, 44(sp)
9279 ; RV32I-NEXT: addi sp, sp, 48
9075 ; RV32I-NEXT: lw s5, 8(sp)
9076 ; RV32I-NEXT: lw s4, 12(sp)
9077 ; RV32I-NEXT: lw s3, 16(sp)
9078 ; RV32I-NEXT: lw s2, 20(sp)
9079 ; RV32I-NEXT: lw s1, 24(sp)
9080 ; RV32I-NEXT: lw ra, 28(sp)
9081 ; RV32I-NEXT: addi sp, sp, 32
92809082 ; RV32I-NEXT: ret
92819083 ;
92829084 ; RV32IA-LABEL: atomicrmw_umax_i16_acq_rel:
93079109 ;
93089110 ; RV64I-LABEL: atomicrmw_umax_i16_acq_rel:
93099111 ; RV64I: # %bb.0:
9310 ; RV64I-NEXT: addi sp, sp, -80
9311 ; RV64I-NEXT: sd ra, 72(sp)
9312 ; RV64I-NEXT: sd s1, 64(sp)
9313 ; RV64I-NEXT: sd s2, 56(sp)
9314 ; RV64I-NEXT: sd s3, 48(sp)
9315 ; RV64I-NEXT: sd s4, 40(sp)
9316 ; RV64I-NEXT: sd s5, 32(sp)
9317 ; RV64I-NEXT: sd s6, 24(sp)
9318 ; RV64I-NEXT: sd s7, 16(sp)
9112 ; RV64I-NEXT: addi sp, sp, -64
9113 ; RV64I-NEXT: sd ra, 56(sp)
9114 ; RV64I-NEXT: sd s1, 48(sp)
9115 ; RV64I-NEXT: sd s2, 40(sp)
9116 ; RV64I-NEXT: sd s3, 32(sp)
9117 ; RV64I-NEXT: sd s4, 24(sp)
9118 ; RV64I-NEXT: sd s5, 16(sp)
93199119 ; RV64I-NEXT: mv s2, a1
9320 ; RV64I-NEXT: mv s6, a0
9120 ; RV64I-NEXT: mv s4, a0
93219121 ; RV64I-NEXT: lhu a0, 0(a0)
93229122 ; RV64I-NEXT: lui a1, 16
93239123 ; RV64I-NEXT: addiw s1, a1, -1
9324 ; RV64I-NEXT: and s7, s2, s1
9124 ; RV64I-NEXT: and s5, s2, s1
93259125 ; RV64I-NEXT: addi s3, sp, 14
9326 ; RV64I-NEXT: addi s4, zero, 4
9327 ; RV64I-NEXT: addi s5, zero, 2
93289126 ; RV64I-NEXT: .LBB103_1: # %atomicrmw.start
93299127 ; RV64I-NEXT: # =>This Inner Loop Header: Depth=1
93309128 ; RV64I-NEXT: and a1, a0, s1
93319129 ; RV64I-NEXT: mv a2, a0
9332 ; RV64I-NEXT: bltu s7, a1, .LBB103_3
9130 ; RV64I-NEXT: bltu s5, a1, .LBB103_3
93339131 ; RV64I-NEXT: # %bb.2: # %atomicrmw.start
93349132 ; RV64I-NEXT: # in Loop: Header=BB103_1 Depth=1
93359133 ; RV64I-NEXT: mv a2, s2
93369134 ; RV64I-NEXT: .LBB103_3: # %atomicrmw.start
93379135 ; RV64I-NEXT: # in Loop: Header=BB103_1 Depth=1
93389136 ; RV64I-NEXT: sh a0, 14(sp)
9339 ; RV64I-NEXT: mv a0, s6