brintos

brintos / llvm-project-archived public Read only

0
0
Text · 29.7 KiB · 01c3e79 Raw
955 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc < %s -mtriple=x86_64-- -verify-machineinstrs                           | FileCheck %s --check-prefix=X643; RUN: llc < %s -mtriple=i686-- -verify-machineinstrs           -mattr=+sse2      | FileCheck %s --check-prefixes=X86,X86-GENERIC,X86-SSE24; RUN: llc < %s -mtriple=i686-- -verify-machineinstrs -mcpu=slm -mattr=-sse2      | FileCheck %s --check-prefixes=X86,X86-GENERIC,X86-SLM5; RUN: llc < %s -mtriple=i686-- -verify-machineinstrs -mcpu=goldmont -mattr=-sse2 | FileCheck %s --check-prefixes=X86,X86-GENERIC,X86-SLM6; RUN: llc < %s -mtriple=i686-- -verify-machineinstrs -mcpu=knl -mattr=-sse2      | FileCheck %s --check-prefixes=X86,X86-GENERIC,X86-SLM7; RUN: llc < %s -mtriple=i686-- -verify-machineinstrs -mcpu=atom -mattr=-sse2     | FileCheck %s --check-prefixes=X86,X86-ATOM8 9; On x86, an atomic rmw operation that does not modify the value in memory10; (such as atomic add 0) can be replaced by an mfence followed by a mov.11; This is explained (with the motivation for such an optimization) in12; http://www.hpl.hp.com/techreports/2012/HPL-2012-68.pdf13 14define i8 @add8(ptr %p) #0 {15; X64-LABEL: add8:16; X64:       # %bb.0:17; X64-NEXT:    lock orl $0, -{{[0-9]+}}(%rsp)18; X64-NEXT:    movzbl (%rdi), %eax19; X64-NEXT:    retq20;21; X86-SSE2-LABEL: add8:22; X86-SSE2:       # %bb.0:23; X86-SSE2-NEXT:    movl {{[0-9]+}}(%esp), %eax24; X86-SSE2-NEXT:    mfence25; X86-SSE2-NEXT:    movzbl (%eax), %eax26; X86-SSE2-NEXT:    retl27;28; X86-SLM-LABEL: add8:29; X86-SLM:       # %bb.0:30; X86-SLM-NEXT:    movl {{[0-9]+}}(%esp), %eax31; X86-SLM-NEXT:    lock orl $0, (%esp)32; X86-SLM-NEXT:    movzbl (%eax), %eax33; X86-SLM-NEXT:    retl34;35; X86-ATOM-LABEL: add8:36; X86-ATOM:       # %bb.0:37; X86-ATOM-NEXT:    movl {{[0-9]+}}(%esp), %eax38; X86-ATOM-NEXT:    lock orl $0, (%esp)39; X86-ATOM-NEXT:    movzbl (%eax), %eax40; X86-ATOM-NEXT:    nop41; X86-ATOM-NEXT:    nop42; X86-ATOM-NEXT:    retl43  %1 = atomicrmw add ptr %p, i8 0 monotonic44  ret i8 %145}46 47define i16 @or16(ptr %p) #0 {48; X64-LABEL: or16:49; X64:       # %bb.0:50; X64-NEXT:    lock orl $0, -{{[0-9]+}}(%rsp)51; X64-NEXT:    movzwl (%rdi), %eax52; X64-NEXT:    retq53;54; X86-SSE2-LABEL: or16:55; X86-SSE2:       # %bb.0:56; X86-SSE2-NEXT:    movl {{[0-9]+}}(%esp), %eax57; X86-SSE2-NEXT:    mfence58; X86-SSE2-NEXT:    movzwl (%eax), %eax59; X86-SSE2-NEXT:    retl60;61; X86-SLM-LABEL: or16:62; X86-SLM:       # %bb.0:63; X86-SLM-NEXT:    movl {{[0-9]+}}(%esp), %eax64; X86-SLM-NEXT:    lock orl $0, (%esp)65; X86-SLM-NEXT:    movzwl (%eax), %eax66; X86-SLM-NEXT:    retl67;68; X86-ATOM-LABEL: or16:69; X86-ATOM:       # %bb.0:70; X86-ATOM-NEXT:    movl {{[0-9]+}}(%esp), %eax71; X86-ATOM-NEXT:    lock orl $0, (%esp)72; X86-ATOM-NEXT:    movzwl (%eax), %eax73; X86-ATOM-NEXT:    nop74; X86-ATOM-NEXT:    nop75; X86-ATOM-NEXT:    retl76  %1 = atomicrmw or ptr %p, i16 0 acquire77  ret i16 %178}79 80define i32 @xor32(ptr %p) #0 {81; X64-LABEL: xor32:82; X64:       # %bb.0:83; X64-NEXT:    lock orl $0, -{{[0-9]+}}(%rsp)84; X64-NEXT:    movl (%rdi), %eax85; X64-NEXT:    retq86;87; X86-SSE2-LABEL: xor32:88; X86-SSE2:       # %bb.0:89; X86-SSE2-NEXT:    movl {{[0-9]+}}(%esp), %eax90; X86-SSE2-NEXT:    mfence91; X86-SSE2-NEXT:    movl (%eax), %eax92; X86-SSE2-NEXT:    retl93;94; X86-SLM-LABEL: xor32:95; X86-SLM:       # %bb.0:96; X86-SLM-NEXT:    movl {{[0-9]+}}(%esp), %eax97; X86-SLM-NEXT:    lock orl $0, (%esp)98; X86-SLM-NEXT:    movl (%eax), %eax99; X86-SLM-NEXT:    retl100;101; X86-ATOM-LABEL: xor32:102; X86-ATOM:       # %bb.0:103; X86-ATOM-NEXT:    movl {{[0-9]+}}(%esp), %eax104; X86-ATOM-NEXT:    lock orl $0, (%esp)105; X86-ATOM-NEXT:    movl (%eax), %eax106; X86-ATOM-NEXT:    nop107; X86-ATOM-NEXT:    nop108; X86-ATOM-NEXT:    retl109  %1 = atomicrmw xor ptr %p, i32 0 release110  ret i32 %1111}112 113define i64 @sub64(ptr %p) #0 {114; X64-LABEL: sub64:115; X64:       # %bb.0:116; X64-NEXT:    lock orl $0, -{{[0-9]+}}(%rsp)117; X64-NEXT:    movq (%rdi), %rax118; X64-NEXT:    retq119;120; X86-LABEL: sub64:121; X86:       # %bb.0:122; X86-NEXT:    pushl %ebx123; X86-NEXT:    pushl %esi124; X86-NEXT:    movl {{[0-9]+}}(%esp), %esi125; X86-NEXT:    movl (%esi), %eax126; X86-NEXT:    movl 4(%esi), %edx127; X86-NEXT:    .p2align 4128; X86-NEXT:  .LBB3_1: # %atomicrmw.start129; X86-NEXT:    # =>This Inner Loop Header: Depth=1130; X86-NEXT:    movl %edx, %ecx131; X86-NEXT:    movl %eax, %ebx132; X86-NEXT:    lock cmpxchg8b (%esi)133; X86-NEXT:    jne .LBB3_1134; X86-NEXT:  # %bb.2: # %atomicrmw.end135; X86-NEXT:    popl %esi136; X86-NEXT:    popl %ebx137; X86-NEXT:    retl138  %1 = atomicrmw sub ptr %p, i64 0 seq_cst139  ret i64 %1140}141 142define i128 @or128(ptr %p) #0 {143; X64-LABEL: or128:144; X64:       # %bb.0:145; X64-NEXT:    pushq %rax146; X64-NEXT:    xorl %esi, %esi147; X64-NEXT:    xorl %edx, %edx148; X64-NEXT:    xorl %ecx, %ecx149; X64-NEXT:    callq __atomic_fetch_or_16@PLT150; X64-NEXT:    popq %rcx151; X64-NEXT:    retq152;153; X86-GENERIC-LABEL: or128:154; X86-GENERIC:       # %bb.0:155; X86-GENERIC-NEXT:    pushl %ebp156; X86-GENERIC-NEXT:    movl %esp, %ebp157; X86-GENERIC-NEXT:    pushl %ebx158; X86-GENERIC-NEXT:    pushl %edi159; X86-GENERIC-NEXT:    pushl %esi160; X86-GENERIC-NEXT:    andl $-16, %esp161; X86-GENERIC-NEXT:    subl $48, %esp162; X86-GENERIC-NEXT:    movl 12(%ebp), %edi163; X86-GENERIC-NEXT:    movl 12(%edi), %ecx164; X86-GENERIC-NEXT:    movl 8(%edi), %edx165; X86-GENERIC-NEXT:    movl (%edi), %ebx166; X86-GENERIC-NEXT:    movl 4(%edi), %esi167; X86-GENERIC-NEXT:    .p2align 4168; X86-GENERIC-NEXT:  .LBB4_1: # %atomicrmw.start169; X86-GENERIC-NEXT:    # =>This Inner Loop Header: Depth=1170; X86-GENERIC-NEXT:    movl %ebx, (%esp)171; X86-GENERIC-NEXT:    movl %esi, {{[0-9]+}}(%esp)172; X86-GENERIC-NEXT:    movl %edx, {{[0-9]+}}(%esp)173; X86-GENERIC-NEXT:    movl %ecx, {{[0-9]+}}(%esp)174; X86-GENERIC-NEXT:    movl %ecx, {{[0-9]+}}(%esp)175; X86-GENERIC-NEXT:    movl %edx, {{[0-9]+}}(%esp)176; X86-GENERIC-NEXT:    movl %esi, {{[0-9]+}}(%esp)177; X86-GENERIC-NEXT:    movl %ebx, {{[0-9]+}}(%esp)178; X86-GENERIC-NEXT:    pushl $0179; X86-GENERIC-NEXT:    pushl $0180; X86-GENERIC-NEXT:    leal {{[0-9]+}}(%esp), %eax181; X86-GENERIC-NEXT:    pushl %eax182; X86-GENERIC-NEXT:    leal {{[0-9]+}}(%esp), %eax183; X86-GENERIC-NEXT:    pushl %eax184; X86-GENERIC-NEXT:    pushl %edi185; X86-GENERIC-NEXT:    pushl $16186; X86-GENERIC-NEXT:    calll __atomic_compare_exchange@PLT187; X86-GENERIC-NEXT:    addl $24, %esp188; X86-GENERIC-NEXT:    movl {{[0-9]+}}(%esp), %ecx189; X86-GENERIC-NEXT:    movl {{[0-9]+}}(%esp), %edx190; X86-GENERIC-NEXT:    movl (%esp), %ebx191; X86-GENERIC-NEXT:    movl {{[0-9]+}}(%esp), %esi192; X86-GENERIC-NEXT:    testb %al, %al193; X86-GENERIC-NEXT:    je .LBB4_1194; X86-GENERIC-NEXT:  # %bb.2: # %atomicrmw.end195; X86-GENERIC-NEXT:    movl 8(%ebp), %eax196; X86-GENERIC-NEXT:    movl %ebx, (%eax)197; X86-GENERIC-NEXT:    movl %esi, 4(%eax)198; X86-GENERIC-NEXT:    movl %edx, 8(%eax)199; X86-GENERIC-NEXT:    movl %ecx, 12(%eax)200; X86-GENERIC-NEXT:    leal -12(%ebp), %esp201; X86-GENERIC-NEXT:    popl %esi202; X86-GENERIC-NEXT:    popl %edi203; X86-GENERIC-NEXT:    popl %ebx204; X86-GENERIC-NEXT:    popl %ebp205; X86-GENERIC-NEXT:    retl $4206;207; X86-ATOM-LABEL: or128:208; X86-ATOM:       # %bb.0:209; X86-ATOM-NEXT:    pushl %ebp210; X86-ATOM-NEXT:    movl %esp, %ebp211; X86-ATOM-NEXT:    pushl %ebx212; X86-ATOM-NEXT:    pushl %edi213; X86-ATOM-NEXT:    pushl %esi214; X86-ATOM-NEXT:    andl $-16, %esp215; X86-ATOM-NEXT:    leal -{{[0-9]+}}(%esp), %esp216; X86-ATOM-NEXT:    movl 12(%ebp), %edi217; X86-ATOM-NEXT:    movl 12(%edi), %ecx218; X86-ATOM-NEXT:    movl 8(%edi), %edx219; X86-ATOM-NEXT:    movl (%edi), %esi220; X86-ATOM-NEXT:    movl 4(%edi), %ebx221; X86-ATOM-NEXT:    .p2align 4222; X86-ATOM-NEXT:  .LBB4_1: # %atomicrmw.start223; X86-ATOM-NEXT:    # =>This Inner Loop Header: Depth=1224; X86-ATOM-NEXT:    movl %esi, (%esp)225; X86-ATOM-NEXT:    movl %ebx, {{[0-9]+}}(%esp)226; X86-ATOM-NEXT:    movl %edx, {{[0-9]+}}(%esp)227; X86-ATOM-NEXT:    movl %ecx, {{[0-9]+}}(%esp)228; X86-ATOM-NEXT:    movl %ecx, {{[0-9]+}}(%esp)229; X86-ATOM-NEXT:    movl %edx, {{[0-9]+}}(%esp)230; X86-ATOM-NEXT:    movl %ebx, {{[0-9]+}}(%esp)231; X86-ATOM-NEXT:    movl %esi, {{[0-9]+}}(%esp)232; X86-ATOM-NEXT:    pushl $0233; X86-ATOM-NEXT:    pushl $0234; X86-ATOM-NEXT:    leal {{[0-9]+}}(%esp), %eax235; X86-ATOM-NEXT:    pushl %eax236; X86-ATOM-NEXT:    leal {{[0-9]+}}(%esp), %eax237; X86-ATOM-NEXT:    pushl %eax238; X86-ATOM-NEXT:    pushl %edi239; X86-ATOM-NEXT:    pushl $16240; X86-ATOM-NEXT:    calll __atomic_compare_exchange@PLT241; X86-ATOM-NEXT:    leal {{[0-9]+}}(%esp), %esp242; X86-ATOM-NEXT:    movl {{[0-9]+}}(%esp), %ecx243; X86-ATOM-NEXT:    movl {{[0-9]+}}(%esp), %edx244; X86-ATOM-NEXT:    testb %al, %al245; X86-ATOM-NEXT:    movl (%esp), %esi246; X86-ATOM-NEXT:    movl {{[0-9]+}}(%esp), %ebx247; X86-ATOM-NEXT:    je .LBB4_1248; X86-ATOM-NEXT:  # %bb.2: # %atomicrmw.end249; X86-ATOM-NEXT:    movl 8(%ebp), %eax250; X86-ATOM-NEXT:    movl %esi, (%eax)251; X86-ATOM-NEXT:    movl %ebx, 4(%eax)252; X86-ATOM-NEXT:    movl %edx, 8(%eax)253; X86-ATOM-NEXT:    movl %ecx, 12(%eax)254; X86-ATOM-NEXT:    leal -12(%ebp), %esp255; X86-ATOM-NEXT:    popl %esi256; X86-ATOM-NEXT:    popl %edi257; X86-ATOM-NEXT:    popl %ebx258; X86-ATOM-NEXT:    popl %ebp259; X86-ATOM-NEXT:    retl $4260  %1 = atomicrmw or ptr %p, i128 0 monotonic261  ret i128 %1262}263 264; For 'and', the idempotent value is (-1)265define i32 @and32 (ptr %p) #0 {266; X64-LABEL: and32:267; X64:       # %bb.0:268; X64-NEXT:    lock orl $0, -{{[0-9]+}}(%rsp)269; X64-NEXT:    movl (%rdi), %eax270; X64-NEXT:    retq271;272; X86-SSE2-LABEL: and32:273; X86-SSE2:       # %bb.0:274; X86-SSE2-NEXT:    movl {{[0-9]+}}(%esp), %eax275; X86-SSE2-NEXT:    mfence276; X86-SSE2-NEXT:    movl (%eax), %eax277; X86-SSE2-NEXT:    retl278;279; X86-SLM-LABEL: and32:280; X86-SLM:       # %bb.0:281; X86-SLM-NEXT:    movl {{[0-9]+}}(%esp), %eax282; X86-SLM-NEXT:    lock orl $0, (%esp)283; X86-SLM-NEXT:    movl (%eax), %eax284; X86-SLM-NEXT:    retl285;286; X86-ATOM-LABEL: and32:287; X86-ATOM:       # %bb.0:288; X86-ATOM-NEXT:    movl {{[0-9]+}}(%esp), %eax289; X86-ATOM-NEXT:    lock orl $0, (%esp)290; X86-ATOM-NEXT:    movl (%eax), %eax291; X86-ATOM-NEXT:    nop292; X86-ATOM-NEXT:    nop293; X86-ATOM-NEXT:    retl294  %1 = atomicrmw and ptr %p, i32 -1 acq_rel295  ret i32 %1296}297 298define void @or32_nouse_monotonic(ptr %p) #0 {299; X64-LABEL: or32_nouse_monotonic:300; X64:       # %bb.0:301; X64-NEXT:    #MEMBARRIER302; X64-NEXT:    retq303;304; X86-GENERIC-LABEL: or32_nouse_monotonic:305; X86-GENERIC:       # %bb.0:306; X86-GENERIC-NEXT:    #MEMBARRIER307; X86-GENERIC-NEXT:    retl308;309; X86-ATOM-LABEL: or32_nouse_monotonic:310; X86-ATOM:       # %bb.0:311; X86-ATOM-NEXT:    #MEMBARRIER312; X86-ATOM-NEXT:    nop313; X86-ATOM-NEXT:    nop314; X86-ATOM-NEXT:    nop315; X86-ATOM-NEXT:    nop316; X86-ATOM-NEXT:    nop317; X86-ATOM-NEXT:    nop318; X86-ATOM-NEXT:    nop319; X86-ATOM-NEXT:    nop320; X86-ATOM-NEXT:    retl321  atomicrmw or ptr %p, i32 0 monotonic322  ret void323}324 325 326define void @or32_nouse_acquire(ptr %p) #0 {327; X64-LABEL: or32_nouse_acquire:328; X64:       # %bb.0:329; X64-NEXT:    #MEMBARRIER330; X64-NEXT:    retq331;332; X86-GENERIC-LABEL: or32_nouse_acquire:333; X86-GENERIC:       # %bb.0:334; X86-GENERIC-NEXT:    #MEMBARRIER335; X86-GENERIC-NEXT:    retl336;337; X86-ATOM-LABEL: or32_nouse_acquire:338; X86-ATOM:       # %bb.0:339; X86-ATOM-NEXT:    #MEMBARRIER340; X86-ATOM-NEXT:    nop341; X86-ATOM-NEXT:    nop342; X86-ATOM-NEXT:    nop343; X86-ATOM-NEXT:    nop344; X86-ATOM-NEXT:    nop345; X86-ATOM-NEXT:    nop346; X86-ATOM-NEXT:    nop347; X86-ATOM-NEXT:    nop348; X86-ATOM-NEXT:    retl349  atomicrmw or ptr %p, i32 0 acquire350  ret void351}352 353define void @or32_nouse_release(ptr %p) #0 {354; X64-LABEL: or32_nouse_release:355; X64:       # %bb.0:356; X64-NEXT:    #MEMBARRIER357; X64-NEXT:    retq358;359; X86-GENERIC-LABEL: or32_nouse_release:360; X86-GENERIC:       # %bb.0:361; X86-GENERIC-NEXT:    #MEMBARRIER362; X86-GENERIC-NEXT:    retl363;364; X86-ATOM-LABEL: or32_nouse_release:365; X86-ATOM:       # %bb.0:366; X86-ATOM-NEXT:    #MEMBARRIER367; X86-ATOM-NEXT:    nop368; X86-ATOM-NEXT:    nop369; X86-ATOM-NEXT:    nop370; X86-ATOM-NEXT:    nop371; X86-ATOM-NEXT:    nop372; X86-ATOM-NEXT:    nop373; X86-ATOM-NEXT:    nop374; X86-ATOM-NEXT:    nop375; X86-ATOM-NEXT:    retl376  atomicrmw or ptr %p, i32 0 release377  ret void378}379 380define void @or32_nouse_acq_rel(ptr %p) #0 {381; X64-LABEL: or32_nouse_acq_rel:382; X64:       # %bb.0:383; X64-NEXT:    #MEMBARRIER384; X64-NEXT:    retq385;386; X86-GENERIC-LABEL: or32_nouse_acq_rel:387; X86-GENERIC:       # %bb.0:388; X86-GENERIC-NEXT:    #MEMBARRIER389; X86-GENERIC-NEXT:    retl390;391; X86-ATOM-LABEL: or32_nouse_acq_rel:392; X86-ATOM:       # %bb.0:393; X86-ATOM-NEXT:    #MEMBARRIER394; X86-ATOM-NEXT:    nop395; X86-ATOM-NEXT:    nop396; X86-ATOM-NEXT:    nop397; X86-ATOM-NEXT:    nop398; X86-ATOM-NEXT:    nop399; X86-ATOM-NEXT:    nop400; X86-ATOM-NEXT:    nop401; X86-ATOM-NEXT:    nop402; X86-ATOM-NEXT:    retl403  atomicrmw or ptr %p, i32 0 acq_rel404  ret void405}406 407define void @or32_nouse_seq_cst(ptr %p) #0 {408; X64-LABEL: or32_nouse_seq_cst:409; X64:       # %bb.0:410; X64-NEXT:    lock orl $0, -{{[0-9]+}}(%rsp)411; X64-NEXT:    retq412;413; X86-GENERIC-LABEL: or32_nouse_seq_cst:414; X86-GENERIC:       # %bb.0:415; X86-GENERIC-NEXT:    lock orl $0, (%esp)416; X86-GENERIC-NEXT:    retl417;418; X86-ATOM-LABEL: or32_nouse_seq_cst:419; X86-ATOM:       # %bb.0:420; X86-ATOM-NEXT:    lock orl $0, (%esp)421; X86-ATOM-NEXT:    nop422; X86-ATOM-NEXT:    nop423; X86-ATOM-NEXT:    nop424; X86-ATOM-NEXT:    nop425; X86-ATOM-NEXT:    nop426; X86-ATOM-NEXT:    nop427; X86-ATOM-NEXT:    retl428  atomicrmw or ptr %p, i32 0 seq_cst429  ret void430}431 432; TODO: The value isn't used on 32 bit, so the cmpxchg8b is unneeded433define void @or64_nouse_seq_cst(ptr %p) #0 {434; X64-LABEL: or64_nouse_seq_cst:435; X64:       # %bb.0:436; X64-NEXT:    lock orl $0, -{{[0-9]+}}(%rsp)437; X64-NEXT:    retq438;439; X86-LABEL: or64_nouse_seq_cst:440; X86:       # %bb.0:441; X86-NEXT:    pushl %ebx442; X86-NEXT:    pushl %esi443; X86-NEXT:    movl {{[0-9]+}}(%esp), %esi444; X86-NEXT:    movl (%esi), %eax445; X86-NEXT:    movl 4(%esi), %edx446; X86-NEXT:    .p2align 4447; X86-NEXT:  .LBB11_1: # %atomicrmw.start448; X86-NEXT:    # =>This Inner Loop Header: Depth=1449; X86-NEXT:    movl %edx, %ecx450; X86-NEXT:    movl %eax, %ebx451; X86-NEXT:    lock cmpxchg8b (%esi)452; X86-NEXT:    jne .LBB11_1453; X86-NEXT:  # %bb.2: # %atomicrmw.end454; X86-NEXT:    popl %esi455; X86-NEXT:    popl %ebx456; X86-NEXT:    retl457  atomicrmw or ptr %p, i64 0 seq_cst458  ret void459}460 461; TODO: Don't need to lower as sync_and_fetch call462define void @or128_nouse_seq_cst(ptr %p) #0 {463; X64-LABEL: or128_nouse_seq_cst:464; X64:       # %bb.0:465; X64-NEXT:    pushq %rax466; X64-NEXT:    xorl %esi, %esi467; X64-NEXT:    xorl %edx, %edx468; X64-NEXT:    movl $5, %ecx469; X64-NEXT:    callq __atomic_fetch_or_16@PLT470; X64-NEXT:    popq %rax471; X64-NEXT:    retq472;473; X86-GENERIC-LABEL: or128_nouse_seq_cst:474; X86-GENERIC:       # %bb.0:475; X86-GENERIC-NEXT:    pushl %ebp476; X86-GENERIC-NEXT:    movl %esp, %ebp477; X86-GENERIC-NEXT:    pushl %ebx478; X86-GENERIC-NEXT:    pushl %edi479; X86-GENERIC-NEXT:    pushl %esi480; X86-GENERIC-NEXT:    andl $-16, %esp481; X86-GENERIC-NEXT:    subl $48, %esp482; X86-GENERIC-NEXT:    movl 8(%ebp), %esi483; X86-GENERIC-NEXT:    movl 12(%esi), %ecx484; X86-GENERIC-NEXT:    movl 8(%esi), %edi485; X86-GENERIC-NEXT:    movl (%esi), %edx486; X86-GENERIC-NEXT:    movl 4(%esi), %ebx487; X86-GENERIC-NEXT:    .p2align 4488; X86-GENERIC-NEXT:  .LBB12_1: # %atomicrmw.start489; X86-GENERIC-NEXT:    # =>This Inner Loop Header: Depth=1490; X86-GENERIC-NEXT:    movl %edx, (%esp)491; X86-GENERIC-NEXT:    movl %ebx, {{[0-9]+}}(%esp)492; X86-GENERIC-NEXT:    movl %edi, {{[0-9]+}}(%esp)493; X86-GENERIC-NEXT:    movl %ecx, {{[0-9]+}}(%esp)494; X86-GENERIC-NEXT:    movl %ecx, {{[0-9]+}}(%esp)495; X86-GENERIC-NEXT:    movl %edi, {{[0-9]+}}(%esp)496; X86-GENERIC-NEXT:    movl %ebx, {{[0-9]+}}(%esp)497; X86-GENERIC-NEXT:    movl %edx, {{[0-9]+}}(%esp)498; X86-GENERIC-NEXT:    pushl $5499; X86-GENERIC-NEXT:    pushl $5500; X86-GENERIC-NEXT:    leal {{[0-9]+}}(%esp), %eax501; X86-GENERIC-NEXT:    pushl %eax502; X86-GENERIC-NEXT:    leal {{[0-9]+}}(%esp), %eax503; X86-GENERIC-NEXT:    pushl %eax504; X86-GENERIC-NEXT:    pushl %esi505; X86-GENERIC-NEXT:    pushl $16506; X86-GENERIC-NEXT:    calll __atomic_compare_exchange@PLT507; X86-GENERIC-NEXT:    addl $24, %esp508; X86-GENERIC-NEXT:    movl {{[0-9]+}}(%esp), %ecx509; X86-GENERIC-NEXT:    movl {{[0-9]+}}(%esp), %edi510; X86-GENERIC-NEXT:    movl (%esp), %edx511; X86-GENERIC-NEXT:    movl {{[0-9]+}}(%esp), %ebx512; X86-GENERIC-NEXT:    testb %al, %al513; X86-GENERIC-NEXT:    je .LBB12_1514; X86-GENERIC-NEXT:  # %bb.2: # %atomicrmw.end515; X86-GENERIC-NEXT:    leal -12(%ebp), %esp516; X86-GENERIC-NEXT:    popl %esi517; X86-GENERIC-NEXT:    popl %edi518; X86-GENERIC-NEXT:    popl %ebx519; X86-GENERIC-NEXT:    popl %ebp520; X86-GENERIC-NEXT:    retl521;522; X86-ATOM-LABEL: or128_nouse_seq_cst:523; X86-ATOM:       # %bb.0:524; X86-ATOM-NEXT:    pushl %ebp525; X86-ATOM-NEXT:    movl %esp, %ebp526; X86-ATOM-NEXT:    pushl %ebx527; X86-ATOM-NEXT:    pushl %edi528; X86-ATOM-NEXT:    pushl %esi529; X86-ATOM-NEXT:    andl $-16, %esp530; X86-ATOM-NEXT:    leal -{{[0-9]+}}(%esp), %esp531; X86-ATOM-NEXT:    movl 8(%ebp), %esi532; X86-ATOM-NEXT:    movl %esp, %ebx533; X86-ATOM-NEXT:    movl 12(%esi), %ecx534; X86-ATOM-NEXT:    movl 8(%esi), %edx535; X86-ATOM-NEXT:    movl (%esi), %eax536; X86-ATOM-NEXT:    movl 4(%esi), %edi537; X86-ATOM-NEXT:    .p2align 4538; X86-ATOM-NEXT:  .LBB12_1: # %atomicrmw.start539; X86-ATOM-NEXT:    # =>This Inner Loop Header: Depth=1540; X86-ATOM-NEXT:    movl %eax, (%esp)541; X86-ATOM-NEXT:    movl %edi, {{[0-9]+}}(%esp)542; X86-ATOM-NEXT:    movl %edx, {{[0-9]+}}(%esp)543; X86-ATOM-NEXT:    movl %ecx, {{[0-9]+}}(%esp)544; X86-ATOM-NEXT:    movl %ecx, {{[0-9]+}}(%esp)545; X86-ATOM-NEXT:    movl %edx, {{[0-9]+}}(%esp)546; X86-ATOM-NEXT:    movl %edi, {{[0-9]+}}(%esp)547; X86-ATOM-NEXT:    movl %eax, {{[0-9]+}}(%esp)548; X86-ATOM-NEXT:    pushl $5549; X86-ATOM-NEXT:    pushl $5550; X86-ATOM-NEXT:    leal {{[0-9]+}}(%esp), %eax551; X86-ATOM-NEXT:    pushl %eax552; X86-ATOM-NEXT:    pushl %ebx553; X86-ATOM-NEXT:    pushl %esi554; X86-ATOM-NEXT:    pushl $16555; X86-ATOM-NEXT:    calll __atomic_compare_exchange@PLT556; X86-ATOM-NEXT:    leal {{[0-9]+}}(%esp), %esp557; X86-ATOM-NEXT:    testb %al, %al558; X86-ATOM-NEXT:    movl {{[0-9]+}}(%esp), %ecx559; X86-ATOM-NEXT:    movl {{[0-9]+}}(%esp), %edx560; X86-ATOM-NEXT:    movl (%esp), %eax561; X86-ATOM-NEXT:    movl {{[0-9]+}}(%esp), %edi562; X86-ATOM-NEXT:    je .LBB12_1563; X86-ATOM-NEXT:  # %bb.2: # %atomicrmw.end564; X86-ATOM-NEXT:    leal -12(%ebp), %esp565; X86-ATOM-NEXT:    popl %esi566; X86-ATOM-NEXT:    popl %edi567; X86-ATOM-NEXT:    popl %ebx568; X86-ATOM-NEXT:    popl %ebp569; X86-ATOM-NEXT:    retl570  atomicrmw or ptr %p, i128 0 seq_cst571  ret void572}573 574 575define void @or16_nouse_seq_cst(ptr %p) #0 {576; X64-LABEL: or16_nouse_seq_cst:577; X64:       # %bb.0:578; X64-NEXT:    lock orl $0, -{{[0-9]+}}(%rsp)579; X64-NEXT:    retq580;581; X86-GENERIC-LABEL: or16_nouse_seq_cst:582; X86-GENERIC:       # %bb.0:583; X86-GENERIC-NEXT:    lock orl $0, (%esp)584; X86-GENERIC-NEXT:    retl585;586; X86-ATOM-LABEL: or16_nouse_seq_cst:587; X86-ATOM:       # %bb.0:588; X86-ATOM-NEXT:    lock orl $0, (%esp)589; X86-ATOM-NEXT:    nop590; X86-ATOM-NEXT:    nop591; X86-ATOM-NEXT:    nop592; X86-ATOM-NEXT:    nop593; X86-ATOM-NEXT:    nop594; X86-ATOM-NEXT:    nop595; X86-ATOM-NEXT:    retl596  atomicrmw or ptr %p, i16 0 seq_cst597  ret void598}599 600define void @or8_nouse_seq_cst(ptr %p) #0 {601; X64-LABEL: or8_nouse_seq_cst:602; X64:       # %bb.0:603; X64-NEXT:    lock orl $0, -{{[0-9]+}}(%rsp)604; X64-NEXT:    retq605;606; X86-GENERIC-LABEL: or8_nouse_seq_cst:607; X86-GENERIC:       # %bb.0:608; X86-GENERIC-NEXT:    lock orl $0, (%esp)609; X86-GENERIC-NEXT:    retl610;611; X86-ATOM-LABEL: or8_nouse_seq_cst:612; X86-ATOM:       # %bb.0:613; X86-ATOM-NEXT:    lock orl $0, (%esp)614; X86-ATOM-NEXT:    nop615; X86-ATOM-NEXT:    nop616; X86-ATOM-NEXT:    nop617; X86-ATOM-NEXT:    nop618; X86-ATOM-NEXT:    nop619; X86-ATOM-NEXT:    nop620; X86-ATOM-NEXT:    retl621  atomicrmw or ptr %p, i8 0 seq_cst622  ret void623}624 625define void @atomic_umin_uint_max(ptr %addr) #0 {626; X64-LABEL: atomic_umin_uint_max:627; X64:       # %bb.0:628; X64-NEXT:    lock orl $0, -{{[0-9]+}}(%rsp)629; X64-NEXT:    movl (%rdi), %eax630; X64-NEXT:    retq631;632; X86-SSE2-LABEL: atomic_umin_uint_max:633; X86-SSE2:       # %bb.0:634; X86-SSE2-NEXT:    movl {{[0-9]+}}(%esp), %eax635; X86-SSE2-NEXT:    mfence636; X86-SSE2-NEXT:    movl (%eax), %eax637; X86-SSE2-NEXT:    retl638;639; X86-SLM-LABEL: atomic_umin_uint_max:640; X86-SLM:       # %bb.0:641; X86-SLM-NEXT:    movl {{[0-9]+}}(%esp), %eax642; X86-SLM-NEXT:    lock orl $0, (%esp)643; X86-SLM-NEXT:    movl (%eax), %eax644; X86-SLM-NEXT:    retl645;646; X86-ATOM-LABEL: atomic_umin_uint_max:647; X86-ATOM:       # %bb.0:648; X86-ATOM-NEXT:    movl {{[0-9]+}}(%esp), %eax649; X86-ATOM-NEXT:    lock orl $0, (%esp)650; X86-ATOM-NEXT:    movl (%eax), %eax651; X86-ATOM-NEXT:    nop652; X86-ATOM-NEXT:    nop653; X86-ATOM-NEXT:    retl654  atomicrmw umin ptr %addr, i32 -1 seq_cst655  ret void656}657 658define void @atomic_umax_zero(ptr %addr) #0 {659; X64-LABEL: atomic_umax_zero:660; X64:       # %bb.0:661; X64-NEXT:    lock orl $0, -{{[0-9]+}}(%rsp)662; X64-NEXT:    movl (%rdi), %eax663; X64-NEXT:    retq664;665; X86-SSE2-LABEL: atomic_umax_zero:666; X86-SSE2:       # %bb.0:667; X86-SSE2-NEXT:    movl {{[0-9]+}}(%esp), %eax668; X86-SSE2-NEXT:    mfence669; X86-SSE2-NEXT:    movl (%eax), %eax670; X86-SSE2-NEXT:    retl671;672; X86-SLM-LABEL: atomic_umax_zero:673; X86-SLM:       # %bb.0:674; X86-SLM-NEXT:    movl {{[0-9]+}}(%esp), %eax675; X86-SLM-NEXT:    lock orl $0, (%esp)676; X86-SLM-NEXT:    movl (%eax), %eax677; X86-SLM-NEXT:    retl678;679; X86-ATOM-LABEL: atomic_umax_zero:680; X86-ATOM:       # %bb.0:681; X86-ATOM-NEXT:    movl {{[0-9]+}}(%esp), %eax682; X86-ATOM-NEXT:    lock orl $0, (%esp)683; X86-ATOM-NEXT:    movl (%eax), %eax684; X86-ATOM-NEXT:    nop685; X86-ATOM-NEXT:    nop686; X86-ATOM-NEXT:    retl687  atomicrmw umax ptr %addr, i32 0 seq_cst688  ret void689}690 691define void @atomic_min_smax_char(ptr %addr) #0 {692; X64-LABEL: atomic_min_smax_char:693; X64:       # %bb.0:694; X64-NEXT:    lock orl $0, -{{[0-9]+}}(%rsp)695; X64-NEXT:    movzbl (%rdi), %eax696; X64-NEXT:    retq697;698; X86-SSE2-LABEL: atomic_min_smax_char:699; X86-SSE2:       # %bb.0:700; X86-SSE2-NEXT:    movl {{[0-9]+}}(%esp), %eax701; X86-SSE2-NEXT:    mfence702; X86-SSE2-NEXT:    movzbl (%eax), %eax703; X86-SSE2-NEXT:    retl704;705; X86-SLM-LABEL: atomic_min_smax_char:706; X86-SLM:       # %bb.0:707; X86-SLM-NEXT:    movl {{[0-9]+}}(%esp), %eax708; X86-SLM-NEXT:    lock orl $0, (%esp)709; X86-SLM-NEXT:    movzbl (%eax), %eax710; X86-SLM-NEXT:    retl711;712; X86-ATOM-LABEL: atomic_min_smax_char:713; X86-ATOM:       # %bb.0:714; X86-ATOM-NEXT:    movl {{[0-9]+}}(%esp), %eax715; X86-ATOM-NEXT:    lock orl $0, (%esp)716; X86-ATOM-NEXT:    movzbl (%eax), %eax717; X86-ATOM-NEXT:    nop718; X86-ATOM-NEXT:    nop719; X86-ATOM-NEXT:    retl720  atomicrmw min ptr %addr, i8 127 seq_cst721  ret void722}723 724define void @atomic_max_smin_char(ptr %addr) #0 {725; X64-LABEL: atomic_max_smin_char:726; X64:       # %bb.0:727; X64-NEXT:    lock orl $0, -{{[0-9]+}}(%rsp)728; X64-NEXT:    movzbl (%rdi), %eax729; X64-NEXT:    retq730;731; X86-SSE2-LABEL: atomic_max_smin_char:732; X86-SSE2:       # %bb.0:733; X86-SSE2-NEXT:    movl {{[0-9]+}}(%esp), %eax734; X86-SSE2-NEXT:    mfence735; X86-SSE2-NEXT:    movzbl (%eax), %eax736; X86-SSE2-NEXT:    retl737;738; X86-SLM-LABEL: atomic_max_smin_char:739; X86-SLM:       # %bb.0:740; X86-SLM-NEXT:    movl {{[0-9]+}}(%esp), %eax741; X86-SLM-NEXT:    lock orl $0, (%esp)742; X86-SLM-NEXT:    movzbl (%eax), %eax743; X86-SLM-NEXT:    retl744;745; X86-ATOM-LABEL: atomic_max_smin_char:746; X86-ATOM:       # %bb.0:747; X86-ATOM-NEXT:    movl {{[0-9]+}}(%esp), %eax748; X86-ATOM-NEXT:    lock orl $0, (%esp)749; X86-ATOM-NEXT:    movzbl (%eax), %eax750; X86-ATOM-NEXT:    nop751; X86-ATOM-NEXT:    nop752; X86-ATOM-NEXT:    retl753  atomicrmw max ptr %addr, i8 -128 seq_cst754  ret void755}756 757define void @atomic_min_umax_char(ptr %addr) #0 {758; X64-LABEL: atomic_min_umax_char:759; X64:       # %bb.0:760; X64-NEXT:    lock orl $0, -{{[0-9]+}}(%rsp)761; X64-NEXT:    movzbl (%rdi), %eax762; X64-NEXT:    retq763;764; X86-SSE2-LABEL: atomic_min_umax_char:765; X86-SSE2:       # %bb.0:766; X86-SSE2-NEXT:    movl {{[0-9]+}}(%esp), %eax767; X86-SSE2-NEXT:    mfence768; X86-SSE2-NEXT:    movzbl (%eax), %eax769; X86-SSE2-NEXT:    retl770;771; X86-SLM-LABEL: atomic_min_umax_char:772; X86-SLM:       # %bb.0:773; X86-SLM-NEXT:    movl {{[0-9]+}}(%esp), %eax774; X86-SLM-NEXT:    lock orl $0, (%esp)775; X86-SLM-NEXT:    movzbl (%eax), %eax776; X86-SLM-NEXT:    retl777;778; X86-ATOM-LABEL: atomic_min_umax_char:779; X86-ATOM:       # %bb.0:780; X86-ATOM-NEXT:    movl {{[0-9]+}}(%esp), %eax781; X86-ATOM-NEXT:    lock orl $0, (%esp)782; X86-ATOM-NEXT:    movzbl (%eax), %eax783; X86-ATOM-NEXT:    nop784; X86-ATOM-NEXT:    nop785; X86-ATOM-NEXT:    retl786  atomicrmw umin ptr %addr, i8 255 seq_cst787  ret void788}789 790define void @atomic_max_umin_char(ptr %addr) #0 {791; X64-LABEL: atomic_max_umin_char:792; X64:       # %bb.0:793; X64-NEXT:    lock orl $0, -{{[0-9]+}}(%rsp)794; X64-NEXT:    movzbl (%rdi), %eax795; X64-NEXT:    retq796;797; X86-SSE2-LABEL: atomic_max_umin_char:798; X86-SSE2:       # %bb.0:799; X86-SSE2-NEXT:    movl {{[0-9]+}}(%esp), %eax800; X86-SSE2-NEXT:    mfence801; X86-SSE2-NEXT:    movzbl (%eax), %eax802; X86-SSE2-NEXT:    retl803;804; X86-SLM-LABEL: atomic_max_umin_char:805; X86-SLM:       # %bb.0:806; X86-SLM-NEXT:    movl {{[0-9]+}}(%esp), %eax807; X86-SLM-NEXT:    lock orl $0, (%esp)808; X86-SLM-NEXT:    movzbl (%eax), %eax809; X86-SLM-NEXT:    retl810;811; X86-ATOM-LABEL: atomic_max_umin_char:812; X86-ATOM:       # %bb.0:813; X86-ATOM-NEXT:    movl {{[0-9]+}}(%esp), %eax814; X86-ATOM-NEXT:    lock orl $0, (%esp)815; X86-ATOM-NEXT:    movzbl (%eax), %eax816; X86-ATOM-NEXT:    nop817; X86-ATOM-NEXT:    nop818; X86-ATOM-NEXT:    retl819  atomicrmw umax ptr %addr, i8 0 seq_cst820  ret void821}822 823; TODO: Add floating point support.824define void @atomic_fadd_zero(ptr %addr) #0 {825; X64-LABEL: atomic_fadd_zero:826; X64:       # %bb.0:827; X64-NEXT:    movl (%rdi), %eax828; X64-NEXT:    .p2align 4829; X64-NEXT:  .LBB21_1: # %atomicrmw.start830; X64-NEXT:    # =>This Inner Loop Header: Depth=1831; X64-NEXT:    lock cmpxchgl %eax, (%rdi)832; X64-NEXT:    jne .LBB21_1833; X64-NEXT:  # %bb.2: # %atomicrmw.end834; X64-NEXT:    retq835;836; X86-SSE2-LABEL: atomic_fadd_zero:837; X86-SSE2:       # %bb.0:838; X86-SSE2-NEXT:    movl {{[0-9]+}}(%esp), %ecx839; X86-SSE2-NEXT:    movd {{.*#+}} xmm0 = mem[0],zero,zero,zero840; X86-SSE2-NEXT:    .p2align 4841; X86-SSE2-NEXT:  .LBB21_1: # %atomicrmw.start842; X86-SSE2-NEXT:    # =>This Inner Loop Header: Depth=1843; X86-SSE2-NEXT:    movd %xmm0, %eax844; X86-SSE2-NEXT:    lock cmpxchgl %eax, (%ecx)845; X86-SSE2-NEXT:    movd %eax, %xmm0846; X86-SSE2-NEXT:    jne .LBB21_1847; X86-SSE2-NEXT:  # %bb.2: # %atomicrmw.end848; X86-SSE2-NEXT:    retl849;850; X86-SLM-LABEL: atomic_fadd_zero:851; X86-SLM:       # %bb.0:852; X86-SLM-NEXT:    subl $8, %esp853; X86-SLM-NEXT:    movl {{[0-9]+}}(%esp), %ecx854; X86-SLM-NEXT:    movss {{.*#+}} xmm0 = mem[0],zero,zero,zero855; X86-SLM-NEXT:    .p2align 4856; X86-SLM-NEXT:  .LBB21_1: # %atomicrmw.start857; X86-SLM-NEXT:    # =>This Inner Loop Header: Depth=1858; X86-SLM-NEXT:    movss %xmm0, (%esp)859; X86-SLM-NEXT:    movl (%esp), %eax860; X86-SLM-NEXT:    lock cmpxchgl %eax, (%ecx)861; X86-SLM-NEXT:    movl %eax, {{[0-9]+}}(%esp)862; X86-SLM-NEXT:    movss {{.*#+}} xmm0 = mem[0],zero,zero,zero863; X86-SLM-NEXT:    jne .LBB21_1864; X86-SLM-NEXT:  # %bb.2: # %atomicrmw.end865; X86-SLM-NEXT:    addl $8, %esp866; X86-SLM-NEXT:    retl867;868; X86-ATOM-LABEL: atomic_fadd_zero:869; X86-ATOM:       # %bb.0:870; X86-ATOM-NEXT:    leal -{{[0-9]+}}(%esp), %esp871; X86-ATOM-NEXT:    movl {{[0-9]+}}(%esp), %ecx872; X86-ATOM-NEXT:    movss {{.*#+}} xmm0 = mem[0],zero,zero,zero873; X86-ATOM-NEXT:    .p2align 4874; X86-ATOM-NEXT:  .LBB21_1: # %atomicrmw.start875; X86-ATOM-NEXT:    # =>This Inner Loop Header: Depth=1876; X86-ATOM-NEXT:    movss %xmm0, (%esp)877; X86-ATOM-NEXT:    movl (%esp), %eax878; X86-ATOM-NEXT:    lock cmpxchgl %eax, (%ecx)879; X86-ATOM-NEXT:    movl %eax, {{[0-9]+}}(%esp)880; X86-ATOM-NEXT:    movss {{.*#+}} xmm0 = mem[0],zero,zero,zero881; X86-ATOM-NEXT:    jne .LBB21_1882; X86-ATOM-NEXT:  # %bb.2: # %atomicrmw.end883; X86-ATOM-NEXT:    leal {{[0-9]+}}(%esp), %esp884; X86-ATOM-NEXT:    retl885  atomicrmw fadd ptr %addr, float -0.0 monotonic886  ret void887}888 889define void @atomic_fsub_zero(ptr %addr) #0 {890; X64-LABEL: atomic_fsub_zero:891; X64:       # %bb.0:892; X64-NEXT:    movl (%rdi), %eax893; X64-NEXT:    .p2align 4894; X64-NEXT:  .LBB22_1: # %atomicrmw.start895; X64-NEXT:    # =>This Inner Loop Header: Depth=1896; X64-NEXT:    lock cmpxchgl %eax, (%rdi)897; X64-NEXT:    jne .LBB22_1898; X64-NEXT:  # %bb.2: # %atomicrmw.end899; X64-NEXT:    retq900;901; X86-SSE2-LABEL: atomic_fsub_zero:902; X86-SSE2:       # %bb.0:903; X86-SSE2-NEXT:    movl {{[0-9]+}}(%esp), %ecx904; X86-SSE2-NEXT:    movd {{.*#+}} xmm0 = mem[0],zero,zero,zero905; X86-SSE2-NEXT:    .p2align 4906; X86-SSE2-NEXT:  .LBB22_1: # %atomicrmw.start907; X86-SSE2-NEXT:    # =>This Inner Loop Header: Depth=1908; X86-SSE2-NEXT:    movd %xmm0, %eax909; X86-SSE2-NEXT:    lock cmpxchgl %eax, (%ecx)910; X86-SSE2-NEXT:    movd %eax, %xmm0911; X86-SSE2-NEXT:    jne .LBB22_1912; X86-SSE2-NEXT:  # %bb.2: # %atomicrmw.end913; X86-SSE2-NEXT:    retl914;915; X86-SLM-LABEL: atomic_fsub_zero:916; X86-SLM:       # %bb.0:917; X86-SLM-NEXT:    subl $8, %esp918; X86-SLM-NEXT:    movl {{[0-9]+}}(%esp), %ecx919; X86-SLM-NEXT:    movss {{.*#+}} xmm0 = mem[0],zero,zero,zero920; X86-SLM-NEXT:    .p2align 4921; X86-SLM-NEXT:  .LBB22_1: # %atomicrmw.start922; X86-SLM-NEXT:    # =>This Inner Loop Header: Depth=1923; X86-SLM-NEXT:    movss %xmm0, (%esp)924; X86-SLM-NEXT:    movl (%esp), %eax925; X86-SLM-NEXT:    lock cmpxchgl %eax, (%ecx)926; X86-SLM-NEXT:    movl %eax, {{[0-9]+}}(%esp)927; X86-SLM-NEXT:    movss {{.*#+}} xmm0 = mem[0],zero,zero,zero928; X86-SLM-NEXT:    jne .LBB22_1929; X86-SLM-NEXT:  # %bb.2: # %atomicrmw.end930; X86-SLM-NEXT:    addl $8, %esp931; X86-SLM-NEXT:    retl932;933; X86-ATOM-LABEL: atomic_fsub_zero:934; X86-ATOM:       # %bb.0:935; X86-ATOM-NEXT:    leal -{{[0-9]+}}(%esp), %esp936; X86-ATOM-NEXT:    movl {{[0-9]+}}(%esp), %ecx937; X86-ATOM-NEXT:    movss {{.*#+}} xmm0 = mem[0],zero,zero,zero938; X86-ATOM-NEXT:    .p2align 4939; X86-ATOM-NEXT:  .LBB22_1: # %atomicrmw.start940; X86-ATOM-NEXT:    # =>This Inner Loop Header: Depth=1941; X86-ATOM-NEXT:    movss %xmm0, (%esp)942; X86-ATOM-NEXT:    movl (%esp), %eax943; X86-ATOM-NEXT:    lock cmpxchgl %eax, (%ecx)944; X86-ATOM-NEXT:    movl %eax, {{[0-9]+}}(%esp)945; X86-ATOM-NEXT:    movss {{.*#+}} xmm0 = mem[0],zero,zero,zero946; X86-ATOM-NEXT:    jne .LBB22_1947; X86-ATOM-NEXT:  # %bb.2: # %atomicrmw.end948; X86-ATOM-NEXT:    leal {{[0-9]+}}(%esp), %esp949; X86-ATOM-NEXT:    retl950  atomicrmw fsub ptr %addr, float 0.0 release951  ret void952}953 954attributes #0 = { nounwind }955