brintos

brintos / llvm-project-archived public Read only

0
0
Text · 55.8 KiB · 0d23176 Raw
1738 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-unknown -mcpu=pwr8 \3; RUN:   -ppc-asm-full-reg-names \4; RUN:   -enable-subreg-liveness < %s | FileCheck %s5; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-unknown -mcpu=pwr7 \6; RUN:   -ppc-asm-full-reg-names \7; RUN:   -enable-subreg-liveness < %s | FileCheck --check-prefix=PWR7 %s8; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu -mcpu=pwr8 \9; RUN:   -ppc-asm-full-reg-names -enable-subreg-liveness < %s | FileCheck \10; RUN:   --check-prefix=LE-PWR8 %s11; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-freebsd -mcpu=pwr8 \12; RUN:   -ppc-asm-full-reg-names -enable-subreg-liveness < %s | FileCheck \13; RUN:   --check-prefix=LE-PWR8 %s14; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-aix -mcpu=pwr8 \15; RUN:   -ppc-asm-full-reg-names -enable-subreg-liveness < %s | FileCheck \16; RUN:   --check-prefix=AIX64-PWR8 %s17 18; On 32-bit PPC platform, 16-byte lock free atomic instructions are not available,19; it's expected not to generate inlined lock-free code on such platforms, even arch level20; is pwr8+ and `-ppc-quadword-atomics` is on.21; RUN: llc -verify-machineinstrs -mtriple=powerpc-unknown-unknown -mcpu=pwr8 \22; RUN:   -ppc-asm-full-reg-names -enable-subreg-liveness < %s \23; RUN: | FileCheck --check-prefix=PPC-PWR8 %s24 25 26define i128 @swap(ptr %a, i128 %x) {27; CHECK-LABEL: swap:28; CHECK:       # %bb.0: # %entry29; CHECK-NEXT:    sync30; CHECK-NEXT:  .LBB0_1: # %entry31; CHECK-NEXT:    #32; CHECK-NEXT:    lqarx r6, 0, r333; CHECK-NEXT:    mr r9, r534; CHECK-NEXT:    mr r8, r435; CHECK-NEXT:    stqcx. r8, 0, r336; CHECK-NEXT:    bne cr0, .LBB0_137; CHECK-NEXT:  # %bb.2: # %entry38; CHECK-NEXT:    lwsync39; CHECK-NEXT:    mr r3, r640; CHECK-NEXT:    mr r4, r741; CHECK-NEXT:    blr42;43; PWR7-LABEL: swap:44; PWR7:       # %bb.0: # %entry45; PWR7-NEXT:    mflr r046; PWR7-NEXT:    stdu r1, -112(r1)47; PWR7-NEXT:    std r0, 128(r1)48; PWR7-NEXT:    .cfi_def_cfa_offset 11249; PWR7-NEXT:    .cfi_offset lr, 1650; PWR7-NEXT:    li r6, 551; PWR7-NEXT:    bl __atomic_exchange_1652; PWR7-NEXT:    nop53; PWR7-NEXT:    addi r1, r1, 11254; PWR7-NEXT:    ld r0, 16(r1)55; PWR7-NEXT:    mtlr r056; PWR7-NEXT:    blr57;58; LE-PWR8-LABEL: swap:59; LE-PWR8:       # %bb.0: # %entry60; LE-PWR8-NEXT:    sync61; LE-PWR8-NEXT:  .LBB0_1: # %entry62; LE-PWR8-NEXT:    #63; LE-PWR8-NEXT:    lqarx r6, 0, r364; LE-PWR8-NEXT:    mr r9, r465; LE-PWR8-NEXT:    mr r8, r566; LE-PWR8-NEXT:    stqcx. r8, 0, r367; LE-PWR8-NEXT:    bne cr0, .LBB0_168; LE-PWR8-NEXT:  # %bb.2: # %entry69; LE-PWR8-NEXT:    lwsync70; LE-PWR8-NEXT:    mr r3, r771; LE-PWR8-NEXT:    mr r4, r672; LE-PWR8-NEXT:    blr73;74; AIX64-PWR8-LABEL: swap:75; AIX64-PWR8:       # %bb.0: # %entry76; AIX64-PWR8-NEXT:    sync77; AIX64-PWR8-NEXT:  L..BB0_1: # %entry78; AIX64-PWR8-NEXT:    #79; AIX64-PWR8-NEXT:    lqarx r6, 0, r380; AIX64-PWR8-NEXT:    mr r9, r581; AIX64-PWR8-NEXT:    mr r8, r482; AIX64-PWR8-NEXT:    stqcx. r8, 0, r383; AIX64-PWR8-NEXT:    bne cr0, L..BB0_184; AIX64-PWR8-NEXT:  # %bb.2: # %entry85; AIX64-PWR8-NEXT:    lwsync86; AIX64-PWR8-NEXT:    mr r3, r687; AIX64-PWR8-NEXT:    mr r4, r788; AIX64-PWR8-NEXT:    blr89;90; PPC-PWR8-LABEL: swap:91; PPC-PWR8:       # %bb.0: # %entry92; PPC-PWR8-NEXT:    mflr r093; PPC-PWR8-NEXT:    stwu r1, -48(r1)94; PPC-PWR8-NEXT:    stw r0, 52(r1)95; PPC-PWR8-NEXT:    .cfi_def_cfa_offset 4896; PPC-PWR8-NEXT:    .cfi_offset lr, 497; PPC-PWR8-NEXT:    mr r4, r398; PPC-PWR8-NEXT:    stw r7, 40(r1)99; PPC-PWR8-NEXT:    stw r6, 36(r1)100; PPC-PWR8-NEXT:    addi r6, r1, 16101; PPC-PWR8-NEXT:    stw r5, 32(r1)102; PPC-PWR8-NEXT:    addi r5, r1, 32103; PPC-PWR8-NEXT:    li r3, 16104; PPC-PWR8-NEXT:    li r7, 5105; PPC-PWR8-NEXT:    stw r8, 44(r1)106; PPC-PWR8-NEXT:    bl __atomic_exchange107; PPC-PWR8-NEXT:    lwz r6, 28(r1)108; PPC-PWR8-NEXT:    lwz r5, 24(r1)109; PPC-PWR8-NEXT:    lwz r4, 20(r1)110; PPC-PWR8-NEXT:    lwz r3, 16(r1)111; PPC-PWR8-NEXT:    lwz r0, 52(r1)112; PPC-PWR8-NEXT:    addi r1, r1, 48113; PPC-PWR8-NEXT:    mtlr r0114; PPC-PWR8-NEXT:    blr115entry:116  %0 = atomicrmw xchg ptr %a, i128 %x seq_cst, align 16117  ret i128 %0118}119 120define i128 @add(ptr %a, i128 %x) {121; CHECK-LABEL: add:122; CHECK:       # %bb.0: # %entry123; CHECK-NEXT:    sync124; CHECK-NEXT:  .LBB1_1: # %entry125; CHECK-NEXT:    #126; CHECK-NEXT:    lqarx r6, 0, r3127; CHECK-NEXT:    addc r9, r5, r7128; CHECK-NEXT:    adde r8, r4, r6129; CHECK-NEXT:    stqcx. r8, 0, r3130; CHECK-NEXT:    bne cr0, .LBB1_1131; CHECK-NEXT:  # %bb.2: # %entry132; CHECK-NEXT:    lwsync133; CHECK-NEXT:    mr r3, r6134; CHECK-NEXT:    mr r4, r7135; CHECK-NEXT:    blr136;137; PWR7-LABEL: add:138; PWR7:       # %bb.0: # %entry139; PWR7-NEXT:    mflr r0140; PWR7-NEXT:    stdu r1, -112(r1)141; PWR7-NEXT:    std r0, 128(r1)142; PWR7-NEXT:    .cfi_def_cfa_offset 112143; PWR7-NEXT:    .cfi_offset lr, 16144; PWR7-NEXT:    li r6, 5145; PWR7-NEXT:    bl __atomic_fetch_add_16146; PWR7-NEXT:    nop147; PWR7-NEXT:    addi r1, r1, 112148; PWR7-NEXT:    ld r0, 16(r1)149; PWR7-NEXT:    mtlr r0150; PWR7-NEXT:    blr151;152; LE-PWR8-LABEL: add:153; LE-PWR8:       # %bb.0: # %entry154; LE-PWR8-NEXT:    sync155; LE-PWR8-NEXT:  .LBB1_1: # %entry156; LE-PWR8-NEXT:    #157; LE-PWR8-NEXT:    lqarx r6, 0, r3158; LE-PWR8-NEXT:    addc r9, r4, r7159; LE-PWR8-NEXT:    adde r8, r5, r6160; LE-PWR8-NEXT:    stqcx. r8, 0, r3161; LE-PWR8-NEXT:    bne cr0, .LBB1_1162; LE-PWR8-NEXT:  # %bb.2: # %entry163; LE-PWR8-NEXT:    lwsync164; LE-PWR8-NEXT:    mr r3, r7165; LE-PWR8-NEXT:    mr r4, r6166; LE-PWR8-NEXT:    blr167;168; AIX64-PWR8-LABEL: add:169; AIX64-PWR8:       # %bb.0: # %entry170; AIX64-PWR8-NEXT:    sync171; AIX64-PWR8-NEXT:  L..BB1_1: # %entry172; AIX64-PWR8-NEXT:    #173; AIX64-PWR8-NEXT:    lqarx r6, 0, r3174; AIX64-PWR8-NEXT:    addc r9, r5, r7175; AIX64-PWR8-NEXT:    adde r8, r4, r6176; AIX64-PWR8-NEXT:    stqcx. r8, 0, r3177; AIX64-PWR8-NEXT:    bne cr0, L..BB1_1178; AIX64-PWR8-NEXT:  # %bb.2: # %entry179; AIX64-PWR8-NEXT:    lwsync180; AIX64-PWR8-NEXT:    mr r3, r6181; AIX64-PWR8-NEXT:    mr r4, r7182; AIX64-PWR8-NEXT:    blr183;184; PPC-PWR8-LABEL: add:185; PPC-PWR8:       # %bb.0: # %entry186; PPC-PWR8-NEXT:    mflr r0187; PPC-PWR8-NEXT:    stwu r1, -80(r1)188; PPC-PWR8-NEXT:    stw r0, 84(r1)189; PPC-PWR8-NEXT:    .cfi_def_cfa_offset 80190; PPC-PWR8-NEXT:    .cfi_offset lr, 4191; PPC-PWR8-NEXT:    .cfi_offset r24, -32192; PPC-PWR8-NEXT:    .cfi_offset r25, -28193; PPC-PWR8-NEXT:    .cfi_offset r26, -24194; PPC-PWR8-NEXT:    .cfi_offset r27, -20195; PPC-PWR8-NEXT:    .cfi_offset r28, -16196; PPC-PWR8-NEXT:    .cfi_offset r29, -12197; PPC-PWR8-NEXT:    .cfi_offset r30, -8198; PPC-PWR8-NEXT:    stw r26, 56(r1) # 4-byte Folded Spill199; PPC-PWR8-NEXT:    stw r27, 60(r1) # 4-byte Folded Spill200; PPC-PWR8-NEXT:    mr r27, r5201; PPC-PWR8-NEXT:    mr r26, r3202; PPC-PWR8-NEXT:    stw r28, 64(r1) # 4-byte Folded Spill203; PPC-PWR8-NEXT:    mr r28, r6204; PPC-PWR8-NEXT:    lwz r6, 12(r3)205; PPC-PWR8-NEXT:    stw r24, 48(r1) # 4-byte Folded Spill206; PPC-PWR8-NEXT:    lwz r5, 8(r3)207; PPC-PWR8-NEXT:    lwz r4, 4(r3)208; PPC-PWR8-NEXT:    stw r25, 52(r1) # 4-byte Folded Spill209; PPC-PWR8-NEXT:    addi r25, r1, 32210; PPC-PWR8-NEXT:    lwz r3, 0(r3)211; PPC-PWR8-NEXT:    stw r29, 68(r1) # 4-byte Folded Spill212; PPC-PWR8-NEXT:    mr r29, r7213; PPC-PWR8-NEXT:    addi r24, r1, 16214; PPC-PWR8-NEXT:    stw r30, 72(r1) # 4-byte Folded Spill215; PPC-PWR8-NEXT:    mr r30, r8216; PPC-PWR8-NEXT:    .p2align 4217; PPC-PWR8-NEXT:  .LBB1_1: # %atomicrmw.start218; PPC-PWR8-NEXT:    #219; PPC-PWR8-NEXT:    addc r7, r6, r30220; PPC-PWR8-NEXT:    stw r4, 36(r1)221; PPC-PWR8-NEXT:    stw r3, 32(r1)222; PPC-PWR8-NEXT:    adde r8, r5, r29223; PPC-PWR8-NEXT:    stw r5, 40(r1)224; PPC-PWR8-NEXT:    stw r6, 44(r1)225; PPC-PWR8-NEXT:    mr r5, r25226; PPC-PWR8-NEXT:    mr r6, r24227; PPC-PWR8-NEXT:    adde r4, r4, r28228; PPC-PWR8-NEXT:    stw r7, 28(r1)229; PPC-PWR8-NEXT:    li r7, 5230; PPC-PWR8-NEXT:    adde r3, r3, r27231; PPC-PWR8-NEXT:    stw r8, 24(r1)232; PPC-PWR8-NEXT:    li r8, 5233; PPC-PWR8-NEXT:    stw r4, 20(r1)234; PPC-PWR8-NEXT:    mr r4, r26235; PPC-PWR8-NEXT:    stw r3, 16(r1)236; PPC-PWR8-NEXT:    li r3, 16237; PPC-PWR8-NEXT:    bl __atomic_compare_exchange238; PPC-PWR8-NEXT:    mr r7, r3239; PPC-PWR8-NEXT:    lwz r6, 44(r1)240; PPC-PWR8-NEXT:    lwz r5, 40(r1)241; PPC-PWR8-NEXT:    lwz r4, 36(r1)242; PPC-PWR8-NEXT:    lwz r3, 32(r1)243; PPC-PWR8-NEXT:    cmplwi r7, 0244; PPC-PWR8-NEXT:    beq cr0, .LBB1_1245; PPC-PWR8-NEXT:  # %bb.2: # %atomicrmw.end246; PPC-PWR8-NEXT:    lwz r30, 72(r1) # 4-byte Folded Reload247; PPC-PWR8-NEXT:    lwz r29, 68(r1) # 4-byte Folded Reload248; PPC-PWR8-NEXT:    lwz r28, 64(r1) # 4-byte Folded Reload249; PPC-PWR8-NEXT:    lwz r27, 60(r1) # 4-byte Folded Reload250; PPC-PWR8-NEXT:    lwz r26, 56(r1) # 4-byte Folded Reload251; PPC-PWR8-NEXT:    lwz r25, 52(r1) # 4-byte Folded Reload252; PPC-PWR8-NEXT:    lwz r24, 48(r1) # 4-byte Folded Reload253; PPC-PWR8-NEXT:    lwz r0, 84(r1)254; PPC-PWR8-NEXT:    addi r1, r1, 80255; PPC-PWR8-NEXT:    mtlr r0256; PPC-PWR8-NEXT:    blr257entry:258  %0 = atomicrmw add ptr %a, i128 %x seq_cst, align 16259  ret i128 %0260}261 262define i128 @sub(ptr %a, i128 %x) {263; CHECK-LABEL: sub:264; CHECK:       # %bb.0: # %entry265; CHECK-NEXT:    sync266; CHECK-NEXT:  .LBB2_1: # %entry267; CHECK-NEXT:    #268; CHECK-NEXT:    lqarx r6, 0, r3269; CHECK-NEXT:    subc r9, r7, r5270; CHECK-NEXT:    subfe r8, r4, r6271; CHECK-NEXT:    stqcx. r8, 0, r3272; CHECK-NEXT:    bne cr0, .LBB2_1273; CHECK-NEXT:  # %bb.2: # %entry274; CHECK-NEXT:    lwsync275; CHECK-NEXT:    mr r3, r6276; CHECK-NEXT:    mr r4, r7277; CHECK-NEXT:    blr278;279; PWR7-LABEL: sub:280; PWR7:       # %bb.0: # %entry281; PWR7-NEXT:    mflr r0282; PWR7-NEXT:    stdu r1, -112(r1)283; PWR7-NEXT:    std r0, 128(r1)284; PWR7-NEXT:    .cfi_def_cfa_offset 112285; PWR7-NEXT:    .cfi_offset lr, 16286; PWR7-NEXT:    li r6, 5287; PWR7-NEXT:    bl __atomic_fetch_sub_16288; PWR7-NEXT:    nop289; PWR7-NEXT:    addi r1, r1, 112290; PWR7-NEXT:    ld r0, 16(r1)291; PWR7-NEXT:    mtlr r0292; PWR7-NEXT:    blr293;294; LE-PWR8-LABEL: sub:295; LE-PWR8:       # %bb.0: # %entry296; LE-PWR8-NEXT:    sync297; LE-PWR8-NEXT:  .LBB2_1: # %entry298; LE-PWR8-NEXT:    #299; LE-PWR8-NEXT:    lqarx r6, 0, r3300; LE-PWR8-NEXT:    subc r9, r7, r4301; LE-PWR8-NEXT:    subfe r8, r5, r6302; LE-PWR8-NEXT:    stqcx. r8, 0, r3303; LE-PWR8-NEXT:    bne cr0, .LBB2_1304; LE-PWR8-NEXT:  # %bb.2: # %entry305; LE-PWR8-NEXT:    lwsync306; LE-PWR8-NEXT:    mr r3, r7307; LE-PWR8-NEXT:    mr r4, r6308; LE-PWR8-NEXT:    blr309;310; AIX64-PWR8-LABEL: sub:311; AIX64-PWR8:       # %bb.0: # %entry312; AIX64-PWR8-NEXT:    sync313; AIX64-PWR8-NEXT:  L..BB2_1: # %entry314; AIX64-PWR8-NEXT:    #315; AIX64-PWR8-NEXT:    lqarx r6, 0, r3316; AIX64-PWR8-NEXT:    subc r9, r7, r5317; AIX64-PWR8-NEXT:    subfe r8, r4, r6318; AIX64-PWR8-NEXT:    stqcx. r8, 0, r3319; AIX64-PWR8-NEXT:    bne cr0, L..BB2_1320; AIX64-PWR8-NEXT:  # %bb.2: # %entry321; AIX64-PWR8-NEXT:    lwsync322; AIX64-PWR8-NEXT:    mr r3, r6323; AIX64-PWR8-NEXT:    mr r4, r7324; AIX64-PWR8-NEXT:    blr325;326; PPC-PWR8-LABEL: sub:327; PPC-PWR8:       # %bb.0: # %entry328; PPC-PWR8-NEXT:    mflr r0329; PPC-PWR8-NEXT:    stwu r1, -80(r1)330; PPC-PWR8-NEXT:    stw r0, 84(r1)331; PPC-PWR8-NEXT:    .cfi_def_cfa_offset 80332; PPC-PWR8-NEXT:    .cfi_offset lr, 4333; PPC-PWR8-NEXT:    .cfi_offset r24, -32334; PPC-PWR8-NEXT:    .cfi_offset r25, -28335; PPC-PWR8-NEXT:    .cfi_offset r26, -24336; PPC-PWR8-NEXT:    .cfi_offset r27, -20337; PPC-PWR8-NEXT:    .cfi_offset r28, -16338; PPC-PWR8-NEXT:    .cfi_offset r29, -12339; PPC-PWR8-NEXT:    .cfi_offset r30, -8340; PPC-PWR8-NEXT:    stw r26, 56(r1) # 4-byte Folded Spill341; PPC-PWR8-NEXT:    stw r27, 60(r1) # 4-byte Folded Spill342; PPC-PWR8-NEXT:    mr r27, r5343; PPC-PWR8-NEXT:    mr r26, r3344; PPC-PWR8-NEXT:    stw r28, 64(r1) # 4-byte Folded Spill345; PPC-PWR8-NEXT:    mr r28, r6346; PPC-PWR8-NEXT:    lwz r6, 12(r3)347; PPC-PWR8-NEXT:    stw r24, 48(r1) # 4-byte Folded Spill348; PPC-PWR8-NEXT:    lwz r5, 8(r3)349; PPC-PWR8-NEXT:    lwz r4, 4(r3)350; PPC-PWR8-NEXT:    stw r25, 52(r1) # 4-byte Folded Spill351; PPC-PWR8-NEXT:    addi r25, r1, 32352; PPC-PWR8-NEXT:    lwz r3, 0(r3)353; PPC-PWR8-NEXT:    stw r29, 68(r1) # 4-byte Folded Spill354; PPC-PWR8-NEXT:    mr r29, r7355; PPC-PWR8-NEXT:    addi r24, r1, 16356; PPC-PWR8-NEXT:    stw r30, 72(r1) # 4-byte Folded Spill357; PPC-PWR8-NEXT:    mr r30, r8358; PPC-PWR8-NEXT:    .p2align 4359; PPC-PWR8-NEXT:  .LBB2_1: # %atomicrmw.start360; PPC-PWR8-NEXT:    #361; PPC-PWR8-NEXT:    subc r7, r6, r30362; PPC-PWR8-NEXT:    stw r4, 36(r1)363; PPC-PWR8-NEXT:    stw r3, 32(r1)364; PPC-PWR8-NEXT:    subfe r8, r29, r5365; PPC-PWR8-NEXT:    stw r5, 40(r1)366; PPC-PWR8-NEXT:    stw r6, 44(r1)367; PPC-PWR8-NEXT:    mr r5, r25368; PPC-PWR8-NEXT:    mr r6, r24369; PPC-PWR8-NEXT:    subfe r4, r28, r4370; PPC-PWR8-NEXT:    stw r7, 28(r1)371; PPC-PWR8-NEXT:    li r7, 5372; PPC-PWR8-NEXT:    subfe r3, r27, r3373; PPC-PWR8-NEXT:    stw r8, 24(r1)374; PPC-PWR8-NEXT:    li r8, 5375; PPC-PWR8-NEXT:    stw r4, 20(r1)376; PPC-PWR8-NEXT:    mr r4, r26377; PPC-PWR8-NEXT:    stw r3, 16(r1)378; PPC-PWR8-NEXT:    li r3, 16379; PPC-PWR8-NEXT:    bl __atomic_compare_exchange380; PPC-PWR8-NEXT:    mr r7, r3381; PPC-PWR8-NEXT:    lwz r6, 44(r1)382; PPC-PWR8-NEXT:    lwz r5, 40(r1)383; PPC-PWR8-NEXT:    lwz r4, 36(r1)384; PPC-PWR8-NEXT:    lwz r3, 32(r1)385; PPC-PWR8-NEXT:    cmplwi r7, 0386; PPC-PWR8-NEXT:    beq cr0, .LBB2_1387; PPC-PWR8-NEXT:  # %bb.2: # %atomicrmw.end388; PPC-PWR8-NEXT:    lwz r30, 72(r1) # 4-byte Folded Reload389; PPC-PWR8-NEXT:    lwz r29, 68(r1) # 4-byte Folded Reload390; PPC-PWR8-NEXT:    lwz r28, 64(r1) # 4-byte Folded Reload391; PPC-PWR8-NEXT:    lwz r27, 60(r1) # 4-byte Folded Reload392; PPC-PWR8-NEXT:    lwz r26, 56(r1) # 4-byte Folded Reload393; PPC-PWR8-NEXT:    lwz r25, 52(r1) # 4-byte Folded Reload394; PPC-PWR8-NEXT:    lwz r24, 48(r1) # 4-byte Folded Reload395; PPC-PWR8-NEXT:    lwz r0, 84(r1)396; PPC-PWR8-NEXT:    addi r1, r1, 80397; PPC-PWR8-NEXT:    mtlr r0398; PPC-PWR8-NEXT:    blr399entry:400  %0 = atomicrmw sub ptr %a, i128 %x seq_cst, align 16401  ret i128 %0402}403 404define i128 @and(ptr %a, i128 %x) {405; CHECK-LABEL: and:406; CHECK:       # %bb.0: # %entry407; CHECK-NEXT:    sync408; CHECK-NEXT:  .LBB3_1: # %entry409; CHECK-NEXT:    #410; CHECK-NEXT:    lqarx r6, 0, r3411; CHECK-NEXT:    and r9, r5, r7412; CHECK-NEXT:    and r8, r4, r6413; CHECK-NEXT:    stqcx. r8, 0, r3414; CHECK-NEXT:    bne cr0, .LBB3_1415; CHECK-NEXT:  # %bb.2: # %entry416; CHECK-NEXT:    lwsync417; CHECK-NEXT:    mr r3, r6418; CHECK-NEXT:    mr r4, r7419; CHECK-NEXT:    blr420;421; PWR7-LABEL: and:422; PWR7:       # %bb.0: # %entry423; PWR7-NEXT:    mflr r0424; PWR7-NEXT:    stdu r1, -112(r1)425; PWR7-NEXT:    std r0, 128(r1)426; PWR7-NEXT:    .cfi_def_cfa_offset 112427; PWR7-NEXT:    .cfi_offset lr, 16428; PWR7-NEXT:    li r6, 5429; PWR7-NEXT:    bl __atomic_fetch_and_16430; PWR7-NEXT:    nop431; PWR7-NEXT:    addi r1, r1, 112432; PWR7-NEXT:    ld r0, 16(r1)433; PWR7-NEXT:    mtlr r0434; PWR7-NEXT:    blr435;436; LE-PWR8-LABEL: and:437; LE-PWR8:       # %bb.0: # %entry438; LE-PWR8-NEXT:    sync439; LE-PWR8-NEXT:  .LBB3_1: # %entry440; LE-PWR8-NEXT:    #441; LE-PWR8-NEXT:    lqarx r6, 0, r3442; LE-PWR8-NEXT:    and r9, r4, r7443; LE-PWR8-NEXT:    and r8, r5, r6444; LE-PWR8-NEXT:    stqcx. r8, 0, r3445; LE-PWR8-NEXT:    bne cr0, .LBB3_1446; LE-PWR8-NEXT:  # %bb.2: # %entry447; LE-PWR8-NEXT:    lwsync448; LE-PWR8-NEXT:    mr r3, r7449; LE-PWR8-NEXT:    mr r4, r6450; LE-PWR8-NEXT:    blr451;452; AIX64-PWR8-LABEL: and:453; AIX64-PWR8:       # %bb.0: # %entry454; AIX64-PWR8-NEXT:    sync455; AIX64-PWR8-NEXT:  L..BB3_1: # %entry456; AIX64-PWR8-NEXT:    #457; AIX64-PWR8-NEXT:    lqarx r6, 0, r3458; AIX64-PWR8-NEXT:    and r9, r5, r7459; AIX64-PWR8-NEXT:    and r8, r4, r6460; AIX64-PWR8-NEXT:    stqcx. r8, 0, r3461; AIX64-PWR8-NEXT:    bne cr0, L..BB3_1462; AIX64-PWR8-NEXT:  # %bb.2: # %entry463; AIX64-PWR8-NEXT:    lwsync464; AIX64-PWR8-NEXT:    mr r3, r6465; AIX64-PWR8-NEXT:    mr r4, r7466; AIX64-PWR8-NEXT:    blr467;468; PPC-PWR8-LABEL: and:469; PPC-PWR8:       # %bb.0: # %entry470; PPC-PWR8-NEXT:    mflr r0471; PPC-PWR8-NEXT:    stwu r1, -80(r1)472; PPC-PWR8-NEXT:    stw r0, 84(r1)473; PPC-PWR8-NEXT:    .cfi_def_cfa_offset 80474; PPC-PWR8-NEXT:    .cfi_offset lr, 4475; PPC-PWR8-NEXT:    .cfi_offset r24, -32476; PPC-PWR8-NEXT:    .cfi_offset r25, -28477; PPC-PWR8-NEXT:    .cfi_offset r26, -24478; PPC-PWR8-NEXT:    .cfi_offset r27, -20479; PPC-PWR8-NEXT:    .cfi_offset r28, -16480; PPC-PWR8-NEXT:    .cfi_offset r29, -12481; PPC-PWR8-NEXT:    .cfi_offset r30, -8482; PPC-PWR8-NEXT:    stw r26, 56(r1) # 4-byte Folded Spill483; PPC-PWR8-NEXT:    stw r27, 60(r1) # 4-byte Folded Spill484; PPC-PWR8-NEXT:    mr r27, r5485; PPC-PWR8-NEXT:    mr r26, r3486; PPC-PWR8-NEXT:    stw r28, 64(r1) # 4-byte Folded Spill487; PPC-PWR8-NEXT:    mr r28, r6488; PPC-PWR8-NEXT:    lwz r6, 12(r3)489; PPC-PWR8-NEXT:    stw r24, 48(r1) # 4-byte Folded Spill490; PPC-PWR8-NEXT:    lwz r5, 8(r3)491; PPC-PWR8-NEXT:    lwz r4, 4(r3)492; PPC-PWR8-NEXT:    stw r25, 52(r1) # 4-byte Folded Spill493; PPC-PWR8-NEXT:    addi r25, r1, 32494; PPC-PWR8-NEXT:    lwz r3, 0(r3)495; PPC-PWR8-NEXT:    stw r29, 68(r1) # 4-byte Folded Spill496; PPC-PWR8-NEXT:    mr r29, r7497; PPC-PWR8-NEXT:    addi r24, r1, 16498; PPC-PWR8-NEXT:    stw r30, 72(r1) # 4-byte Folded Spill499; PPC-PWR8-NEXT:    mr r30, r8500; PPC-PWR8-NEXT:    .p2align 4501; PPC-PWR8-NEXT:  .LBB3_1: # %atomicrmw.start502; PPC-PWR8-NEXT:    #503; PPC-PWR8-NEXT:    stw r3, 32(r1)504; PPC-PWR8-NEXT:    and r3, r3, r27505; PPC-PWR8-NEXT:    stw r4, 36(r1)506; PPC-PWR8-NEXT:    and r4, r4, r28507; PPC-PWR8-NEXT:    and r7, r5, r29508; PPC-PWR8-NEXT:    stw r5, 40(r1)509; PPC-PWR8-NEXT:    and r5, r6, r30510; PPC-PWR8-NEXT:    stw r6, 44(r1)511; PPC-PWR8-NEXT:    stw r5, 28(r1)512; PPC-PWR8-NEXT:    stw r7, 24(r1)513; PPC-PWR8-NEXT:    mr r5, r25514; PPC-PWR8-NEXT:    li r7, 5515; PPC-PWR8-NEXT:    stw r4, 20(r1)516; PPC-PWR8-NEXT:    stw r3, 16(r1)517; PPC-PWR8-NEXT:    li r3, 16518; PPC-PWR8-NEXT:    mr r4, r26519; PPC-PWR8-NEXT:    mr r6, r24520; PPC-PWR8-NEXT:    li r8, 5521; PPC-PWR8-NEXT:    bl __atomic_compare_exchange522; PPC-PWR8-NEXT:    mr r7, r3523; PPC-PWR8-NEXT:    lwz r6, 44(r1)524; PPC-PWR8-NEXT:    lwz r5, 40(r1)525; PPC-PWR8-NEXT:    lwz r4, 36(r1)526; PPC-PWR8-NEXT:    lwz r3, 32(r1)527; PPC-PWR8-NEXT:    cmplwi r7, 0528; PPC-PWR8-NEXT:    beq cr0, .LBB3_1529; PPC-PWR8-NEXT:  # %bb.2: # %atomicrmw.end530; PPC-PWR8-NEXT:    lwz r30, 72(r1) # 4-byte Folded Reload531; PPC-PWR8-NEXT:    lwz r29, 68(r1) # 4-byte Folded Reload532; PPC-PWR8-NEXT:    lwz r28, 64(r1) # 4-byte Folded Reload533; PPC-PWR8-NEXT:    lwz r27, 60(r1) # 4-byte Folded Reload534; PPC-PWR8-NEXT:    lwz r26, 56(r1) # 4-byte Folded Reload535; PPC-PWR8-NEXT:    lwz r25, 52(r1) # 4-byte Folded Reload536; PPC-PWR8-NEXT:    lwz r24, 48(r1) # 4-byte Folded Reload537; PPC-PWR8-NEXT:    lwz r0, 84(r1)538; PPC-PWR8-NEXT:    addi r1, r1, 80539; PPC-PWR8-NEXT:    mtlr r0540; PPC-PWR8-NEXT:    blr541entry:542  %0 = atomicrmw and ptr %a, i128 %x seq_cst, align 16543  ret i128 %0544}545 546define i128 @or(ptr %a, i128 %x) {547; CHECK-LABEL: or:548; CHECK:       # %bb.0: # %entry549; CHECK-NEXT:    sync550; CHECK-NEXT:  .LBB4_1: # %entry551; CHECK-NEXT:    #552; CHECK-NEXT:    lqarx r6, 0, r3553; CHECK-NEXT:    or r9, r5, r7554; CHECK-NEXT:    or r8, r4, r6555; CHECK-NEXT:    stqcx. r8, 0, r3556; CHECK-NEXT:    bne cr0, .LBB4_1557; CHECK-NEXT:  # %bb.2: # %entry558; CHECK-NEXT:    lwsync559; CHECK-NEXT:    mr r3, r6560; CHECK-NEXT:    mr r4, r7561; CHECK-NEXT:    blr562;563; PWR7-LABEL: or:564; PWR7:       # %bb.0: # %entry565; PWR7-NEXT:    mflr r0566; PWR7-NEXT:    stdu r1, -112(r1)567; PWR7-NEXT:    std r0, 128(r1)568; PWR7-NEXT:    .cfi_def_cfa_offset 112569; PWR7-NEXT:    .cfi_offset lr, 16570; PWR7-NEXT:    li r6, 5571; PWR7-NEXT:    bl __atomic_fetch_or_16572; PWR7-NEXT:    nop573; PWR7-NEXT:    addi r1, r1, 112574; PWR7-NEXT:    ld r0, 16(r1)575; PWR7-NEXT:    mtlr r0576; PWR7-NEXT:    blr577;578; LE-PWR8-LABEL: or:579; LE-PWR8:       # %bb.0: # %entry580; LE-PWR8-NEXT:    sync581; LE-PWR8-NEXT:  .LBB4_1: # %entry582; LE-PWR8-NEXT:    #583; LE-PWR8-NEXT:    lqarx r6, 0, r3584; LE-PWR8-NEXT:    or r9, r4, r7585; LE-PWR8-NEXT:    or r8, r5, r6586; LE-PWR8-NEXT:    stqcx. r8, 0, r3587; LE-PWR8-NEXT:    bne cr0, .LBB4_1588; LE-PWR8-NEXT:  # %bb.2: # %entry589; LE-PWR8-NEXT:    lwsync590; LE-PWR8-NEXT:    mr r3, r7591; LE-PWR8-NEXT:    mr r4, r6592; LE-PWR8-NEXT:    blr593;594; AIX64-PWR8-LABEL: or:595; AIX64-PWR8:       # %bb.0: # %entry596; AIX64-PWR8-NEXT:    sync597; AIX64-PWR8-NEXT:  L..BB4_1: # %entry598; AIX64-PWR8-NEXT:    #599; AIX64-PWR8-NEXT:    lqarx r6, 0, r3600; AIX64-PWR8-NEXT:    or r9, r5, r7601; AIX64-PWR8-NEXT:    or r8, r4, r6602; AIX64-PWR8-NEXT:    stqcx. r8, 0, r3603; AIX64-PWR8-NEXT:    bne cr0, L..BB4_1604; AIX64-PWR8-NEXT:  # %bb.2: # %entry605; AIX64-PWR8-NEXT:    lwsync606; AIX64-PWR8-NEXT:    mr r3, r6607; AIX64-PWR8-NEXT:    mr r4, r7608; AIX64-PWR8-NEXT:    blr609;610; PPC-PWR8-LABEL: or:611; PPC-PWR8:       # %bb.0: # %entry612; PPC-PWR8-NEXT:    mflr r0613; PPC-PWR8-NEXT:    stwu r1, -80(r1)614; PPC-PWR8-NEXT:    stw r0, 84(r1)615; PPC-PWR8-NEXT:    .cfi_def_cfa_offset 80616; PPC-PWR8-NEXT:    .cfi_offset lr, 4617; PPC-PWR8-NEXT:    .cfi_offset r24, -32618; PPC-PWR8-NEXT:    .cfi_offset r25, -28619; PPC-PWR8-NEXT:    .cfi_offset r26, -24620; PPC-PWR8-NEXT:    .cfi_offset r27, -20621; PPC-PWR8-NEXT:    .cfi_offset r28, -16622; PPC-PWR8-NEXT:    .cfi_offset r29, -12623; PPC-PWR8-NEXT:    .cfi_offset r30, -8624; PPC-PWR8-NEXT:    stw r26, 56(r1) # 4-byte Folded Spill625; PPC-PWR8-NEXT:    stw r27, 60(r1) # 4-byte Folded Spill626; PPC-PWR8-NEXT:    mr r27, r5627; PPC-PWR8-NEXT:    mr r26, r3628; PPC-PWR8-NEXT:    stw r28, 64(r1) # 4-byte Folded Spill629; PPC-PWR8-NEXT:    mr r28, r6630; PPC-PWR8-NEXT:    lwz r6, 12(r3)631; PPC-PWR8-NEXT:    stw r24, 48(r1) # 4-byte Folded Spill632; PPC-PWR8-NEXT:    lwz r5, 8(r3)633; PPC-PWR8-NEXT:    lwz r4, 4(r3)634; PPC-PWR8-NEXT:    stw r25, 52(r1) # 4-byte Folded Spill635; PPC-PWR8-NEXT:    addi r25, r1, 32636; PPC-PWR8-NEXT:    lwz r3, 0(r3)637; PPC-PWR8-NEXT:    stw r29, 68(r1) # 4-byte Folded Spill638; PPC-PWR8-NEXT:    mr r29, r7639; PPC-PWR8-NEXT:    addi r24, r1, 16640; PPC-PWR8-NEXT:    stw r30, 72(r1) # 4-byte Folded Spill641; PPC-PWR8-NEXT:    mr r30, r8642; PPC-PWR8-NEXT:    .p2align 4643; PPC-PWR8-NEXT:  .LBB4_1: # %atomicrmw.start644; PPC-PWR8-NEXT:    #645; PPC-PWR8-NEXT:    stw r3, 32(r1)646; PPC-PWR8-NEXT:    or r3, r3, r27647; PPC-PWR8-NEXT:    stw r4, 36(r1)648; PPC-PWR8-NEXT:    or r4, r4, r28649; PPC-PWR8-NEXT:    or r7, r5, r29650; PPC-PWR8-NEXT:    stw r5, 40(r1)651; PPC-PWR8-NEXT:    or r5, r6, r30652; PPC-PWR8-NEXT:    stw r6, 44(r1)653; PPC-PWR8-NEXT:    stw r5, 28(r1)654; PPC-PWR8-NEXT:    stw r7, 24(r1)655; PPC-PWR8-NEXT:    mr r5, r25656; PPC-PWR8-NEXT:    li r7, 5657; PPC-PWR8-NEXT:    stw r4, 20(r1)658; PPC-PWR8-NEXT:    stw r3, 16(r1)659; PPC-PWR8-NEXT:    li r3, 16660; PPC-PWR8-NEXT:    mr r4, r26661; PPC-PWR8-NEXT:    mr r6, r24662; PPC-PWR8-NEXT:    li r8, 5663; PPC-PWR8-NEXT:    bl __atomic_compare_exchange664; PPC-PWR8-NEXT:    mr r7, r3665; PPC-PWR8-NEXT:    lwz r6, 44(r1)666; PPC-PWR8-NEXT:    lwz r5, 40(r1)667; PPC-PWR8-NEXT:    lwz r4, 36(r1)668; PPC-PWR8-NEXT:    lwz r3, 32(r1)669; PPC-PWR8-NEXT:    cmplwi r7, 0670; PPC-PWR8-NEXT:    beq cr0, .LBB4_1671; PPC-PWR8-NEXT:  # %bb.2: # %atomicrmw.end672; PPC-PWR8-NEXT:    lwz r30, 72(r1) # 4-byte Folded Reload673; PPC-PWR8-NEXT:    lwz r29, 68(r1) # 4-byte Folded Reload674; PPC-PWR8-NEXT:    lwz r28, 64(r1) # 4-byte Folded Reload675; PPC-PWR8-NEXT:    lwz r27, 60(r1) # 4-byte Folded Reload676; PPC-PWR8-NEXT:    lwz r26, 56(r1) # 4-byte Folded Reload677; PPC-PWR8-NEXT:    lwz r25, 52(r1) # 4-byte Folded Reload678; PPC-PWR8-NEXT:    lwz r24, 48(r1) # 4-byte Folded Reload679; PPC-PWR8-NEXT:    lwz r0, 84(r1)680; PPC-PWR8-NEXT:    addi r1, r1, 80681; PPC-PWR8-NEXT:    mtlr r0682; PPC-PWR8-NEXT:    blr683entry:684  %0 = atomicrmw or ptr %a, i128 %x seq_cst, align 16685  ret i128 %0686}687 688define i128 @xor(ptr %a, i128 %x) {689; CHECK-LABEL: xor:690; CHECK:       # %bb.0: # %entry691; CHECK-NEXT:    sync692; CHECK-NEXT:  .LBB5_1: # %entry693; CHECK-NEXT:    #694; CHECK-NEXT:    lqarx r6, 0, r3695; CHECK-NEXT:    xor r9, r5, r7696; CHECK-NEXT:    xor r8, r4, r6697; CHECK-NEXT:    stqcx. r8, 0, r3698; CHECK-NEXT:    bne cr0, .LBB5_1699; CHECK-NEXT:  # %bb.2: # %entry700; CHECK-NEXT:    lwsync701; CHECK-NEXT:    mr r3, r6702; CHECK-NEXT:    mr r4, r7703; CHECK-NEXT:    blr704;705; PWR7-LABEL: xor:706; PWR7:       # %bb.0: # %entry707; PWR7-NEXT:    mflr r0708; PWR7-NEXT:    stdu r1, -112(r1)709; PWR7-NEXT:    std r0, 128(r1)710; PWR7-NEXT:    .cfi_def_cfa_offset 112711; PWR7-NEXT:    .cfi_offset lr, 16712; PWR7-NEXT:    li r6, 5713; PWR7-NEXT:    bl __atomic_fetch_xor_16714; PWR7-NEXT:    nop715; PWR7-NEXT:    addi r1, r1, 112716; PWR7-NEXT:    ld r0, 16(r1)717; PWR7-NEXT:    mtlr r0718; PWR7-NEXT:    blr719;720; LE-PWR8-LABEL: xor:721; LE-PWR8:       # %bb.0: # %entry722; LE-PWR8-NEXT:    sync723; LE-PWR8-NEXT:  .LBB5_1: # %entry724; LE-PWR8-NEXT:    #725; LE-PWR8-NEXT:    lqarx r6, 0, r3726; LE-PWR8-NEXT:    xor r9, r4, r7727; LE-PWR8-NEXT:    xor r8, r5, r6728; LE-PWR8-NEXT:    stqcx. r8, 0, r3729; LE-PWR8-NEXT:    bne cr0, .LBB5_1730; LE-PWR8-NEXT:  # %bb.2: # %entry731; LE-PWR8-NEXT:    lwsync732; LE-PWR8-NEXT:    mr r3, r7733; LE-PWR8-NEXT:    mr r4, r6734; LE-PWR8-NEXT:    blr735;736; AIX64-PWR8-LABEL: xor:737; AIX64-PWR8:       # %bb.0: # %entry738; AIX64-PWR8-NEXT:    sync739; AIX64-PWR8-NEXT:  L..BB5_1: # %entry740; AIX64-PWR8-NEXT:    #741; AIX64-PWR8-NEXT:    lqarx r6, 0, r3742; AIX64-PWR8-NEXT:    xor r9, r5, r7743; AIX64-PWR8-NEXT:    xor r8, r4, r6744; AIX64-PWR8-NEXT:    stqcx. r8, 0, r3745; AIX64-PWR8-NEXT:    bne cr0, L..BB5_1746; AIX64-PWR8-NEXT:  # %bb.2: # %entry747; AIX64-PWR8-NEXT:    lwsync748; AIX64-PWR8-NEXT:    mr r3, r6749; AIX64-PWR8-NEXT:    mr r4, r7750; AIX64-PWR8-NEXT:    blr751;752; PPC-PWR8-LABEL: xor:753; PPC-PWR8:       # %bb.0: # %entry754; PPC-PWR8-NEXT:    mflr r0755; PPC-PWR8-NEXT:    stwu r1, -80(r1)756; PPC-PWR8-NEXT:    stw r0, 84(r1)757; PPC-PWR8-NEXT:    .cfi_def_cfa_offset 80758; PPC-PWR8-NEXT:    .cfi_offset lr, 4759; PPC-PWR8-NEXT:    .cfi_offset r24, -32760; PPC-PWR8-NEXT:    .cfi_offset r25, -28761; PPC-PWR8-NEXT:    .cfi_offset r26, -24762; PPC-PWR8-NEXT:    .cfi_offset r27, -20763; PPC-PWR8-NEXT:    .cfi_offset r28, -16764; PPC-PWR8-NEXT:    .cfi_offset r29, -12765; PPC-PWR8-NEXT:    .cfi_offset r30, -8766; PPC-PWR8-NEXT:    stw r26, 56(r1) # 4-byte Folded Spill767; PPC-PWR8-NEXT:    stw r27, 60(r1) # 4-byte Folded Spill768; PPC-PWR8-NEXT:    mr r27, r5769; PPC-PWR8-NEXT:    mr r26, r3770; PPC-PWR8-NEXT:    stw r28, 64(r1) # 4-byte Folded Spill771; PPC-PWR8-NEXT:    mr r28, r6772; PPC-PWR8-NEXT:    lwz r6, 12(r3)773; PPC-PWR8-NEXT:    stw r24, 48(r1) # 4-byte Folded Spill774; PPC-PWR8-NEXT:    lwz r5, 8(r3)775; PPC-PWR8-NEXT:    lwz r4, 4(r3)776; PPC-PWR8-NEXT:    stw r25, 52(r1) # 4-byte Folded Spill777; PPC-PWR8-NEXT:    addi r25, r1, 32778; PPC-PWR8-NEXT:    lwz r3, 0(r3)779; PPC-PWR8-NEXT:    stw r29, 68(r1) # 4-byte Folded Spill780; PPC-PWR8-NEXT:    mr r29, r7781; PPC-PWR8-NEXT:    addi r24, r1, 16782; PPC-PWR8-NEXT:    stw r30, 72(r1) # 4-byte Folded Spill783; PPC-PWR8-NEXT:    mr r30, r8784; PPC-PWR8-NEXT:    .p2align 4785; PPC-PWR8-NEXT:  .LBB5_1: # %atomicrmw.start786; PPC-PWR8-NEXT:    #787; PPC-PWR8-NEXT:    stw r3, 32(r1)788; PPC-PWR8-NEXT:    xor r3, r3, r27789; PPC-PWR8-NEXT:    stw r4, 36(r1)790; PPC-PWR8-NEXT:    xor r4, r4, r28791; PPC-PWR8-NEXT:    xor r7, r5, r29792; PPC-PWR8-NEXT:    stw r5, 40(r1)793; PPC-PWR8-NEXT:    xor r5, r6, r30794; PPC-PWR8-NEXT:    stw r6, 44(r1)795; PPC-PWR8-NEXT:    stw r5, 28(r1)796; PPC-PWR8-NEXT:    stw r7, 24(r1)797; PPC-PWR8-NEXT:    mr r5, r25798; PPC-PWR8-NEXT:    li r7, 5799; PPC-PWR8-NEXT:    stw r4, 20(r1)800; PPC-PWR8-NEXT:    stw r3, 16(r1)801; PPC-PWR8-NEXT:    li r3, 16802; PPC-PWR8-NEXT:    mr r4, r26803; PPC-PWR8-NEXT:    mr r6, r24804; PPC-PWR8-NEXT:    li r8, 5805; PPC-PWR8-NEXT:    bl __atomic_compare_exchange806; PPC-PWR8-NEXT:    mr r7, r3807; PPC-PWR8-NEXT:    lwz r6, 44(r1)808; PPC-PWR8-NEXT:    lwz r5, 40(r1)809; PPC-PWR8-NEXT:    lwz r4, 36(r1)810; PPC-PWR8-NEXT:    lwz r3, 32(r1)811; PPC-PWR8-NEXT:    cmplwi r7, 0812; PPC-PWR8-NEXT:    beq cr0, .LBB5_1813; PPC-PWR8-NEXT:  # %bb.2: # %atomicrmw.end814; PPC-PWR8-NEXT:    lwz r30, 72(r1) # 4-byte Folded Reload815; PPC-PWR8-NEXT:    lwz r29, 68(r1) # 4-byte Folded Reload816; PPC-PWR8-NEXT:    lwz r28, 64(r1) # 4-byte Folded Reload817; PPC-PWR8-NEXT:    lwz r27, 60(r1) # 4-byte Folded Reload818; PPC-PWR8-NEXT:    lwz r26, 56(r1) # 4-byte Folded Reload819; PPC-PWR8-NEXT:    lwz r25, 52(r1) # 4-byte Folded Reload820; PPC-PWR8-NEXT:    lwz r24, 48(r1) # 4-byte Folded Reload821; PPC-PWR8-NEXT:    lwz r0, 84(r1)822; PPC-PWR8-NEXT:    addi r1, r1, 80823; PPC-PWR8-NEXT:    mtlr r0824; PPC-PWR8-NEXT:    blr825entry:826  %0 = atomicrmw xor ptr %a, i128 %x seq_cst, align 16827  ret i128 %0828}829 830define i128 @nand(ptr %a, i128 %x) {831; CHECK-LABEL: nand:832; CHECK:       # %bb.0: # %entry833; CHECK-NEXT:    sync834; CHECK-NEXT:  .LBB6_1: # %entry835; CHECK-NEXT:    #836; CHECK-NEXT:    lqarx r6, 0, r3837; CHECK-NEXT:    nand r9, r5, r7838; CHECK-NEXT:    nand r8, r4, r6839; CHECK-NEXT:    stqcx. r8, 0, r3840; CHECK-NEXT:    bne cr0, .LBB6_1841; CHECK-NEXT:  # %bb.2: # %entry842; CHECK-NEXT:    lwsync843; CHECK-NEXT:    mr r3, r6844; CHECK-NEXT:    mr r4, r7845; CHECK-NEXT:    blr846;847; PWR7-LABEL: nand:848; PWR7:       # %bb.0: # %entry849; PWR7-NEXT:    mflr r0850; PWR7-NEXT:    stdu r1, -112(r1)851; PWR7-NEXT:    std r0, 128(r1)852; PWR7-NEXT:    .cfi_def_cfa_offset 112853; PWR7-NEXT:    .cfi_offset lr, 16854; PWR7-NEXT:    li r6, 5855; PWR7-NEXT:    bl __atomic_fetch_nand_16856; PWR7-NEXT:    nop857; PWR7-NEXT:    addi r1, r1, 112858; PWR7-NEXT:    ld r0, 16(r1)859; PWR7-NEXT:    mtlr r0860; PWR7-NEXT:    blr861;862; LE-PWR8-LABEL: nand:863; LE-PWR8:       # %bb.0: # %entry864; LE-PWR8-NEXT:    sync865; LE-PWR8-NEXT:  .LBB6_1: # %entry866; LE-PWR8-NEXT:    #867; LE-PWR8-NEXT:    lqarx r6, 0, r3868; LE-PWR8-NEXT:    nand r9, r4, r7869; LE-PWR8-NEXT:    nand r8, r5, r6870; LE-PWR8-NEXT:    stqcx. r8, 0, r3871; LE-PWR8-NEXT:    bne cr0, .LBB6_1872; LE-PWR8-NEXT:  # %bb.2: # %entry873; LE-PWR8-NEXT:    lwsync874; LE-PWR8-NEXT:    mr r3, r7875; LE-PWR8-NEXT:    mr r4, r6876; LE-PWR8-NEXT:    blr877;878; AIX64-PWR8-LABEL: nand:879; AIX64-PWR8:       # %bb.0: # %entry880; AIX64-PWR8-NEXT:    sync881; AIX64-PWR8-NEXT:  L..BB6_1: # %entry882; AIX64-PWR8-NEXT:    #883; AIX64-PWR8-NEXT:    lqarx r6, 0, r3884; AIX64-PWR8-NEXT:    nand r9, r5, r7885; AIX64-PWR8-NEXT:    nand r8, r4, r6886; AIX64-PWR8-NEXT:    stqcx. r8, 0, r3887; AIX64-PWR8-NEXT:    bne cr0, L..BB6_1888; AIX64-PWR8-NEXT:  # %bb.2: # %entry889; AIX64-PWR8-NEXT:    lwsync890; AIX64-PWR8-NEXT:    mr r3, r6891; AIX64-PWR8-NEXT:    mr r4, r7892; AIX64-PWR8-NEXT:    blr893;894; PPC-PWR8-LABEL: nand:895; PPC-PWR8:       # %bb.0: # %entry896; PPC-PWR8-NEXT:    mflr r0897; PPC-PWR8-NEXT:    stwu r1, -80(r1)898; PPC-PWR8-NEXT:    stw r0, 84(r1)899; PPC-PWR8-NEXT:    .cfi_def_cfa_offset 80900; PPC-PWR8-NEXT:    .cfi_offset lr, 4901; PPC-PWR8-NEXT:    .cfi_offset r24, -32902; PPC-PWR8-NEXT:    .cfi_offset r25, -28903; PPC-PWR8-NEXT:    .cfi_offset r26, -24904; PPC-PWR8-NEXT:    .cfi_offset r27, -20905; PPC-PWR8-NEXT:    .cfi_offset r28, -16906; PPC-PWR8-NEXT:    .cfi_offset r29, -12907; PPC-PWR8-NEXT:    .cfi_offset r30, -8908; PPC-PWR8-NEXT:    stw r26, 56(r1) # 4-byte Folded Spill909; PPC-PWR8-NEXT:    stw r27, 60(r1) # 4-byte Folded Spill910; PPC-PWR8-NEXT:    mr r27, r5911; PPC-PWR8-NEXT:    mr r26, r3912; PPC-PWR8-NEXT:    stw r28, 64(r1) # 4-byte Folded Spill913; PPC-PWR8-NEXT:    mr r28, r6914; PPC-PWR8-NEXT:    lwz r6, 12(r3)915; PPC-PWR8-NEXT:    stw r24, 48(r1) # 4-byte Folded Spill916; PPC-PWR8-NEXT:    lwz r5, 8(r3)917; PPC-PWR8-NEXT:    lwz r4, 4(r3)918; PPC-PWR8-NEXT:    stw r25, 52(r1) # 4-byte Folded Spill919; PPC-PWR8-NEXT:    addi r25, r1, 32920; PPC-PWR8-NEXT:    lwz r3, 0(r3)921; PPC-PWR8-NEXT:    stw r29, 68(r1) # 4-byte Folded Spill922; PPC-PWR8-NEXT:    mr r29, r7923; PPC-PWR8-NEXT:    addi r24, r1, 16924; PPC-PWR8-NEXT:    stw r30, 72(r1) # 4-byte Folded Spill925; PPC-PWR8-NEXT:    mr r30, r8926; PPC-PWR8-NEXT:    .p2align 4927; PPC-PWR8-NEXT:  .LBB6_1: # %atomicrmw.start928; PPC-PWR8-NEXT:    #929; PPC-PWR8-NEXT:    stw r3, 32(r1)930; PPC-PWR8-NEXT:    nand r3, r3, r27931; PPC-PWR8-NEXT:    stw r4, 36(r1)932; PPC-PWR8-NEXT:    nand r4, r4, r28933; PPC-PWR8-NEXT:    nand r7, r5, r29934; PPC-PWR8-NEXT:    stw r5, 40(r1)935; PPC-PWR8-NEXT:    nand r5, r6, r30936; PPC-PWR8-NEXT:    stw r6, 44(r1)937; PPC-PWR8-NEXT:    stw r5, 28(r1)938; PPC-PWR8-NEXT:    stw r7, 24(r1)939; PPC-PWR8-NEXT:    mr r5, r25940; PPC-PWR8-NEXT:    li r7, 5941; PPC-PWR8-NEXT:    stw r4, 20(r1)942; PPC-PWR8-NEXT:    stw r3, 16(r1)943; PPC-PWR8-NEXT:    li r3, 16944; PPC-PWR8-NEXT:    mr r4, r26945; PPC-PWR8-NEXT:    mr r6, r24946; PPC-PWR8-NEXT:    li r8, 5947; PPC-PWR8-NEXT:    bl __atomic_compare_exchange948; PPC-PWR8-NEXT:    mr r7, r3949; PPC-PWR8-NEXT:    lwz r6, 44(r1)950; PPC-PWR8-NEXT:    lwz r5, 40(r1)951; PPC-PWR8-NEXT:    lwz r4, 36(r1)952; PPC-PWR8-NEXT:    lwz r3, 32(r1)953; PPC-PWR8-NEXT:    cmplwi r7, 0954; PPC-PWR8-NEXT:    beq cr0, .LBB6_1955; PPC-PWR8-NEXT:  # %bb.2: # %atomicrmw.end956; PPC-PWR8-NEXT:    lwz r30, 72(r1) # 4-byte Folded Reload957; PPC-PWR8-NEXT:    lwz r29, 68(r1) # 4-byte Folded Reload958; PPC-PWR8-NEXT:    lwz r28, 64(r1) # 4-byte Folded Reload959; PPC-PWR8-NEXT:    lwz r27, 60(r1) # 4-byte Folded Reload960; PPC-PWR8-NEXT:    lwz r26, 56(r1) # 4-byte Folded Reload961; PPC-PWR8-NEXT:    lwz r25, 52(r1) # 4-byte Folded Reload962; PPC-PWR8-NEXT:    lwz r24, 48(r1) # 4-byte Folded Reload963; PPC-PWR8-NEXT:    lwz r0, 84(r1)964; PPC-PWR8-NEXT:    addi r1, r1, 80965; PPC-PWR8-NEXT:    mtlr r0966; PPC-PWR8-NEXT:    blr967entry:968  %0 = atomicrmw nand ptr %a, i128 %x seq_cst, align 16969  ret i128 %0970}971 972;; CmpXchg973define i128 @cas_weak_acquire_acquire(ptr %a, i128 %cmp, i128 %new) {974; CHECK-LABEL: cas_weak_acquire_acquire:975; CHECK:       # %bb.0: # %entry976; CHECK-NEXT:  .LBB7_1: # %entry977; CHECK-NEXT:    #978; CHECK-NEXT:    lqarx r8, 0, r3979; CHECK-NEXT:    xor r11, r9, r5980; CHECK-NEXT:    xor r10, r8, r4981; CHECK-NEXT:    or. r11, r11, r10982; CHECK-NEXT:    bne cr0, .LBB7_3983; CHECK-NEXT:  # %bb.2: # %entry984; CHECK-NEXT:    #985; CHECK-NEXT:    mr r11, r7986; CHECK-NEXT:    mr r10, r6987; CHECK-NEXT:    stqcx. r10, 0, r3988; CHECK-NEXT:    bne cr0, .LBB7_1989; CHECK-NEXT:  .LBB7_3: # %entry990; CHECK-NEXT:    lwsync991; CHECK-NEXT:    mr r3, r8992; CHECK-NEXT:    mr r4, r9993; CHECK-NEXT:    blr994;995; PWR7-LABEL: cas_weak_acquire_acquire:996; PWR7:       # %bb.0: # %entry997; PWR7-NEXT:    mflr r0998; PWR7-NEXT:    stdu r1, -128(r1)999; PWR7-NEXT:    std r0, 144(r1)1000; PWR7-NEXT:    .cfi_def_cfa_offset 1281001; PWR7-NEXT:    .cfi_offset lr, 161002; PWR7-NEXT:    std r5, 120(r1)1003; PWR7-NEXT:    std r4, 112(r1)1004; PWR7-NEXT:    addi r4, r1, 1121005; PWR7-NEXT:    mr r5, r61006; PWR7-NEXT:    mr r6, r71007; PWR7-NEXT:    li r7, 21008; PWR7-NEXT:    li r8, 21009; PWR7-NEXT:    bl __atomic_compare_exchange_161010; PWR7-NEXT:    nop1011; PWR7-NEXT:    ld r4, 120(r1)1012; PWR7-NEXT:    ld r3, 112(r1)1013; PWR7-NEXT:    addi r1, r1, 1281014; PWR7-NEXT:    ld r0, 16(r1)1015; PWR7-NEXT:    mtlr r01016; PWR7-NEXT:    blr1017;1018; LE-PWR8-LABEL: cas_weak_acquire_acquire:1019; LE-PWR8:       # %bb.0: # %entry1020; LE-PWR8-NEXT:  .LBB7_1: # %entry1021; LE-PWR8-NEXT:    #1022; LE-PWR8-NEXT:    lqarx r8, 0, r31023; LE-PWR8-NEXT:    xor r11, r9, r41024; LE-PWR8-NEXT:    xor r10, r8, r51025; LE-PWR8-NEXT:    or. r11, r11, r101026; LE-PWR8-NEXT:    bne cr0, .LBB7_31027; LE-PWR8-NEXT:  # %bb.2: # %entry1028; LE-PWR8-NEXT:    #1029; LE-PWR8-NEXT:    mr r11, r61030; LE-PWR8-NEXT:    mr r10, r71031; LE-PWR8-NEXT:    stqcx. r10, 0, r31032; LE-PWR8-NEXT:    bne cr0, .LBB7_11033; LE-PWR8-NEXT:  .LBB7_3: # %entry1034; LE-PWR8-NEXT:    lwsync1035; LE-PWR8-NEXT:    mr r3, r91036; LE-PWR8-NEXT:    mr r4, r81037; LE-PWR8-NEXT:    blr1038;1039; AIX64-PWR8-LABEL: cas_weak_acquire_acquire:1040; AIX64-PWR8:       # %bb.0: # %entry1041; AIX64-PWR8-NEXT:  L..BB7_1: # %entry1042; AIX64-PWR8-NEXT:    #1043; AIX64-PWR8-NEXT:    lqarx r8, 0, r31044; AIX64-PWR8-NEXT:    xor r11, r9, r51045; AIX64-PWR8-NEXT:    xor r10, r8, r41046; AIX64-PWR8-NEXT:    or. r11, r11, r101047; AIX64-PWR8-NEXT:    bne cr0, L..BB7_31048; AIX64-PWR8-NEXT:  # %bb.2: # %entry1049; AIX64-PWR8-NEXT:    #1050; AIX64-PWR8-NEXT:    mr r11, r71051; AIX64-PWR8-NEXT:    mr r10, r61052; AIX64-PWR8-NEXT:    stqcx. r10, 0, r31053; AIX64-PWR8-NEXT:    bne cr0, L..BB7_11054; AIX64-PWR8-NEXT:  L..BB7_3: # %entry1055; AIX64-PWR8-NEXT:    lwsync1056; AIX64-PWR8-NEXT:    mr r3, r81057; AIX64-PWR8-NEXT:    mr r4, r91058; AIX64-PWR8-NEXT:    blr1059;1060; PPC-PWR8-LABEL: cas_weak_acquire_acquire:1061; PPC-PWR8:       # %bb.0: # %entry1062; PPC-PWR8-NEXT:    mflr r01063; PPC-PWR8-NEXT:    stwu r1, -48(r1)1064; PPC-PWR8-NEXT:    stw r0, 52(r1)1065; PPC-PWR8-NEXT:    .cfi_def_cfa_offset 481066; PPC-PWR8-NEXT:    .cfi_offset lr, 41067; PPC-PWR8-NEXT:    mr r4, r31068; PPC-PWR8-NEXT:    lwz r3, 60(r1)1069; PPC-PWR8-NEXT:    stw r8, 44(r1)1070; PPC-PWR8-NEXT:    stw r7, 40(r1)1071; PPC-PWR8-NEXT:    stw r6, 36(r1)1072; PPC-PWR8-NEXT:    stw r5, 32(r1)1073; PPC-PWR8-NEXT:    addi r5, r1, 321074; PPC-PWR8-NEXT:    addi r6, r1, 161075; PPC-PWR8-NEXT:    li r7, 21076; PPC-PWR8-NEXT:    li r8, 21077; PPC-PWR8-NEXT:    stw r10, 20(r1)1078; PPC-PWR8-NEXT:    stw r9, 16(r1)1079; PPC-PWR8-NEXT:    stw r3, 28(r1)1080; PPC-PWR8-NEXT:    lwz r3, 56(r1)1081; PPC-PWR8-NEXT:    stw r3, 24(r1)1082; PPC-PWR8-NEXT:    li r3, 161083; PPC-PWR8-NEXT:    bl __atomic_compare_exchange1084; PPC-PWR8-NEXT:    lwz r6, 44(r1)1085; PPC-PWR8-NEXT:    lwz r5, 40(r1)1086; PPC-PWR8-NEXT:    lwz r4, 36(r1)1087; PPC-PWR8-NEXT:    lwz r3, 32(r1)1088; PPC-PWR8-NEXT:    lwz r0, 52(r1)1089; PPC-PWR8-NEXT:    addi r1, r1, 481090; PPC-PWR8-NEXT:    mtlr r01091; PPC-PWR8-NEXT:    blr1092entry:1093  %0 = cmpxchg weak ptr %a, i128 %cmp, i128 %new acquire acquire1094  %1 = extractvalue { i128, i1 } %0, 01095  ret i128 %11096}1097 1098define i128 @cas_weak_release_monotonic(ptr %a, i128 %cmp, i128 %new) {1099; CHECK-LABEL: cas_weak_release_monotonic:1100; CHECK:       # %bb.0: # %entry1101; CHECK-NEXT:    lwsync1102; CHECK-NEXT:  .LBB8_1: # %entry1103; CHECK-NEXT:    #1104; CHECK-NEXT:    lqarx r8, 0, r31105; CHECK-NEXT:    xor r11, r9, r51106; CHECK-NEXT:    xor r10, r8, r41107; CHECK-NEXT:    or. r11, r11, r101108; CHECK-NEXT:    bne cr0, .LBB8_31109; CHECK-NEXT:  # %bb.2: # %entry1110; CHECK-NEXT:    #1111; CHECK-NEXT:    mr r11, r71112; CHECK-NEXT:    mr r10, r61113; CHECK-NEXT:    stqcx. r10, 0, r31114; CHECK-NEXT:    bne cr0, .LBB8_11115; CHECK-NEXT:  .LBB8_3: # %entry1116; CHECK-NEXT:    mr r3, r81117; CHECK-NEXT:    mr r4, r91118; CHECK-NEXT:    blr1119;1120; PWR7-LABEL: cas_weak_release_monotonic:1121; PWR7:       # %bb.0: # %entry1122; PWR7-NEXT:    mflr r01123; PWR7-NEXT:    stdu r1, -128(r1)1124; PWR7-NEXT:    std r0, 144(r1)1125; PWR7-NEXT:    .cfi_def_cfa_offset 1281126; PWR7-NEXT:    .cfi_offset lr, 161127; PWR7-NEXT:    std r5, 120(r1)1128; PWR7-NEXT:    std r4, 112(r1)1129; PWR7-NEXT:    addi r4, r1, 1121130; PWR7-NEXT:    mr r5, r61131; PWR7-NEXT:    mr r6, r71132; PWR7-NEXT:    li r7, 31133; PWR7-NEXT:    li r8, 01134; PWR7-NEXT:    bl __atomic_compare_exchange_161135; PWR7-NEXT:    nop1136; PWR7-NEXT:    ld r4, 120(r1)1137; PWR7-NEXT:    ld r3, 112(r1)1138; PWR7-NEXT:    addi r1, r1, 1281139; PWR7-NEXT:    ld r0, 16(r1)1140; PWR7-NEXT:    mtlr r01141; PWR7-NEXT:    blr1142;1143; LE-PWR8-LABEL: cas_weak_release_monotonic:1144; LE-PWR8:       # %bb.0: # %entry1145; LE-PWR8-NEXT:    lwsync1146; LE-PWR8-NEXT:  .LBB8_1: # %entry1147; LE-PWR8-NEXT:    #1148; LE-PWR8-NEXT:    lqarx r8, 0, r31149; LE-PWR8-NEXT:    xor r11, r9, r41150; LE-PWR8-NEXT:    xor r10, r8, r51151; LE-PWR8-NEXT:    or. r11, r11, r101152; LE-PWR8-NEXT:    bne cr0, .LBB8_31153; LE-PWR8-NEXT:  # %bb.2: # %entry1154; LE-PWR8-NEXT:    #1155; LE-PWR8-NEXT:    mr r11, r61156; LE-PWR8-NEXT:    mr r10, r71157; LE-PWR8-NEXT:    stqcx. r10, 0, r31158; LE-PWR8-NEXT:    bne cr0, .LBB8_11159; LE-PWR8-NEXT:  .LBB8_3: # %entry1160; LE-PWR8-NEXT:    mr r3, r91161; LE-PWR8-NEXT:    mr r4, r81162; LE-PWR8-NEXT:    blr1163;1164; AIX64-PWR8-LABEL: cas_weak_release_monotonic:1165; AIX64-PWR8:       # %bb.0: # %entry1166; AIX64-PWR8-NEXT:    lwsync1167; AIX64-PWR8-NEXT:  L..BB8_1: # %entry1168; AIX64-PWR8-NEXT:    #1169; AIX64-PWR8-NEXT:    lqarx r8, 0, r31170; AIX64-PWR8-NEXT:    xor r11, r9, r51171; AIX64-PWR8-NEXT:    xor r10, r8, r41172; AIX64-PWR8-NEXT:    or. r11, r11, r101173; AIX64-PWR8-NEXT:    bne cr0, L..BB8_31174; AIX64-PWR8-NEXT:  # %bb.2: # %entry1175; AIX64-PWR8-NEXT:    #1176; AIX64-PWR8-NEXT:    mr r11, r71177; AIX64-PWR8-NEXT:    mr r10, r61178; AIX64-PWR8-NEXT:    stqcx. r10, 0, r31179; AIX64-PWR8-NEXT:    bne cr0, L..BB8_11180; AIX64-PWR8-NEXT:  L..BB8_3: # %entry1181; AIX64-PWR8-NEXT:    mr r3, r81182; AIX64-PWR8-NEXT:    mr r4, r91183; AIX64-PWR8-NEXT:    blr1184;1185; PPC-PWR8-LABEL: cas_weak_release_monotonic:1186; PPC-PWR8:       # %bb.0: # %entry1187; PPC-PWR8-NEXT:    mflr r01188; PPC-PWR8-NEXT:    stwu r1, -48(r1)1189; PPC-PWR8-NEXT:    stw r0, 52(r1)1190; PPC-PWR8-NEXT:    .cfi_def_cfa_offset 481191; PPC-PWR8-NEXT:    .cfi_offset lr, 41192; PPC-PWR8-NEXT:    mr r4, r31193; PPC-PWR8-NEXT:    lwz r3, 60(r1)1194; PPC-PWR8-NEXT:    stw r8, 44(r1)1195; PPC-PWR8-NEXT:    stw r7, 40(r1)1196; PPC-PWR8-NEXT:    stw r6, 36(r1)1197; PPC-PWR8-NEXT:    stw r5, 32(r1)1198; PPC-PWR8-NEXT:    addi r5, r1, 321199; PPC-PWR8-NEXT:    addi r6, r1, 161200; PPC-PWR8-NEXT:    li r7, 31201; PPC-PWR8-NEXT:    li r8, 01202; PPC-PWR8-NEXT:    stw r10, 20(r1)1203; PPC-PWR8-NEXT:    stw r9, 16(r1)1204; PPC-PWR8-NEXT:    stw r3, 28(r1)1205; PPC-PWR8-NEXT:    lwz r3, 56(r1)1206; PPC-PWR8-NEXT:    stw r3, 24(r1)1207; PPC-PWR8-NEXT:    li r3, 161208; PPC-PWR8-NEXT:    bl __atomic_compare_exchange1209; PPC-PWR8-NEXT:    lwz r6, 44(r1)1210; PPC-PWR8-NEXT:    lwz r5, 40(r1)1211; PPC-PWR8-NEXT:    lwz r4, 36(r1)1212; PPC-PWR8-NEXT:    lwz r3, 32(r1)1213; PPC-PWR8-NEXT:    lwz r0, 52(r1)1214; PPC-PWR8-NEXT:    addi r1, r1, 481215; PPC-PWR8-NEXT:    mtlr r01216; PPC-PWR8-NEXT:    blr1217entry:1218  %0 = cmpxchg weak ptr %a, i128 %cmp, i128 %new release monotonic1219  %1 = extractvalue { i128, i1 } %0, 01220  ret i128 %11221}1222 1223define i128 @cas_sc_sc(ptr %a, i128 %cmp, i128 %new) {1224; CHECK-LABEL: cas_sc_sc:1225; CHECK:       # %bb.0: # %entry1226; CHECK-NEXT:    sync1227; CHECK-NEXT:  .LBB9_1: # %entry1228; CHECK-NEXT:    #1229; CHECK-NEXT:    lqarx r8, 0, r31230; CHECK-NEXT:    xor r11, r9, r51231; CHECK-NEXT:    xor r10, r8, r41232; CHECK-NEXT:    or. r11, r11, r101233; CHECK-NEXT:    bne cr0, .LBB9_31234; CHECK-NEXT:  # %bb.2: # %entry1235; CHECK-NEXT:    #1236; CHECK-NEXT:    mr r11, r71237; CHECK-NEXT:    mr r10, r61238; CHECK-NEXT:    stqcx. r10, 0, r31239; CHECK-NEXT:    bne cr0, .LBB9_11240; CHECK-NEXT:  .LBB9_3: # %entry1241; CHECK-NEXT:    lwsync1242; CHECK-NEXT:    mr r3, r81243; CHECK-NEXT:    mr r4, r91244; CHECK-NEXT:    blr1245;1246; PWR7-LABEL: cas_sc_sc:1247; PWR7:       # %bb.0: # %entry1248; PWR7-NEXT:    mflr r01249; PWR7-NEXT:    stdu r1, -128(r1)1250; PWR7-NEXT:    std r0, 144(r1)1251; PWR7-NEXT:    .cfi_def_cfa_offset 1281252; PWR7-NEXT:    .cfi_offset lr, 161253; PWR7-NEXT:    std r5, 120(r1)1254; PWR7-NEXT:    std r4, 112(r1)1255; PWR7-NEXT:    addi r4, r1, 1121256; PWR7-NEXT:    mr r5, r61257; PWR7-NEXT:    mr r6, r71258; PWR7-NEXT:    li r7, 51259; PWR7-NEXT:    li r8, 51260; PWR7-NEXT:    bl __atomic_compare_exchange_161261; PWR7-NEXT:    nop1262; PWR7-NEXT:    ld r4, 120(r1)1263; PWR7-NEXT:    ld r3, 112(r1)1264; PWR7-NEXT:    addi r1, r1, 1281265; PWR7-NEXT:    ld r0, 16(r1)1266; PWR7-NEXT:    mtlr r01267; PWR7-NEXT:    blr1268;1269; LE-PWR8-LABEL: cas_sc_sc:1270; LE-PWR8:       # %bb.0: # %entry1271; LE-PWR8-NEXT:    sync1272; LE-PWR8-NEXT:  .LBB9_1: # %entry1273; LE-PWR8-NEXT:    #1274; LE-PWR8-NEXT:    lqarx r8, 0, r31275; LE-PWR8-NEXT:    xor r11, r9, r41276; LE-PWR8-NEXT:    xor r10, r8, r51277; LE-PWR8-NEXT:    or. r11, r11, r101278; LE-PWR8-NEXT:    bne cr0, .LBB9_31279; LE-PWR8-NEXT:  # %bb.2: # %entry1280; LE-PWR8-NEXT:    #1281; LE-PWR8-NEXT:    mr r11, r61282; LE-PWR8-NEXT:    mr r10, r71283; LE-PWR8-NEXT:    stqcx. r10, 0, r31284; LE-PWR8-NEXT:    bne cr0, .LBB9_11285; LE-PWR8-NEXT:  .LBB9_3: # %entry1286; LE-PWR8-NEXT:    lwsync1287; LE-PWR8-NEXT:    mr r3, r91288; LE-PWR8-NEXT:    mr r4, r81289; LE-PWR8-NEXT:    blr1290;1291; AIX64-PWR8-LABEL: cas_sc_sc:1292; AIX64-PWR8:       # %bb.0: # %entry1293; AIX64-PWR8-NEXT:    sync1294; AIX64-PWR8-NEXT:  L..BB9_1: # %entry1295; AIX64-PWR8-NEXT:    #1296; AIX64-PWR8-NEXT:    lqarx r8, 0, r31297; AIX64-PWR8-NEXT:    xor r11, r9, r51298; AIX64-PWR8-NEXT:    xor r10, r8, r41299; AIX64-PWR8-NEXT:    or. r11, r11, r101300; AIX64-PWR8-NEXT:    bne cr0, L..BB9_31301; AIX64-PWR8-NEXT:  # %bb.2: # %entry1302; AIX64-PWR8-NEXT:    #1303; AIX64-PWR8-NEXT:    mr r11, r71304; AIX64-PWR8-NEXT:    mr r10, r61305; AIX64-PWR8-NEXT:    stqcx. r10, 0, r31306; AIX64-PWR8-NEXT:    bne cr0, L..BB9_11307; AIX64-PWR8-NEXT:  L..BB9_3: # %entry1308; AIX64-PWR8-NEXT:    lwsync1309; AIX64-PWR8-NEXT:    mr r3, r81310; AIX64-PWR8-NEXT:    mr r4, r91311; AIX64-PWR8-NEXT:    blr1312;1313; PPC-PWR8-LABEL: cas_sc_sc:1314; PPC-PWR8:       # %bb.0: # %entry1315; PPC-PWR8-NEXT:    mflr r01316; PPC-PWR8-NEXT:    stwu r1, -48(r1)1317; PPC-PWR8-NEXT:    stw r0, 52(r1)1318; PPC-PWR8-NEXT:    .cfi_def_cfa_offset 481319; PPC-PWR8-NEXT:    .cfi_offset lr, 41320; PPC-PWR8-NEXT:    mr r4, r31321; PPC-PWR8-NEXT:    lwz r3, 60(r1)1322; PPC-PWR8-NEXT:    stw r8, 44(r1)1323; PPC-PWR8-NEXT:    stw r7, 40(r1)1324; PPC-PWR8-NEXT:    stw r6, 36(r1)1325; PPC-PWR8-NEXT:    stw r5, 32(r1)1326; PPC-PWR8-NEXT:    addi r5, r1, 321327; PPC-PWR8-NEXT:    addi r6, r1, 161328; PPC-PWR8-NEXT:    li r7, 51329; PPC-PWR8-NEXT:    li r8, 51330; PPC-PWR8-NEXT:    stw r10, 20(r1)1331; PPC-PWR8-NEXT:    stw r9, 16(r1)1332; PPC-PWR8-NEXT:    stw r3, 28(r1)1333; PPC-PWR8-NEXT:    lwz r3, 56(r1)1334; PPC-PWR8-NEXT:    stw r3, 24(r1)1335; PPC-PWR8-NEXT:    li r3, 161336; PPC-PWR8-NEXT:    bl __atomic_compare_exchange1337; PPC-PWR8-NEXT:    lwz r6, 44(r1)1338; PPC-PWR8-NEXT:    lwz r5, 40(r1)1339; PPC-PWR8-NEXT:    lwz r4, 36(r1)1340; PPC-PWR8-NEXT:    lwz r3, 32(r1)1341; PPC-PWR8-NEXT:    lwz r0, 52(r1)1342; PPC-PWR8-NEXT:    addi r1, r1, 481343; PPC-PWR8-NEXT:    mtlr r01344; PPC-PWR8-NEXT:    blr1345entry:1346  %0 = cmpxchg ptr %a, i128 %cmp, i128 %new seq_cst seq_cst1347  %1 = extractvalue { i128, i1 } %0, 01348  ret i128 %11349}1350 1351define i128 @cas_acqrel_acquire(ptr %a, i128 %cmp, i128 %new) {1352; CHECK-LABEL: cas_acqrel_acquire:1353; CHECK:       # %bb.0: # %entry1354; CHECK-NEXT:    lwsync1355; CHECK-NEXT:  .LBB10_1: # %entry1356; CHECK-NEXT:    #1357; CHECK-NEXT:    lqarx r8, 0, r31358; CHECK-NEXT:    xor r11, r9, r51359; CHECK-NEXT:    xor r10, r8, r41360; CHECK-NEXT:    or. r11, r11, r101361; CHECK-NEXT:    bne cr0, .LBB10_31362; CHECK-NEXT:  # %bb.2: # %entry1363; CHECK-NEXT:    #1364; CHECK-NEXT:    mr r11, r71365; CHECK-NEXT:    mr r10, r61366; CHECK-NEXT:    stqcx. r10, 0, r31367; CHECK-NEXT:    bne cr0, .LBB10_11368; CHECK-NEXT:  .LBB10_3: # %entry1369; CHECK-NEXT:    lwsync1370; CHECK-NEXT:    mr r3, r81371; CHECK-NEXT:    mr r4, r91372; CHECK-NEXT:    blr1373;1374; PWR7-LABEL: cas_acqrel_acquire:1375; PWR7:       # %bb.0: # %entry1376; PWR7-NEXT:    mflr r01377; PWR7-NEXT:    stdu r1, -128(r1)1378; PWR7-NEXT:    std r0, 144(r1)1379; PWR7-NEXT:    .cfi_def_cfa_offset 1281380; PWR7-NEXT:    .cfi_offset lr, 161381; PWR7-NEXT:    std r5, 120(r1)1382; PWR7-NEXT:    std r4, 112(r1)1383; PWR7-NEXT:    addi r4, r1, 1121384; PWR7-NEXT:    mr r5, r61385; PWR7-NEXT:    mr r6, r71386; PWR7-NEXT:    li r7, 41387; PWR7-NEXT:    li r8, 21388; PWR7-NEXT:    bl __atomic_compare_exchange_161389; PWR7-NEXT:    nop1390; PWR7-NEXT:    ld r4, 120(r1)1391; PWR7-NEXT:    ld r3, 112(r1)1392; PWR7-NEXT:    addi r1, r1, 1281393; PWR7-NEXT:    ld r0, 16(r1)1394; PWR7-NEXT:    mtlr r01395; PWR7-NEXT:    blr1396;1397; LE-PWR8-LABEL: cas_acqrel_acquire:1398; LE-PWR8:       # %bb.0: # %entry1399; LE-PWR8-NEXT:    lwsync1400; LE-PWR8-NEXT:  .LBB10_1: # %entry1401; LE-PWR8-NEXT:    #1402; LE-PWR8-NEXT:    lqarx r8, 0, r31403; LE-PWR8-NEXT:    xor r11, r9, r41404; LE-PWR8-NEXT:    xor r10, r8, r51405; LE-PWR8-NEXT:    or. r11, r11, r101406; LE-PWR8-NEXT:    bne cr0, .LBB10_31407; LE-PWR8-NEXT:  # %bb.2: # %entry1408; LE-PWR8-NEXT:    #1409; LE-PWR8-NEXT:    mr r11, r61410; LE-PWR8-NEXT:    mr r10, r71411; LE-PWR8-NEXT:    stqcx. r10, 0, r31412; LE-PWR8-NEXT:    bne cr0, .LBB10_11413; LE-PWR8-NEXT:  .LBB10_3: # %entry1414; LE-PWR8-NEXT:    lwsync1415; LE-PWR8-NEXT:    mr r3, r91416; LE-PWR8-NEXT:    mr r4, r81417; LE-PWR8-NEXT:    blr1418;1419; AIX64-PWR8-LABEL: cas_acqrel_acquire:1420; AIX64-PWR8:       # %bb.0: # %entry1421; AIX64-PWR8-NEXT:    lwsync1422; AIX64-PWR8-NEXT:  L..BB10_1: # %entry1423; AIX64-PWR8-NEXT:    #1424; AIX64-PWR8-NEXT:    lqarx r8, 0, r31425; AIX64-PWR8-NEXT:    xor r11, r9, r51426; AIX64-PWR8-NEXT:    xor r10, r8, r41427; AIX64-PWR8-NEXT:    or. r11, r11, r101428; AIX64-PWR8-NEXT:    bne cr0, L..BB10_31429; AIX64-PWR8-NEXT:  # %bb.2: # %entry1430; AIX64-PWR8-NEXT:    #1431; AIX64-PWR8-NEXT:    mr r11, r71432; AIX64-PWR8-NEXT:    mr r10, r61433; AIX64-PWR8-NEXT:    stqcx. r10, 0, r31434; AIX64-PWR8-NEXT:    bne cr0, L..BB10_11435; AIX64-PWR8-NEXT:  L..BB10_3: # %entry1436; AIX64-PWR8-NEXT:    lwsync1437; AIX64-PWR8-NEXT:    mr r3, r81438; AIX64-PWR8-NEXT:    mr r4, r91439; AIX64-PWR8-NEXT:    blr1440;1441; PPC-PWR8-LABEL: cas_acqrel_acquire:1442; PPC-PWR8:       # %bb.0: # %entry1443; PPC-PWR8-NEXT:    mflr r01444; PPC-PWR8-NEXT:    stwu r1, -48(r1)1445; PPC-PWR8-NEXT:    stw r0, 52(r1)1446; PPC-PWR8-NEXT:    .cfi_def_cfa_offset 481447; PPC-PWR8-NEXT:    .cfi_offset lr, 41448; PPC-PWR8-NEXT:    mr r4, r31449; PPC-PWR8-NEXT:    lwz r3, 60(r1)1450; PPC-PWR8-NEXT:    stw r8, 44(r1)1451; PPC-PWR8-NEXT:    stw r7, 40(r1)1452; PPC-PWR8-NEXT:    stw r6, 36(r1)1453; PPC-PWR8-NEXT:    stw r5, 32(r1)1454; PPC-PWR8-NEXT:    addi r5, r1, 321455; PPC-PWR8-NEXT:    addi r6, r1, 161456; PPC-PWR8-NEXT:    li r7, 41457; PPC-PWR8-NEXT:    li r8, 21458; PPC-PWR8-NEXT:    stw r10, 20(r1)1459; PPC-PWR8-NEXT:    stw r9, 16(r1)1460; PPC-PWR8-NEXT:    stw r3, 28(r1)1461; PPC-PWR8-NEXT:    lwz r3, 56(r1)1462; PPC-PWR8-NEXT:    stw r3, 24(r1)1463; PPC-PWR8-NEXT:    li r3, 161464; PPC-PWR8-NEXT:    bl __atomic_compare_exchange1465; PPC-PWR8-NEXT:    lwz r6, 44(r1)1466; PPC-PWR8-NEXT:    lwz r5, 40(r1)1467; PPC-PWR8-NEXT:    lwz r4, 36(r1)1468; PPC-PWR8-NEXT:    lwz r3, 32(r1)1469; PPC-PWR8-NEXT:    lwz r0, 52(r1)1470; PPC-PWR8-NEXT:    addi r1, r1, 481471; PPC-PWR8-NEXT:    mtlr r01472; PPC-PWR8-NEXT:    blr1473entry:1474  %0 = cmpxchg ptr %a, i128 %cmp, i128 %new acq_rel acquire1475  %1 = extractvalue { i128, i1 } %0, 01476  ret i128 %11477}1478 1479define i1 @cas_acqrel_acquire_check_succ(ptr %a, i128 %cmp, i128 %new) {1480; CHECK-LABEL: cas_acqrel_acquire_check_succ:1481; CHECK:       # %bb.0: # %entry1482; CHECK-NEXT:    lwsync1483; CHECK-NEXT:  .LBB11_1: # %entry1484; CHECK-NEXT:    #1485; CHECK-NEXT:    lqarx r8, 0, r31486; CHECK-NEXT:    xor r11, r9, r51487; CHECK-NEXT:    xor r10, r8, r41488; CHECK-NEXT:    or. r11, r11, r101489; CHECK-NEXT:    bne cr0, .LBB11_31490; CHECK-NEXT:  # %bb.2: # %entry1491; CHECK-NEXT:    #1492; CHECK-NEXT:    mr r11, r71493; CHECK-NEXT:    mr r10, r61494; CHECK-NEXT:    stqcx. r10, 0, r31495; CHECK-NEXT:    bne cr0, .LBB11_11496; CHECK-NEXT:  .LBB11_3: # %entry1497; CHECK-NEXT:    lwsync1498; CHECK-NEXT:    xor r3, r4, r81499; CHECK-NEXT:    xor r4, r5, r91500; CHECK-NEXT:    or r3, r4, r31501; CHECK-NEXT:    cntlzd r3, r31502; CHECK-NEXT:    rldicl r3, r3, 58, 631503; CHECK-NEXT:    blr1504;1505; PWR7-LABEL: cas_acqrel_acquire_check_succ:1506; PWR7:       # %bb.0: # %entry1507; PWR7-NEXT:    mflr r01508; PWR7-NEXT:    stdu r1, -128(r1)1509; PWR7-NEXT:    std r0, 144(r1)1510; PWR7-NEXT:    .cfi_def_cfa_offset 1281511; PWR7-NEXT:    .cfi_offset lr, 161512; PWR7-NEXT:    std r5, 120(r1)1513; PWR7-NEXT:    std r4, 112(r1)1514; PWR7-NEXT:    addi r4, r1, 1121515; PWR7-NEXT:    mr r5, r61516; PWR7-NEXT:    mr r6, r71517; PWR7-NEXT:    li r7, 41518; PWR7-NEXT:    li r8, 21519; PWR7-NEXT:    bl __atomic_compare_exchange_161520; PWR7-NEXT:    nop1521; PWR7-NEXT:    addi r1, r1, 1281522; PWR7-NEXT:    ld r0, 16(r1)1523; PWR7-NEXT:    mtlr r01524; PWR7-NEXT:    blr1525;1526; LE-PWR8-LABEL: cas_acqrel_acquire_check_succ:1527; LE-PWR8:       # %bb.0: # %entry1528; LE-PWR8-NEXT:    lwsync1529; LE-PWR8-NEXT:  .LBB11_1: # %entry1530; LE-PWR8-NEXT:    #1531; LE-PWR8-NEXT:    lqarx r8, 0, r31532; LE-PWR8-NEXT:    xor r11, r9, r41533; LE-PWR8-NEXT:    xor r10, r8, r51534; LE-PWR8-NEXT:    or. r11, r11, r101535; LE-PWR8-NEXT:    bne cr0, .LBB11_31536; LE-PWR8-NEXT:  # %bb.2: # %entry1537; LE-PWR8-NEXT:    #1538; LE-PWR8-NEXT:    mr r11, r61539; LE-PWR8-NEXT:    mr r10, r71540; LE-PWR8-NEXT:    stqcx. r10, 0, r31541; LE-PWR8-NEXT:    bne cr0, .LBB11_11542; LE-PWR8-NEXT:  .LBB11_3: # %entry1543; LE-PWR8-NEXT:    lwsync1544; LE-PWR8-NEXT:    xor r3, r5, r81545; LE-PWR8-NEXT:    xor r4, r4, r91546; LE-PWR8-NEXT:    or r3, r4, r31547; LE-PWR8-NEXT:    cntlzd r3, r31548; LE-PWR8-NEXT:    rldicl r3, r3, 58, 631549; LE-PWR8-NEXT:    blr1550;1551; AIX64-PWR8-LABEL: cas_acqrel_acquire_check_succ:1552; AIX64-PWR8:       # %bb.0: # %entry1553; AIX64-PWR8-NEXT:    lwsync1554; AIX64-PWR8-NEXT:  L..BB11_1: # %entry1555; AIX64-PWR8-NEXT:    #1556; AIX64-PWR8-NEXT:    lqarx r8, 0, r31557; AIX64-PWR8-NEXT:    xor r11, r9, r51558; AIX64-PWR8-NEXT:    xor r10, r8, r41559; AIX64-PWR8-NEXT:    or. r11, r11, r101560; AIX64-PWR8-NEXT:    bne cr0, L..BB11_31561; AIX64-PWR8-NEXT:  # %bb.2: # %entry1562; AIX64-PWR8-NEXT:    #1563; AIX64-PWR8-NEXT:    mr r11, r71564; AIX64-PWR8-NEXT:    mr r10, r61565; AIX64-PWR8-NEXT:    stqcx. r10, 0, r31566; AIX64-PWR8-NEXT:    bne cr0, L..BB11_11567; AIX64-PWR8-NEXT:  L..BB11_3: # %entry1568; AIX64-PWR8-NEXT:    lwsync1569; AIX64-PWR8-NEXT:    xor r3, r4, r81570; AIX64-PWR8-NEXT:    xor r4, r5, r91571; AIX64-PWR8-NEXT:    or r3, r4, r31572; AIX64-PWR8-NEXT:    cntlzd r3, r31573; AIX64-PWR8-NEXT:    rldicl r3, r3, 58, 631574; AIX64-PWR8-NEXT:    blr1575;1576; PPC-PWR8-LABEL: cas_acqrel_acquire_check_succ:1577; PPC-PWR8:       # %bb.0: # %entry1578; PPC-PWR8-NEXT:    mflr r01579; PPC-PWR8-NEXT:    stwu r1, -48(r1)1580; PPC-PWR8-NEXT:    stw r0, 52(r1)1581; PPC-PWR8-NEXT:    .cfi_def_cfa_offset 481582; PPC-PWR8-NEXT:    .cfi_offset lr, 41583; PPC-PWR8-NEXT:    mr r4, r31584; PPC-PWR8-NEXT:    lwz r3, 60(r1)1585; PPC-PWR8-NEXT:    stw r8, 44(r1)1586; PPC-PWR8-NEXT:    stw r7, 40(r1)1587; PPC-PWR8-NEXT:    stw r6, 36(r1)1588; PPC-PWR8-NEXT:    stw r5, 32(r1)1589; PPC-PWR8-NEXT:    addi r5, r1, 321590; PPC-PWR8-NEXT:    addi r6, r1, 161591; PPC-PWR8-NEXT:    li r7, 41592; PPC-PWR8-NEXT:    li r8, 21593; PPC-PWR8-NEXT:    stw r10, 20(r1)1594; PPC-PWR8-NEXT:    stw r9, 16(r1)1595; PPC-PWR8-NEXT:    stw r3, 28(r1)1596; PPC-PWR8-NEXT:    lwz r3, 56(r1)1597; PPC-PWR8-NEXT:    stw r3, 24(r1)1598; PPC-PWR8-NEXT:    li r3, 161599; PPC-PWR8-NEXT:    bl __atomic_compare_exchange1600; PPC-PWR8-NEXT:    lwz r0, 52(r1)1601; PPC-PWR8-NEXT:    addi r1, r1, 481602; PPC-PWR8-NEXT:    mtlr r01603; PPC-PWR8-NEXT:    blr1604entry:1605  %0 = cmpxchg ptr %a, i128 %cmp, i128 %new acq_rel acquire1606  %1 = extractvalue { i128, i1 } %0, 11607  ret i1 %11608}1609 1610;; TODO: Optimize CAS at exit block when bool value is returned.1611define i1 @bool_cas_weak_acquire_acquire(ptr %a, i128 %cmp, i128 %new) {1612; CHECK-LABEL: bool_cas_weak_acquire_acquire:1613; CHECK:       # %bb.0: # %entry1614; CHECK-NEXT:  .LBB12_1: # %entry1615; CHECK-NEXT:    #1616; CHECK-NEXT:    lqarx r8, 0, r31617; CHECK-NEXT:    xor r11, r9, r51618; CHECK-NEXT:    xor r10, r8, r41619; CHECK-NEXT:    or. r11, r11, r101620; CHECK-NEXT:    bne cr0, .LBB12_31621; CHECK-NEXT:  # %bb.2: # %entry1622; CHECK-NEXT:    #1623; CHECK-NEXT:    mr r11, r71624; CHECK-NEXT:    mr r10, r61625; CHECK-NEXT:    stqcx. r10, 0, r31626; CHECK-NEXT:    bne cr0, .LBB12_11627; CHECK-NEXT:  .LBB12_3: # %entry1628; CHECK-NEXT:    lwsync1629; CHECK-NEXT:    xor r3, r4, r81630; CHECK-NEXT:    xor r4, r5, r91631; CHECK-NEXT:    or r3, r4, r31632; CHECK-NEXT:    cntlzd r3, r31633; CHECK-NEXT:    rldicl r3, r3, 58, 631634; CHECK-NEXT:    blr1635;1636; PWR7-LABEL: bool_cas_weak_acquire_acquire:1637; PWR7:       # %bb.0: # %entry1638; PWR7-NEXT:    mflr r01639; PWR7-NEXT:    stdu r1, -128(r1)1640; PWR7-NEXT:    std r0, 144(r1)1641; PWR7-NEXT:    .cfi_def_cfa_offset 1281642; PWR7-NEXT:    .cfi_offset lr, 161643; PWR7-NEXT:    std r5, 120(r1)1644; PWR7-NEXT:    std r4, 112(r1)1645; PWR7-NEXT:    addi r4, r1, 1121646; PWR7-NEXT:    mr r5, r61647; PWR7-NEXT:    mr r6, r71648; PWR7-NEXT:    li r7, 21649; PWR7-NEXT:    li r8, 21650; PWR7-NEXT:    bl __atomic_compare_exchange_161651; PWR7-NEXT:    nop1652; PWR7-NEXT:    addi r1, r1, 1281653; PWR7-NEXT:    ld r0, 16(r1)1654; PWR7-NEXT:    mtlr r01655; PWR7-NEXT:    blr1656;1657; LE-PWR8-LABEL: bool_cas_weak_acquire_acquire:1658; LE-PWR8:       # %bb.0: # %entry1659; LE-PWR8-NEXT:  .LBB12_1: # %entry1660; LE-PWR8-NEXT:    #1661; LE-PWR8-NEXT:    lqarx r8, 0, r31662; LE-PWR8-NEXT:    xor r11, r9, r41663; LE-PWR8-NEXT:    xor r10, r8, r51664; LE-PWR8-NEXT:    or. r11, r11, r101665; LE-PWR8-NEXT:    bne cr0, .LBB12_31666; LE-PWR8-NEXT:  # %bb.2: # %entry1667; LE-PWR8-NEXT:    #1668; LE-PWR8-NEXT:    mr r11, r61669; LE-PWR8-NEXT:    mr r10, r71670; LE-PWR8-NEXT:    stqcx. r10, 0, r31671; LE-PWR8-NEXT:    bne cr0, .LBB12_11672; LE-PWR8-NEXT:  .LBB12_3: # %entry1673; LE-PWR8-NEXT:    lwsync1674; LE-PWR8-NEXT:    xor r3, r5, r81675; LE-PWR8-NEXT:    xor r4, r4, r91676; LE-PWR8-NEXT:    or r3, r4, r31677; LE-PWR8-NEXT:    cntlzd r3, r31678; LE-PWR8-NEXT:    rldicl r3, r3, 58, 631679; LE-PWR8-NEXT:    blr1680;1681; AIX64-PWR8-LABEL: bool_cas_weak_acquire_acquire:1682; AIX64-PWR8:       # %bb.0: # %entry1683; AIX64-PWR8-NEXT:  L..BB12_1: # %entry1684; AIX64-PWR8-NEXT:    #1685; AIX64-PWR8-NEXT:    lqarx r8, 0, r31686; AIX64-PWR8-NEXT:    xor r11, r9, r51687; AIX64-PWR8-NEXT:    xor r10, r8, r41688; AIX64-PWR8-NEXT:    or. r11, r11, r101689; AIX64-PWR8-NEXT:    bne cr0, L..BB12_31690; AIX64-PWR8-NEXT:  # %bb.2: # %entry1691; AIX64-PWR8-NEXT:    #1692; AIX64-PWR8-NEXT:    mr r11, r71693; AIX64-PWR8-NEXT:    mr r10, r61694; AIX64-PWR8-NEXT:    stqcx. r10, 0, r31695; AIX64-PWR8-NEXT:    bne cr0, L..BB12_11696; AIX64-PWR8-NEXT:  L..BB12_3: # %entry1697; AIX64-PWR8-NEXT:    lwsync1698; AIX64-PWR8-NEXT:    xor r3, r4, r81699; AIX64-PWR8-NEXT:    xor r4, r5, r91700; AIX64-PWR8-NEXT:    or r3, r4, r31701; AIX64-PWR8-NEXT:    cntlzd r3, r31702; AIX64-PWR8-NEXT:    rldicl r3, r3, 58, 631703; AIX64-PWR8-NEXT:    blr1704;1705; PPC-PWR8-LABEL: bool_cas_weak_acquire_acquire:1706; PPC-PWR8:       # %bb.0: # %entry1707; PPC-PWR8-NEXT:    mflr r01708; PPC-PWR8-NEXT:    stwu r1, -48(r1)1709; PPC-PWR8-NEXT:    stw r0, 52(r1)1710; PPC-PWR8-NEXT:    .cfi_def_cfa_offset 481711; PPC-PWR8-NEXT:    .cfi_offset lr, 41712; PPC-PWR8-NEXT:    mr r4, r31713; PPC-PWR8-NEXT:    lwz r3, 60(r1)1714; PPC-PWR8-NEXT:    stw r8, 44(r1)1715; PPC-PWR8-NEXT:    stw r7, 40(r1)1716; PPC-PWR8-NEXT:    stw r6, 36(r1)1717; PPC-PWR8-NEXT:    stw r5, 32(r1)1718; PPC-PWR8-NEXT:    addi r5, r1, 321719; PPC-PWR8-NEXT:    addi r6, r1, 161720; PPC-PWR8-NEXT:    li r7, 21721; PPC-PWR8-NEXT:    li r8, 21722; PPC-PWR8-NEXT:    stw r10, 20(r1)1723; PPC-PWR8-NEXT:    stw r9, 16(r1)1724; PPC-PWR8-NEXT:    stw r3, 28(r1)1725; PPC-PWR8-NEXT:    lwz r3, 56(r1)1726; PPC-PWR8-NEXT:    stw r3, 24(r1)1727; PPC-PWR8-NEXT:    li r3, 161728; PPC-PWR8-NEXT:    bl __atomic_compare_exchange1729; PPC-PWR8-NEXT:    lwz r0, 52(r1)1730; PPC-PWR8-NEXT:    addi r1, r1, 481731; PPC-PWR8-NEXT:    mtlr r01732; PPC-PWR8-NEXT:    blr1733entry:1734  %0 = cmpxchg weak ptr %a, i128 %cmp, i128 %new acquire acquire1735  %1 = extractvalue { i128, i1 } %0, 11736  ret i1 %11737}1738