115 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc -verify-machineinstrs -mtriple=powerpc64-- -mcpu=pwr7 %s -o - | FileCheck %s --check-prefix=PWR73; RUN: llc -verify-machineinstrs -mtriple=powerpc64-- -mcpu=pwr9 %s -o - | FileCheck %s --check-prefix=PWR94 5@value8 = dso_local global { i8 } zeroinitializer, align 16@value16 = dso_local global { i16 } zeroinitializer, align 27@global_int = dso_local local_unnamed_addr global i32 0, align 48 9define dso_local zeroext i32 @testI8(i8 zeroext %val) local_unnamed_addr #0 {10; PWR7-LABEL: testI8:11; PWR7: # %bb.0: # %entry12; PWR7-NEXT: addis 4, 2, value8@toc@ha13; PWR7-NEXT: sync14; PWR7-NEXT: addi 5, 4, value8@toc@l15; PWR7-NEXT: rlwinm 4, 5, 3, 27, 2816; PWR7-NEXT: rldicr 5, 5, 0, 6117; PWR7-NEXT: xori 4, 4, 2418; PWR7-NEXT: slw 6, 3, 419; PWR7-NEXT: li 3, 25520; PWR7-NEXT: slw 3, 3, 421; PWR7-NEXT: and 6, 6, 322; PWR7-NEXT: .LBB0_1: # %entry23; PWR7-NEXT: #24; PWR7-NEXT: lwarx 7, 0, 525; PWR7-NEXT: andc 8, 7, 326; PWR7-NEXT: or 8, 6, 827; PWR7-NEXT: stwcx. 8, 0, 528; PWR7-NEXT: bne- 0, .LBB0_129; PWR7-NEXT: # %bb.2: # %entry30; PWR7-NEXT: srw 3, 7, 431; PWR7-NEXT: addis 4, 2, global_int@toc@ha32; PWR7-NEXT: lwsync33; PWR7-NEXT: clrlwi 3, 3, 2434; PWR7-NEXT: stw 3, global_int@toc@l(4)35; PWR7-NEXT: li 3, 5536; PWR7-NEXT: blr37;38; PWR9-LABEL: testI8:39; PWR9: # %bb.0: # %entry40; PWR9-NEXT: addis 4, 2, value8@toc@ha41; PWR9-NEXT: sync42; PWR9-NEXT: addi 5, 4, value8@toc@l43; PWR9-NEXT: .LBB0_1: # %entry44; PWR9-NEXT: #45; PWR9-NEXT: lbarx 4, 0, 546; PWR9-NEXT: stbcx. 3, 0, 547; PWR9-NEXT: bne- 0, .LBB0_148; PWR9-NEXT: # %bb.2: # %entry49; PWR9-NEXT: addis 3, 2, global_int@toc@ha50; PWR9-NEXT: lwsync51; PWR9-NEXT: stw 4, global_int@toc@l(3)52; PWR9-NEXT: li 3, 5553; PWR9-NEXT: blr54entry:55 %0 = atomicrmw xchg ptr @value8, i8 %val seq_cst, align 156 %conv = zext i8 %0 to i3257 store i32 %conv, ptr @global_int, align 458 ret i32 5559}60 61define dso_local zeroext i32 @testI16(i16 zeroext %val) local_unnamed_addr #0 {62; PWR7-LABEL: testI16:63; PWR7: # %bb.0: # %entry64; PWR7-NEXT: addis 4, 2, value16@toc@ha65; PWR7-NEXT: sync66; PWR7-NEXT: addi 5, 4, value16@toc@l67; PWR7-NEXT: rlwinm 4, 5, 3, 27, 2768; PWR7-NEXT: rldicr 5, 5, 0, 6169; PWR7-NEXT: xori 4, 4, 1670; PWR7-NEXT: slw 6, 3, 471; PWR7-NEXT: li 3, 072; PWR7-NEXT: ori 3, 3, 6553573; PWR7-NEXT: slw 3, 3, 474; PWR7-NEXT: and 6, 6, 375; PWR7-NEXT: .LBB1_1: # %entry76; PWR7-NEXT: #77; PWR7-NEXT: lwarx 7, 0, 578; PWR7-NEXT: andc 8, 7, 379; PWR7-NEXT: or 8, 6, 880; PWR7-NEXT: stwcx. 8, 0, 581; PWR7-NEXT: bne- 0, .LBB1_182; PWR7-NEXT: # %bb.2: # %entry83; PWR7-NEXT: srw 3, 7, 484; PWR7-NEXT: addis 4, 2, global_int@toc@ha85; PWR7-NEXT: lwsync86; PWR7-NEXT: clrlwi 3, 3, 1687; PWR7-NEXT: stw 3, global_int@toc@l(4)88; PWR7-NEXT: li 3, 5589; PWR7-NEXT: blr90;91; PWR9-LABEL: testI16:92; PWR9: # %bb.0: # %entry93; PWR9-NEXT: addis 4, 2, value16@toc@ha94; PWR9-NEXT: sync95; PWR9-NEXT: addi 5, 4, value16@toc@l96; PWR9-NEXT: .LBB1_1: # %entry97; PWR9-NEXT: #98; PWR9-NEXT: lharx 4, 0, 599; PWR9-NEXT: sthcx. 3, 0, 5100; PWR9-NEXT: bne- 0, .LBB1_1101; PWR9-NEXT: # %bb.2: # %entry102; PWR9-NEXT: addis 3, 2, global_int@toc@ha103; PWR9-NEXT: lwsync104; PWR9-NEXT: stw 4, global_int@toc@l(3)105; PWR9-NEXT: li 3, 55106; PWR9-NEXT: blr107entry:108 %0 = atomicrmw xchg ptr @value16, i16 %val seq_cst, align 2109 %conv = zext i16 %0 to i32110 store i32 %conv, ptr @global_int, align 4111 ret i32 55112}113 114attributes #0 = { nounwind }115