;
; LA64-LABEL: atomicrmw_xchg_i32_acquire:
; LA64: # %bb.0:
-; LA64-NEXT: amswap_db.w $a0, $a1, $a0
+; LA64-NEXT: amswap_db.w $a2, $a1, $a0
+; LA64-NEXT: move $a0, $a2
; LA64-NEXT: ret
%1 = atomicrmw xchg ptr %a, i32 %b acquire
ret i32 %1
;
; LA64-LABEL: atomicrmw_xchg_i64_acquire:
; LA64: # %bb.0:
-; LA64-NEXT: amswap_db.d $a0, $a1, $a0
+; LA64-NEXT: amswap_db.d $a2, $a1, $a0
+; LA64-NEXT: move $a0, $a2
; LA64-NEXT: ret
%1 = atomicrmw xchg ptr %a, i64 %b acquire
ret i64 %1
;
; LA64-LABEL: atomicrmw_add_i32_acquire:
; LA64: # %bb.0:
-; LA64-NEXT: amadd_db.w $a0, $a1, $a0
+; LA64-NEXT: amadd_db.w $a2, $a1, $a0
+; LA64-NEXT: move $a0, $a2
; LA64-NEXT: ret
%1 = atomicrmw add ptr %a, i32 %b acquire
ret i32 %1
;
; LA64-LABEL: atomicrmw_add_i64_acquire:
; LA64: # %bb.0:
-; LA64-NEXT: amadd_db.d $a0, $a1, $a0
+; LA64-NEXT: amadd_db.d $a2, $a1, $a0
+; LA64-NEXT: move $a0, $a2
; LA64-NEXT: ret
%1 = atomicrmw add ptr %a, i64 %b acquire
ret i64 %1
;
; LA64-LABEL: atomicrmw_sub_i32_acquire:
; LA64: # %bb.0:
-; LA64-NEXT: sub.w $a1, $zero, $a1
-; LA64-NEXT: amadd_db.w $a0, $a1, $a0
+; LA64-NEXT: sub.w $a2, $zero, $a1
+; LA64-NEXT: amadd_db.w $a1, $a2, $a0
+; LA64-NEXT: move $a0, $a1
; LA64-NEXT: ret
%1 = atomicrmw sub ptr %a, i32 %b acquire
ret i32 %1
;
; LA64-LABEL: atomicrmw_sub_i64_acquire:
; LA64: # %bb.0:
-; LA64-NEXT: sub.d $a1, $zero, $a1
-; LA64-NEXT: amadd_db.d $a0, $a1, $a0
+; LA64-NEXT: sub.d $a2, $zero, $a1
+; LA64-NEXT: amadd_db.d $a1, $a2, $a0
+; LA64-NEXT: move $a0, $a1
; LA64-NEXT: ret
%1 = atomicrmw sub ptr %a, i64 %b acquire
ret i64 %1
; LA64-NEXT: orn $a1, $a1, $a3
; LA64-NEXT: addi.w $a3, $zero, -4
; LA64-NEXT: and $a0, $a0, $a3
-; LA64-NEXT: amand_db.w $a0, $a1, $a0
-; LA64-NEXT: srl.w $a0, $a0, $a2
+; LA64-NEXT: amand_db.w $a3, $a1, $a0
+; LA64-NEXT: srl.w $a0, $a3, $a2
; LA64-NEXT: ret
%1 = atomicrmw and ptr %a, i8 %b acquire
ret i8 %1
; LA64-NEXT: orn $a1, $a1, $a2
; LA64-NEXT: addi.w $a2, $zero, -4
; LA64-NEXT: and $a0, $a0, $a2
-; LA64-NEXT: amand_db.w $a0, $a1, $a0
-; LA64-NEXT: srl.w $a0, $a0, $a3
+; LA64-NEXT: amand_db.w $a2, $a1, $a0
+; LA64-NEXT: srl.w $a0, $a2, $a3
; LA64-NEXT: ret
%1 = atomicrmw and ptr %a, i16 %b acquire
ret i16 %1
;
; LA64-LABEL: atomicrmw_and_i32_acquire:
; LA64: # %bb.0:
-; LA64-NEXT: amand_db.w $a0, $a1, $a0
+; LA64-NEXT: amand_db.w $a2, $a1, $a0
+; LA64-NEXT: move $a0, $a2
; LA64-NEXT: ret
%1 = atomicrmw and ptr %a, i32 %b acquire
ret i32 %1
;
; LA64-LABEL: atomicrmw_and_i64_acquire:
; LA64: # %bb.0:
-; LA64-NEXT: amand_db.d $a0, $a1, $a0
+; LA64-NEXT: amand_db.d $a2, $a1, $a0
+; LA64-NEXT: move $a0, $a2
; LA64-NEXT: ret
%1 = atomicrmw and ptr %a, i64 %b acquire
ret i64 %1
; LA64-NEXT: slli.d $a0, $a0, 3
; LA64-NEXT: andi $a1, $a1, 255
; LA64-NEXT: sll.w $a1, $a1, $a0
-; LA64-NEXT: amor_db.w $a1, $a1, $a2
-; LA64-NEXT: srl.w $a0, $a1, $a0
+; LA64-NEXT: amor_db.w $a3, $a1, $a2
+; LA64-NEXT: srl.w $a0, $a3, $a0
; LA64-NEXT: ret
%1 = atomicrmw or ptr %a, i8 %b acquire
ret i8 %1
; LA64-NEXT: slli.d $a0, $a0, 3
; LA64-NEXT: bstrpick.d $a1, $a1, 15, 0
; LA64-NEXT: sll.w $a1, $a1, $a0
-; LA64-NEXT: amor_db.w $a1, $a1, $a2
-; LA64-NEXT: srl.w $a0, $a1, $a0
+; LA64-NEXT: amor_db.w $a3, $a1, $a2
+; LA64-NEXT: srl.w $a0, $a3, $a0
; LA64-NEXT: ret
%1 = atomicrmw or ptr %a, i16 %b acquire
ret i16 %1
;
; LA64-LABEL: atomicrmw_or_i32_acquire:
; LA64: # %bb.0:
-; LA64-NEXT: amor_db.w $a0, $a1, $a0
+; LA64-NEXT: amor_db.w $a2, $a1, $a0
+; LA64-NEXT: move $a0, $a2
; LA64-NEXT: ret
%1 = atomicrmw or ptr %a, i32 %b acquire
ret i32 %1
;
; LA64-LABEL: atomicrmw_or_i64_acquire:
; LA64: # %bb.0:
-; LA64-NEXT: amor_db.d $a0, $a1, $a0
+; LA64-NEXT: amor_db.d $a2, $a1, $a0
+; LA64-NEXT: move $a0, $a2
; LA64-NEXT: ret
%1 = atomicrmw or ptr %a, i64 %b acquire
ret i64 %1
; LA64-NEXT: slli.d $a0, $a0, 3
; LA64-NEXT: andi $a1, $a1, 255
; LA64-NEXT: sll.w $a1, $a1, $a0
-; LA64-NEXT: amxor_db.w $a1, $a1, $a2
-; LA64-NEXT: srl.w $a0, $a1, $a0
+; LA64-NEXT: amxor_db.w $a3, $a1, $a2
+; LA64-NEXT: srl.w $a0, $a3, $a0
; LA64-NEXT: ret
%1 = atomicrmw xor ptr %a, i8 %b acquire
ret i8 %1
; LA64-NEXT: slli.d $a0, $a0, 3
; LA64-NEXT: bstrpick.d $a1, $a1, 15, 0
; LA64-NEXT: sll.w $a1, $a1, $a0
-; LA64-NEXT: amxor_db.w $a1, $a1, $a2
-; LA64-NEXT: srl.w $a0, $a1, $a0
+; LA64-NEXT: amxor_db.w $a3, $a1, $a2
+; LA64-NEXT: srl.w $a0, $a3, $a0
; LA64-NEXT: ret
%1 = atomicrmw xor ptr %a, i16 %b acquire
ret i16 %1
;
; LA64-LABEL: atomicrmw_xor_i32_acquire:
; LA64: # %bb.0:
-; LA64-NEXT: amxor_db.w $a0, $a1, $a0
+; LA64-NEXT: amxor_db.w $a2, $a1, $a0
+; LA64-NEXT: move $a0, $a2
; LA64-NEXT: ret
%1 = atomicrmw xor ptr %a, i32 %b acquire
ret i32 %1
;
; LA64-LABEL: atomicrmw_xor_i64_acquire:
; LA64: # %bb.0:
-; LA64-NEXT: amxor_db.d $a0, $a1, $a0
+; LA64-NEXT: amxor_db.d $a2, $a1, $a0
+; LA64-NEXT: move $a0, $a2
; LA64-NEXT: ret
%1 = atomicrmw xor ptr %a, i64 %b acquire
ret i64 %1