File: atomicrmw-fmin.ll

package info (click to toggle)
llvm-toolchain-20 1%3A20.1.6-1~exp1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 2,111,304 kB
  • sloc: cpp: 7,438,677; ansic: 1,393,822; asm: 1,012,926; python: 241,650; f90: 86,635; objc: 75,479; lisp: 42,144; pascal: 17,286; sh: 10,027; ml: 5,082; perl: 4,730; awk: 3,523; makefile: 3,349; javascript: 2,251; xml: 892; fortran: 672
file content (964 lines) | stat: -rw-r--r-- 39,154 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5
; RUN: llc -mtriple=aarch64-linux-gnu -O1 -fast-isel=0 -global-isel=false %s -o - | FileCheck -check-prefix=NOLSE %s
; RUN: llc -mtriple=aarch64-linux-gnu -mattr=+lse -O1 -fast-isel=0 -global-isel=false %s -o - | FileCheck -check-prefix=LSE %s
; RUN: llc -mtriple=aarch64-linux-gnu -mattr=-lse,-fp-armv8 -O1 < %s | FileCheck -check-prefix=SOFTFP-NOLSE %s

; FIXME: Restore test of fp128 case

define half @test_atomicrmw_fmin_f16_seq_cst_align2(ptr %ptr, half %value) #0 {
; NOLSE-LABEL: test_atomicrmw_fmin_f16_seq_cst_align2:
; NOLSE:       // %bb.0:
; NOLSE-NEXT:    fcvt s1, h0
; NOLSE-NEXT:  .LBB0_1: // %atomicrmw.start
; NOLSE-NEXT:    // =>This Inner Loop Header: Depth=1
; NOLSE-NEXT:    ldaxrh w8, [x0]
; NOLSE-NEXT:    fmov s0, w8
; NOLSE-NEXT:    fcvt s2, h0
; NOLSE-NEXT:    fminnm s2, s2, s1
; NOLSE-NEXT:    fcvt h2, s2
; NOLSE-NEXT:    fmov w8, s2
; NOLSE-NEXT:    stlxrh w9, w8, [x0]
; NOLSE-NEXT:    cbnz w9, .LBB0_1
; NOLSE-NEXT:  // %bb.2: // %atomicrmw.end
; NOLSE-NEXT:    // kill: def $h0 killed $h0 killed $s0
; NOLSE-NEXT:    ret
;
; LSE-LABEL: test_atomicrmw_fmin_f16_seq_cst_align2:
; LSE:       // %bb.0:
; LSE-NEXT:    fcvt s1, h0
; LSE-NEXT:    ldr h0, [x0]
; LSE-NEXT:  .LBB0_1: // %atomicrmw.start
; LSE-NEXT:    // =>This Inner Loop Header: Depth=1
; LSE-NEXT:    fcvt s2, h0
; LSE-NEXT:    fmov w8, s0
; LSE-NEXT:    mov w10, w8
; LSE-NEXT:    fminnm s2, s2, s1
; LSE-NEXT:    fcvt h2, s2
; LSE-NEXT:    fmov w9, s2
; LSE-NEXT:    casalh w10, w9, [x0]
; LSE-NEXT:    fmov s0, w10
; LSE-NEXT:    cmp w10, w8, uxth
; LSE-NEXT:    b.ne .LBB0_1
; LSE-NEXT:  // %bb.2: // %atomicrmw.end
; LSE-NEXT:    // kill: def $h0 killed $h0 killed $s0
; LSE-NEXT:    ret
;
; SOFTFP-NOLSE-LABEL: test_atomicrmw_fmin_f16_seq_cst_align2:
; SOFTFP-NOLSE:       // %bb.0:
; SOFTFP-NOLSE-NEXT:    str x30, [sp, #-48]! // 8-byte Folded Spill
; SOFTFP-NOLSE-NEXT:    stp x20, x19, [sp, #32] // 16-byte Folded Spill
; SOFTFP-NOLSE-NEXT:    mov x19, x0
; SOFTFP-NOLSE-NEXT:    ldrh w0, [x0]
; SOFTFP-NOLSE-NEXT:    mov w20, w1
; SOFTFP-NOLSE-NEXT:    stp x22, x21, [sp, #16] // 16-byte Folded Spill
; SOFTFP-NOLSE-NEXT:    b .LBB0_2
; SOFTFP-NOLSE-NEXT:  .LBB0_1: // %cmpxchg.nostore
; SOFTFP-NOLSE-NEXT:    // in Loop: Header=BB0_2 Depth=1
; SOFTFP-NOLSE-NEXT:    mov w8, wzr
; SOFTFP-NOLSE-NEXT:    clrex
; SOFTFP-NOLSE-NEXT:    cbnz w8, .LBB0_6
; SOFTFP-NOLSE-NEXT:  .LBB0_2: // %atomicrmw.start
; SOFTFP-NOLSE-NEXT:    // =>This Loop Header: Depth=1
; SOFTFP-NOLSE-NEXT:    // Child Loop BB0_3 Depth 2
; SOFTFP-NOLSE-NEXT:    mov w22, w0
; SOFTFP-NOLSE-NEXT:    and w0, w20, #0xffff
; SOFTFP-NOLSE-NEXT:    bl __gnu_h2f_ieee
; SOFTFP-NOLSE-NEXT:    mov w21, w0
; SOFTFP-NOLSE-NEXT:    and w0, w22, #0xffff
; SOFTFP-NOLSE-NEXT:    bl __gnu_h2f_ieee
; SOFTFP-NOLSE-NEXT:    mov w1, w21
; SOFTFP-NOLSE-NEXT:    bl fminf
; SOFTFP-NOLSE-NEXT:    bl __gnu_f2h_ieee
; SOFTFP-NOLSE-NEXT:    mov w8, w0
; SOFTFP-NOLSE-NEXT:  .LBB0_3: // %cmpxchg.start
; SOFTFP-NOLSE-NEXT:    // Parent Loop BB0_2 Depth=1
; SOFTFP-NOLSE-NEXT:    // => This Inner Loop Header: Depth=2
; SOFTFP-NOLSE-NEXT:    ldaxrh w0, [x19]
; SOFTFP-NOLSE-NEXT:    cmp w0, w22, uxth
; SOFTFP-NOLSE-NEXT:    b.ne .LBB0_1
; SOFTFP-NOLSE-NEXT:  // %bb.4: // %cmpxchg.trystore
; SOFTFP-NOLSE-NEXT:    // in Loop: Header=BB0_3 Depth=2
; SOFTFP-NOLSE-NEXT:    stlxrh w9, w8, [x19]
; SOFTFP-NOLSE-NEXT:    cbnz w9, .LBB0_3
; SOFTFP-NOLSE-NEXT:  // %bb.5: // in Loop: Header=BB0_2 Depth=1
; SOFTFP-NOLSE-NEXT:    mov w8, #1 // =0x1
; SOFTFP-NOLSE-NEXT:    cbz w8, .LBB0_2
; SOFTFP-NOLSE-NEXT:  .LBB0_6: // %atomicrmw.end
; SOFTFP-NOLSE-NEXT:    ldp x20, x19, [sp, #32] // 16-byte Folded Reload
; SOFTFP-NOLSE-NEXT:    // kill: def $w0 killed $w0 killed $x0
; SOFTFP-NOLSE-NEXT:    ldp x22, x21, [sp, #16] // 16-byte Folded Reload
; SOFTFP-NOLSE-NEXT:    ldr x30, [sp], #48 // 8-byte Folded Reload
; SOFTFP-NOLSE-NEXT:    ret
  %res = atomicrmw fmin ptr %ptr, half %value seq_cst, align 2
  ret half %res
}

define half @test_atomicrmw_fmin_f16_seq_cst_align4(ptr %ptr, half %value) #0 {
; NOLSE-LABEL: test_atomicrmw_fmin_f16_seq_cst_align4:
; NOLSE:       // %bb.0:
; NOLSE-NEXT:    fcvt s1, h0
; NOLSE-NEXT:  .LBB1_1: // %atomicrmw.start
; NOLSE-NEXT:    // =>This Inner Loop Header: Depth=1
; NOLSE-NEXT:    ldaxrh w8, [x0]
; NOLSE-NEXT:    fmov s0, w8
; NOLSE-NEXT:    fcvt s2, h0
; NOLSE-NEXT:    fminnm s2, s2, s1
; NOLSE-NEXT:    fcvt h2, s2
; NOLSE-NEXT:    fmov w8, s2
; NOLSE-NEXT:    stlxrh w9, w8, [x0]
; NOLSE-NEXT:    cbnz w9, .LBB1_1
; NOLSE-NEXT:  // %bb.2: // %atomicrmw.end
; NOLSE-NEXT:    // kill: def $h0 killed $h0 killed $s0
; NOLSE-NEXT:    ret
;
; LSE-LABEL: test_atomicrmw_fmin_f16_seq_cst_align4:
; LSE:       // %bb.0:
; LSE-NEXT:    fcvt s1, h0
; LSE-NEXT:    ldr h0, [x0]
; LSE-NEXT:  .LBB1_1: // %atomicrmw.start
; LSE-NEXT:    // =>This Inner Loop Header: Depth=1
; LSE-NEXT:    fcvt s2, h0
; LSE-NEXT:    fmov w8, s0
; LSE-NEXT:    mov w10, w8
; LSE-NEXT:    fminnm s2, s2, s1
; LSE-NEXT:    fcvt h2, s2
; LSE-NEXT:    fmov w9, s2
; LSE-NEXT:    casalh w10, w9, [x0]
; LSE-NEXT:    fmov s0, w10
; LSE-NEXT:    cmp w10, w8, uxth
; LSE-NEXT:    b.ne .LBB1_1
; LSE-NEXT:  // %bb.2: // %atomicrmw.end
; LSE-NEXT:    // kill: def $h0 killed $h0 killed $s0
; LSE-NEXT:    ret
;
; SOFTFP-NOLSE-LABEL: test_atomicrmw_fmin_f16_seq_cst_align4:
; SOFTFP-NOLSE:       // %bb.0:
; SOFTFP-NOLSE-NEXT:    str x30, [sp, #-48]! // 8-byte Folded Spill
; SOFTFP-NOLSE-NEXT:    stp x20, x19, [sp, #32] // 16-byte Folded Spill
; SOFTFP-NOLSE-NEXT:    mov x19, x0
; SOFTFP-NOLSE-NEXT:    ldrh w0, [x0]
; SOFTFP-NOLSE-NEXT:    mov w20, w1
; SOFTFP-NOLSE-NEXT:    stp x22, x21, [sp, #16] // 16-byte Folded Spill
; SOFTFP-NOLSE-NEXT:    b .LBB1_2
; SOFTFP-NOLSE-NEXT:  .LBB1_1: // %cmpxchg.nostore
; SOFTFP-NOLSE-NEXT:    // in Loop: Header=BB1_2 Depth=1
; SOFTFP-NOLSE-NEXT:    mov w8, wzr
; SOFTFP-NOLSE-NEXT:    clrex
; SOFTFP-NOLSE-NEXT:    cbnz w8, .LBB1_6
; SOFTFP-NOLSE-NEXT:  .LBB1_2: // %atomicrmw.start
; SOFTFP-NOLSE-NEXT:    // =>This Loop Header: Depth=1
; SOFTFP-NOLSE-NEXT:    // Child Loop BB1_3 Depth 2
; SOFTFP-NOLSE-NEXT:    mov w22, w0
; SOFTFP-NOLSE-NEXT:    and w0, w20, #0xffff
; SOFTFP-NOLSE-NEXT:    bl __gnu_h2f_ieee
; SOFTFP-NOLSE-NEXT:    mov w21, w0
; SOFTFP-NOLSE-NEXT:    and w0, w22, #0xffff
; SOFTFP-NOLSE-NEXT:    bl __gnu_h2f_ieee
; SOFTFP-NOLSE-NEXT:    mov w1, w21
; SOFTFP-NOLSE-NEXT:    bl fminf
; SOFTFP-NOLSE-NEXT:    bl __gnu_f2h_ieee
; SOFTFP-NOLSE-NEXT:    mov w8, w0
; SOFTFP-NOLSE-NEXT:  .LBB1_3: // %cmpxchg.start
; SOFTFP-NOLSE-NEXT:    // Parent Loop BB1_2 Depth=1
; SOFTFP-NOLSE-NEXT:    // => This Inner Loop Header: Depth=2
; SOFTFP-NOLSE-NEXT:    ldaxrh w0, [x19]
; SOFTFP-NOLSE-NEXT:    cmp w0, w22, uxth
; SOFTFP-NOLSE-NEXT:    b.ne .LBB1_1
; SOFTFP-NOLSE-NEXT:  // %bb.4: // %cmpxchg.trystore
; SOFTFP-NOLSE-NEXT:    // in Loop: Header=BB1_3 Depth=2
; SOFTFP-NOLSE-NEXT:    stlxrh w9, w8, [x19]
; SOFTFP-NOLSE-NEXT:    cbnz w9, .LBB1_3
; SOFTFP-NOLSE-NEXT:  // %bb.5: // in Loop: Header=BB1_2 Depth=1
; SOFTFP-NOLSE-NEXT:    mov w8, #1 // =0x1
; SOFTFP-NOLSE-NEXT:    cbz w8, .LBB1_2
; SOFTFP-NOLSE-NEXT:  .LBB1_6: // %atomicrmw.end
; SOFTFP-NOLSE-NEXT:    ldp x20, x19, [sp, #32] // 16-byte Folded Reload
; SOFTFP-NOLSE-NEXT:    // kill: def $w0 killed $w0 killed $x0
; SOFTFP-NOLSE-NEXT:    ldp x22, x21, [sp, #16] // 16-byte Folded Reload
; SOFTFP-NOLSE-NEXT:    ldr x30, [sp], #48 // 8-byte Folded Reload
; SOFTFP-NOLSE-NEXT:    ret
  %res = atomicrmw fmin ptr %ptr, half %value seq_cst, align 4
  ret half %res
}

define bfloat @test_atomicrmw_fmin_bf16_seq_cst_align2(ptr %ptr, bfloat %value) #0 {
; NOLSE-LABEL: test_atomicrmw_fmin_bf16_seq_cst_align2:
; NOLSE:       // %bb.0:
; NOLSE-NEXT:    // kill: def $h0 killed $h0 def $d0
; NOLSE-NEXT:    shll v1.4s, v0.4h, #16
; NOLSE-NEXT:    mov w8, #32767 // =0x7fff
; NOLSE-NEXT:  .LBB2_1: // %atomicrmw.start
; NOLSE-NEXT:    // =>This Inner Loop Header: Depth=1
; NOLSE-NEXT:    ldaxrh w9, [x0]
; NOLSE-NEXT:    fmov s0, w9
; NOLSE-NEXT:    shll v2.4s, v0.4h, #16
; NOLSE-NEXT:    fminnm s2, s2, s1
; NOLSE-NEXT:    fmov w9, s2
; NOLSE-NEXT:    ubfx w10, w9, #16, #1
; NOLSE-NEXT:    add w9, w9, w8
; NOLSE-NEXT:    add w9, w10, w9
; NOLSE-NEXT:    lsr w9, w9, #16
; NOLSE-NEXT:    stlxrh w10, w9, [x0]
; NOLSE-NEXT:    cbnz w10, .LBB2_1
; NOLSE-NEXT:  // %bb.2: // %atomicrmw.end
; NOLSE-NEXT:    // kill: def $h0 killed $h0 killed $d0
; NOLSE-NEXT:    ret
;
; LSE-LABEL: test_atomicrmw_fmin_bf16_seq_cst_align2:
; LSE:       // %bb.0:
; LSE-NEXT:    // kill: def $h0 killed $h0 def $d0
; LSE-NEXT:    shll v1.4s, v0.4h, #16
; LSE-NEXT:    mov w8, #32767 // =0x7fff
; LSE-NEXT:    ldr h0, [x0]
; LSE-NEXT:  .LBB2_1: // %atomicrmw.start
; LSE-NEXT:    // =>This Inner Loop Header: Depth=1
; LSE-NEXT:    shll v2.4s, v0.4h, #16
; LSE-NEXT:    fminnm s2, s2, s1
; LSE-NEXT:    fmov w9, s2
; LSE-NEXT:    ubfx w10, w9, #16, #1
; LSE-NEXT:    add w9, w9, w8
; LSE-NEXT:    add w9, w10, w9
; LSE-NEXT:    lsr w9, w9, #16
; LSE-NEXT:    fmov s2, w9
; LSE-NEXT:    fmov w9, s0
; LSE-NEXT:    fmov w10, s2
; LSE-NEXT:    mov w11, w9
; LSE-NEXT:    casalh w11, w10, [x0]
; LSE-NEXT:    fmov s0, w11
; LSE-NEXT:    cmp w11, w9, uxth
; LSE-NEXT:    b.ne .LBB2_1
; LSE-NEXT:  // %bb.2: // %atomicrmw.end
; LSE-NEXT:    // kill: def $h0 killed $h0 killed $d0
; LSE-NEXT:    ret
;
; SOFTFP-NOLSE-LABEL: test_atomicrmw_fmin_bf16_seq_cst_align2:
; SOFTFP-NOLSE:       // %bb.0:
; SOFTFP-NOLSE-NEXT:    stp x30, x21, [sp, #-32]! // 16-byte Folded Spill
; SOFTFP-NOLSE-NEXT:    stp x20, x19, [sp, #16] // 16-byte Folded Spill
; SOFTFP-NOLSE-NEXT:    mov x19, x0
; SOFTFP-NOLSE-NEXT:    ldrh w0, [x0]
; SOFTFP-NOLSE-NEXT:    lsl w20, w1, #16
; SOFTFP-NOLSE-NEXT:    b .LBB2_2
; SOFTFP-NOLSE-NEXT:  .LBB2_1: // %cmpxchg.nostore
; SOFTFP-NOLSE-NEXT:    // in Loop: Header=BB2_2 Depth=1
; SOFTFP-NOLSE-NEXT:    mov w8, wzr
; SOFTFP-NOLSE-NEXT:    clrex
; SOFTFP-NOLSE-NEXT:    cbnz w8, .LBB2_6
; SOFTFP-NOLSE-NEXT:  .LBB2_2: // %atomicrmw.start
; SOFTFP-NOLSE-NEXT:    // =>This Loop Header: Depth=1
; SOFTFP-NOLSE-NEXT:    // Child Loop BB2_3 Depth 2
; SOFTFP-NOLSE-NEXT:    mov w21, w0
; SOFTFP-NOLSE-NEXT:    lsl w0, w0, #16
; SOFTFP-NOLSE-NEXT:    mov w1, w20
; SOFTFP-NOLSE-NEXT:    bl fminf
; SOFTFP-NOLSE-NEXT:    bl __truncsfbf2
; SOFTFP-NOLSE-NEXT:    mov w8, w0
; SOFTFP-NOLSE-NEXT:  .LBB2_3: // %cmpxchg.start
; SOFTFP-NOLSE-NEXT:    // Parent Loop BB2_2 Depth=1
; SOFTFP-NOLSE-NEXT:    // => This Inner Loop Header: Depth=2
; SOFTFP-NOLSE-NEXT:    ldaxrh w0, [x19]
; SOFTFP-NOLSE-NEXT:    cmp w0, w21, uxth
; SOFTFP-NOLSE-NEXT:    b.ne .LBB2_1
; SOFTFP-NOLSE-NEXT:  // %bb.4: // %cmpxchg.trystore
; SOFTFP-NOLSE-NEXT:    // in Loop: Header=BB2_3 Depth=2
; SOFTFP-NOLSE-NEXT:    stlxrh w9, w8, [x19]
; SOFTFP-NOLSE-NEXT:    cbnz w9, .LBB2_3
; SOFTFP-NOLSE-NEXT:  // %bb.5: // in Loop: Header=BB2_2 Depth=1
; SOFTFP-NOLSE-NEXT:    mov w8, #1 // =0x1
; SOFTFP-NOLSE-NEXT:    cbz w8, .LBB2_2
; SOFTFP-NOLSE-NEXT:  .LBB2_6: // %atomicrmw.end
; SOFTFP-NOLSE-NEXT:    ldp x20, x19, [sp, #16] // 16-byte Folded Reload
; SOFTFP-NOLSE-NEXT:    // kill: def $w0 killed $w0 killed $x0
; SOFTFP-NOLSE-NEXT:    ldp x30, x21, [sp], #32 // 16-byte Folded Reload
; SOFTFP-NOLSE-NEXT:    ret
  %res = atomicrmw fmin ptr %ptr, bfloat %value seq_cst, align 2
  ret bfloat %res
}

define bfloat @test_atomicrmw_fmin_bf16_seq_cst_align4(ptr %ptr, bfloat %value) #0 {
; NOLSE-LABEL: test_atomicrmw_fmin_bf16_seq_cst_align4:
; NOLSE:       // %bb.0:
; NOLSE-NEXT:    // kill: def $h0 killed $h0 def $d0
; NOLSE-NEXT:    shll v1.4s, v0.4h, #16
; NOLSE-NEXT:    mov w8, #32767 // =0x7fff
; NOLSE-NEXT:  .LBB3_1: // %atomicrmw.start
; NOLSE-NEXT:    // =>This Inner Loop Header: Depth=1
; NOLSE-NEXT:    ldaxrh w9, [x0]
; NOLSE-NEXT:    fmov s0, w9
; NOLSE-NEXT:    shll v2.4s, v0.4h, #16
; NOLSE-NEXT:    fminnm s2, s2, s1
; NOLSE-NEXT:    fmov w9, s2
; NOLSE-NEXT:    ubfx w10, w9, #16, #1
; NOLSE-NEXT:    add w9, w9, w8
; NOLSE-NEXT:    add w9, w10, w9
; NOLSE-NEXT:    lsr w9, w9, #16
; NOLSE-NEXT:    stlxrh w10, w9, [x0]
; NOLSE-NEXT:    cbnz w10, .LBB3_1
; NOLSE-NEXT:  // %bb.2: // %atomicrmw.end
; NOLSE-NEXT:    // kill: def $h0 killed $h0 killed $d0
; NOLSE-NEXT:    ret
;
; LSE-LABEL: test_atomicrmw_fmin_bf16_seq_cst_align4:
; LSE:       // %bb.0:
; LSE-NEXT:    // kill: def $h0 killed $h0 def $d0
; LSE-NEXT:    shll v1.4s, v0.4h, #16
; LSE-NEXT:    mov w8, #32767 // =0x7fff
; LSE-NEXT:    ldr h0, [x0]
; LSE-NEXT:  .LBB3_1: // %atomicrmw.start
; LSE-NEXT:    // =>This Inner Loop Header: Depth=1
; LSE-NEXT:    shll v2.4s, v0.4h, #16
; LSE-NEXT:    fminnm s2, s2, s1
; LSE-NEXT:    fmov w9, s2
; LSE-NEXT:    ubfx w10, w9, #16, #1
; LSE-NEXT:    add w9, w9, w8
; LSE-NEXT:    add w9, w10, w9
; LSE-NEXT:    lsr w9, w9, #16
; LSE-NEXT:    fmov s2, w9
; LSE-NEXT:    fmov w9, s0
; LSE-NEXT:    fmov w10, s2
; LSE-NEXT:    mov w11, w9
; LSE-NEXT:    casalh w11, w10, [x0]
; LSE-NEXT:    fmov s0, w11
; LSE-NEXT:    cmp w11, w9, uxth
; LSE-NEXT:    b.ne .LBB3_1
; LSE-NEXT:  // %bb.2: // %atomicrmw.end
; LSE-NEXT:    // kill: def $h0 killed $h0 killed $d0
; LSE-NEXT:    ret
;
; SOFTFP-NOLSE-LABEL: test_atomicrmw_fmin_bf16_seq_cst_align4:
; SOFTFP-NOLSE:       // %bb.0:
; SOFTFP-NOLSE-NEXT:    stp x30, x21, [sp, #-32]! // 16-byte Folded Spill
; SOFTFP-NOLSE-NEXT:    stp x20, x19, [sp, #16] // 16-byte Folded Spill
; SOFTFP-NOLSE-NEXT:    mov x19, x0
; SOFTFP-NOLSE-NEXT:    ldrh w0, [x0]
; SOFTFP-NOLSE-NEXT:    lsl w20, w1, #16
; SOFTFP-NOLSE-NEXT:    b .LBB3_2
; SOFTFP-NOLSE-NEXT:  .LBB3_1: // %cmpxchg.nostore
; SOFTFP-NOLSE-NEXT:    // in Loop: Header=BB3_2 Depth=1
; SOFTFP-NOLSE-NEXT:    mov w8, wzr
; SOFTFP-NOLSE-NEXT:    clrex
; SOFTFP-NOLSE-NEXT:    cbnz w8, .LBB3_6
; SOFTFP-NOLSE-NEXT:  .LBB3_2: // %atomicrmw.start
; SOFTFP-NOLSE-NEXT:    // =>This Loop Header: Depth=1
; SOFTFP-NOLSE-NEXT:    // Child Loop BB3_3 Depth 2
; SOFTFP-NOLSE-NEXT:    mov w21, w0
; SOFTFP-NOLSE-NEXT:    lsl w0, w0, #16
; SOFTFP-NOLSE-NEXT:    mov w1, w20
; SOFTFP-NOLSE-NEXT:    bl fminf
; SOFTFP-NOLSE-NEXT:    bl __truncsfbf2
; SOFTFP-NOLSE-NEXT:    mov w8, w0
; SOFTFP-NOLSE-NEXT:  .LBB3_3: // %cmpxchg.start
; SOFTFP-NOLSE-NEXT:    // Parent Loop BB3_2 Depth=1
; SOFTFP-NOLSE-NEXT:    // => This Inner Loop Header: Depth=2
; SOFTFP-NOLSE-NEXT:    ldaxrh w0, [x19]
; SOFTFP-NOLSE-NEXT:    cmp w0, w21, uxth
; SOFTFP-NOLSE-NEXT:    b.ne .LBB3_1
; SOFTFP-NOLSE-NEXT:  // %bb.4: // %cmpxchg.trystore
; SOFTFP-NOLSE-NEXT:    // in Loop: Header=BB3_3 Depth=2
; SOFTFP-NOLSE-NEXT:    stlxrh w9, w8, [x19]
; SOFTFP-NOLSE-NEXT:    cbnz w9, .LBB3_3
; SOFTFP-NOLSE-NEXT:  // %bb.5: // in Loop: Header=BB3_2 Depth=1
; SOFTFP-NOLSE-NEXT:    mov w8, #1 // =0x1
; SOFTFP-NOLSE-NEXT:    cbz w8, .LBB3_2
; SOFTFP-NOLSE-NEXT:  .LBB3_6: // %atomicrmw.end
; SOFTFP-NOLSE-NEXT:    ldp x20, x19, [sp, #16] // 16-byte Folded Reload
; SOFTFP-NOLSE-NEXT:    // kill: def $w0 killed $w0 killed $x0
; SOFTFP-NOLSE-NEXT:    ldp x30, x21, [sp], #32 // 16-byte Folded Reload
; SOFTFP-NOLSE-NEXT:    ret
  %res = atomicrmw fmin ptr %ptr, bfloat %value seq_cst, align 4
  ret bfloat %res
}

define float @test_atomicrmw_fmin_f32_seq_cst_align4(ptr %ptr, float %value) #0 {
; NOLSE-LABEL: test_atomicrmw_fmin_f32_seq_cst_align4:
; NOLSE:       // %bb.0:
; NOLSE-NEXT:  .LBB4_1: // %atomicrmw.start
; NOLSE-NEXT:    // =>This Inner Loop Header: Depth=1
; NOLSE-NEXT:    ldaxr w8, [x0]
; NOLSE-NEXT:    fmov s1, w8
; NOLSE-NEXT:    fminnm s2, s1, s0
; NOLSE-NEXT:    fmov w8, s2
; NOLSE-NEXT:    stlxr w9, w8, [x0]
; NOLSE-NEXT:    cbnz w9, .LBB4_1
; NOLSE-NEXT:  // %bb.2: // %atomicrmw.end
; NOLSE-NEXT:    fmov s0, s1
; NOLSE-NEXT:    ret
;
; LSE-LABEL: test_atomicrmw_fmin_f32_seq_cst_align4:
; LSE:       // %bb.0:
; LSE-NEXT:    ldr s1, [x0]
; LSE-NEXT:  .LBB4_1: // %atomicrmw.start
; LSE-NEXT:    // =>This Inner Loop Header: Depth=1
; LSE-NEXT:    fminnm s2, s1, s0
; LSE-NEXT:    fmov w8, s1
; LSE-NEXT:    mov w10, w8
; LSE-NEXT:    fmov w9, s2
; LSE-NEXT:    casal w10, w9, [x0]
; LSE-NEXT:    fmov s1, w10
; LSE-NEXT:    cmp w10, w8
; LSE-NEXT:    b.ne .LBB4_1
; LSE-NEXT:  // %bb.2: // %atomicrmw.end
; LSE-NEXT:    fmov s0, s1
; LSE-NEXT:    ret
;
; SOFTFP-NOLSE-LABEL: test_atomicrmw_fmin_f32_seq_cst_align4:
; SOFTFP-NOLSE:       // %bb.0:
; SOFTFP-NOLSE-NEXT:    stp x30, x21, [sp, #-32]! // 16-byte Folded Spill
; SOFTFP-NOLSE-NEXT:    stp x20, x19, [sp, #16] // 16-byte Folded Spill
; SOFTFP-NOLSE-NEXT:    mov x19, x0
; SOFTFP-NOLSE-NEXT:    ldr w0, [x0]
; SOFTFP-NOLSE-NEXT:    mov w20, w1
; SOFTFP-NOLSE-NEXT:    b .LBB4_2
; SOFTFP-NOLSE-NEXT:  .LBB4_1: // %cmpxchg.nostore
; SOFTFP-NOLSE-NEXT:    // in Loop: Header=BB4_2 Depth=1
; SOFTFP-NOLSE-NEXT:    mov w8, wzr
; SOFTFP-NOLSE-NEXT:    clrex
; SOFTFP-NOLSE-NEXT:    cbnz w8, .LBB4_6
; SOFTFP-NOLSE-NEXT:  .LBB4_2: // %atomicrmw.start
; SOFTFP-NOLSE-NEXT:    // =>This Loop Header: Depth=1
; SOFTFP-NOLSE-NEXT:    // Child Loop BB4_3 Depth 2
; SOFTFP-NOLSE-NEXT:    mov w1, w20
; SOFTFP-NOLSE-NEXT:    mov w21, w0
; SOFTFP-NOLSE-NEXT:    bl fminf
; SOFTFP-NOLSE-NEXT:    mov w8, w0
; SOFTFP-NOLSE-NEXT:  .LBB4_3: // %cmpxchg.start
; SOFTFP-NOLSE-NEXT:    // Parent Loop BB4_2 Depth=1
; SOFTFP-NOLSE-NEXT:    // => This Inner Loop Header: Depth=2
; SOFTFP-NOLSE-NEXT:    ldaxr w0, [x19]
; SOFTFP-NOLSE-NEXT:    cmp w0, w21
; SOFTFP-NOLSE-NEXT:    b.ne .LBB4_1
; SOFTFP-NOLSE-NEXT:  // %bb.4: // %cmpxchg.trystore
; SOFTFP-NOLSE-NEXT:    // in Loop: Header=BB4_3 Depth=2
; SOFTFP-NOLSE-NEXT:    stlxr w9, w8, [x19]
; SOFTFP-NOLSE-NEXT:    cbnz w9, .LBB4_3
; SOFTFP-NOLSE-NEXT:  // %bb.5: // in Loop: Header=BB4_2 Depth=1
; SOFTFP-NOLSE-NEXT:    mov w8, #1 // =0x1
; SOFTFP-NOLSE-NEXT:    cbz w8, .LBB4_2
; SOFTFP-NOLSE-NEXT:  .LBB4_6: // %atomicrmw.end
; SOFTFP-NOLSE-NEXT:    ldp x20, x19, [sp, #16] // 16-byte Folded Reload
; SOFTFP-NOLSE-NEXT:    // kill: def $w0 killed $w0 killed $x0
; SOFTFP-NOLSE-NEXT:    ldp x30, x21, [sp], #32 // 16-byte Folded Reload
; SOFTFP-NOLSE-NEXT:    ret
  %res = atomicrmw fmin ptr %ptr, float %value seq_cst, align 4
  ret float %res
}

define double @test_atomicrmw_fmin_f32_seq_cst_align8(ptr %ptr, double %value) #0 {
; NOLSE-LABEL: test_atomicrmw_fmin_f32_seq_cst_align8:
; NOLSE:       // %bb.0:
; NOLSE-NEXT:  .LBB5_1: // %atomicrmw.start
; NOLSE-NEXT:    // =>This Inner Loop Header: Depth=1
; NOLSE-NEXT:    ldaxr x8, [x0]
; NOLSE-NEXT:    fmov d1, x8
; NOLSE-NEXT:    fminnm d2, d1, d0
; NOLSE-NEXT:    fmov x8, d2
; NOLSE-NEXT:    stlxr w9, x8, [x0]
; NOLSE-NEXT:    cbnz w9, .LBB5_1
; NOLSE-NEXT:  // %bb.2: // %atomicrmw.end
; NOLSE-NEXT:    fmov d0, d1
; NOLSE-NEXT:    ret
;
; LSE-LABEL: test_atomicrmw_fmin_f32_seq_cst_align8:
; LSE:       // %bb.0:
; LSE-NEXT:    ldr d1, [x0]
; LSE-NEXT:  .LBB5_1: // %atomicrmw.start
; LSE-NEXT:    // =>This Inner Loop Header: Depth=1
; LSE-NEXT:    fminnm d2, d1, d0
; LSE-NEXT:    fmov x8, d1
; LSE-NEXT:    mov x10, x8
; LSE-NEXT:    fmov x9, d2
; LSE-NEXT:    casal x10, x9, [x0]
; LSE-NEXT:    fmov d1, x10
; LSE-NEXT:    cmp x10, x8
; LSE-NEXT:    b.ne .LBB5_1
; LSE-NEXT:  // %bb.2: // %atomicrmw.end
; LSE-NEXT:    fmov d0, d1
; LSE-NEXT:    ret
;
; SOFTFP-NOLSE-LABEL: test_atomicrmw_fmin_f32_seq_cst_align8:
; SOFTFP-NOLSE:       // %bb.0:
; SOFTFP-NOLSE-NEXT:    stp x30, x21, [sp, #-32]! // 16-byte Folded Spill
; SOFTFP-NOLSE-NEXT:    ldr x21, [x0]
; SOFTFP-NOLSE-NEXT:    stp x20, x19, [sp, #16] // 16-byte Folded Spill
; SOFTFP-NOLSE-NEXT:    mov x19, x0
; SOFTFP-NOLSE-NEXT:    mov x20, x1
; SOFTFP-NOLSE-NEXT:    b .LBB5_2
; SOFTFP-NOLSE-NEXT:  .LBB5_1: // %cmpxchg.nostore
; SOFTFP-NOLSE-NEXT:    // in Loop: Header=BB5_2 Depth=1
; SOFTFP-NOLSE-NEXT:    mov w9, wzr
; SOFTFP-NOLSE-NEXT:    clrex
; SOFTFP-NOLSE-NEXT:    mov x21, x8
; SOFTFP-NOLSE-NEXT:    cbnz w9, .LBB5_6
; SOFTFP-NOLSE-NEXT:  .LBB5_2: // %atomicrmw.start
; SOFTFP-NOLSE-NEXT:    // =>This Loop Header: Depth=1
; SOFTFP-NOLSE-NEXT:    // Child Loop BB5_3 Depth 2
; SOFTFP-NOLSE-NEXT:    mov x0, x21
; SOFTFP-NOLSE-NEXT:    mov x1, x20
; SOFTFP-NOLSE-NEXT:    bl fmin
; SOFTFP-NOLSE-NEXT:  .LBB5_3: // %cmpxchg.start
; SOFTFP-NOLSE-NEXT:    // Parent Loop BB5_2 Depth=1
; SOFTFP-NOLSE-NEXT:    // => This Inner Loop Header: Depth=2
; SOFTFP-NOLSE-NEXT:    ldaxr x8, [x19]
; SOFTFP-NOLSE-NEXT:    cmp x8, x21
; SOFTFP-NOLSE-NEXT:    b.ne .LBB5_1
; SOFTFP-NOLSE-NEXT:  // %bb.4: // %cmpxchg.trystore
; SOFTFP-NOLSE-NEXT:    // in Loop: Header=BB5_3 Depth=2
; SOFTFP-NOLSE-NEXT:    stlxr w9, x0, [x19]
; SOFTFP-NOLSE-NEXT:    cbnz w9, .LBB5_3
; SOFTFP-NOLSE-NEXT:  // %bb.5: // in Loop: Header=BB5_2 Depth=1
; SOFTFP-NOLSE-NEXT:    mov w9, #1 // =0x1
; SOFTFP-NOLSE-NEXT:    mov x21, x8
; SOFTFP-NOLSE-NEXT:    cbz w9, .LBB5_2
; SOFTFP-NOLSE-NEXT:  .LBB5_6: // %atomicrmw.end
; SOFTFP-NOLSE-NEXT:    ldp x20, x19, [sp, #16] // 16-byte Folded Reload
; SOFTFP-NOLSE-NEXT:    mov x0, x21
; SOFTFP-NOLSE-NEXT:    ldp x30, x21, [sp], #32 // 16-byte Folded Reload
; SOFTFP-NOLSE-NEXT:    ret
  %res = atomicrmw fmin ptr %ptr, double %value seq_cst, align 8
  ret double %res
}

define <2 x half> @test_atomicrmw_fmin_v2f16_seq_cst_align4(ptr %ptr, <2 x half> %value) #0 {
; NOLSE-LABEL: test_atomicrmw_fmin_v2f16_seq_cst_align4:
; NOLSE:       // %bb.0:
; NOLSE-NEXT:    // kill: def $d0 killed $d0 def $q0
; NOLSE-NEXT:    mov h1, v0.h[1]
; NOLSE-NEXT:    fcvt s0, h0
; NOLSE-NEXT:    fcvt s1, h1
; NOLSE-NEXT:  .LBB6_1: // %atomicrmw.start
; NOLSE-NEXT:    // =>This Inner Loop Header: Depth=1
; NOLSE-NEXT:    ldaxr w8, [x0]
; NOLSE-NEXT:    fmov s2, w8
; NOLSE-NEXT:    mov h3, v2.h[1]
; NOLSE-NEXT:    fcvt s2, h2
; NOLSE-NEXT:    fcvt s3, h3
; NOLSE-NEXT:    fminnm s2, s2, s0
; NOLSE-NEXT:    fminnm s3, s3, s1
; NOLSE-NEXT:    fcvt h2, s2
; NOLSE-NEXT:    fcvt h3, s3
; NOLSE-NEXT:    mov v2.h[1], v3.h[0]
; NOLSE-NEXT:    fmov w9, s2
; NOLSE-NEXT:    stlxr w10, w9, [x0]
; NOLSE-NEXT:    cbnz w10, .LBB6_1
; NOLSE-NEXT:  // %bb.2: // %atomicrmw.end
; NOLSE-NEXT:    fmov d0, x8
; NOLSE-NEXT:    ret
;
; LSE-LABEL: test_atomicrmw_fmin_v2f16_seq_cst_align4:
; LSE:       // %bb.0:
; LSE-NEXT:    // kill: def $d0 killed $d0 def $q0
; LSE-NEXT:    mov h1, v0.h[1]
; LSE-NEXT:    fcvt s2, h0
; LSE-NEXT:    ldr s0, [x0]
; LSE-NEXT:    fcvt s1, h1
; LSE-NEXT:  .LBB6_1: // %atomicrmw.start
; LSE-NEXT:    // =>This Inner Loop Header: Depth=1
; LSE-NEXT:    mov h3, v0.h[1]
; LSE-NEXT:    fcvt s4, h0
; LSE-NEXT:    fmov w8, s0
; LSE-NEXT:    mov w10, w8
; LSE-NEXT:    fcvt s3, h3
; LSE-NEXT:    fminnm s4, s4, s2
; LSE-NEXT:    fminnm s3, s3, s1
; LSE-NEXT:    fcvt h4, s4
; LSE-NEXT:    fcvt h3, s3
; LSE-NEXT:    mov v4.h[1], v3.h[0]
; LSE-NEXT:    fmov w9, s4
; LSE-NEXT:    casal w10, w9, [x0]
; LSE-NEXT:    fmov s0, w10
; LSE-NEXT:    cmp w10, w8
; LSE-NEXT:    b.ne .LBB6_1
; LSE-NEXT:  // %bb.2: // %atomicrmw.end
; LSE-NEXT:    // kill: def $d0 killed $d0 killed $q0
; LSE-NEXT:    ret
;
; SOFTFP-NOLSE-LABEL: test_atomicrmw_fmin_v2f16_seq_cst_align4:
; SOFTFP-NOLSE:       // %bb.0:
; SOFTFP-NOLSE-NEXT:    stp x30, x25, [sp, #-64]! // 16-byte Folded Spill
; SOFTFP-NOLSE-NEXT:    stp x24, x23, [sp, #16] // 16-byte Folded Spill
; SOFTFP-NOLSE-NEXT:    ldrh w23, [x0, #2]
; SOFTFP-NOLSE-NEXT:    stp x22, x21, [sp, #32] // 16-byte Folded Spill
; SOFTFP-NOLSE-NEXT:    ldrh w22, [x0]
; SOFTFP-NOLSE-NEXT:    mov w21, w1
; SOFTFP-NOLSE-NEXT:    stp x20, x19, [sp, #48] // 16-byte Folded Spill
; SOFTFP-NOLSE-NEXT:    mov w19, w2
; SOFTFP-NOLSE-NEXT:    mov x20, x0
; SOFTFP-NOLSE-NEXT:    b .LBB6_2
; SOFTFP-NOLSE-NEXT:  .LBB6_1: // %cmpxchg.nostore
; SOFTFP-NOLSE-NEXT:    // in Loop: Header=BB6_2 Depth=1
; SOFTFP-NOLSE-NEXT:    mov w8, wzr
; SOFTFP-NOLSE-NEXT:    clrex
; SOFTFP-NOLSE-NEXT:    lsr w23, w22, #16
; SOFTFP-NOLSE-NEXT:    cbnz w8, .LBB6_6
; SOFTFP-NOLSE-NEXT:  .LBB6_2: // %atomicrmw.start
; SOFTFP-NOLSE-NEXT:    // =>This Loop Header: Depth=1
; SOFTFP-NOLSE-NEXT:    // Child Loop BB6_3 Depth 2
; SOFTFP-NOLSE-NEXT:    and w0, w19, #0xffff
; SOFTFP-NOLSE-NEXT:    bl __gnu_h2f_ieee
; SOFTFP-NOLSE-NEXT:    mov w24, w0
; SOFTFP-NOLSE-NEXT:    and w0, w23, #0xffff
; SOFTFP-NOLSE-NEXT:    bl __gnu_h2f_ieee
; SOFTFP-NOLSE-NEXT:    mov w1, w24
; SOFTFP-NOLSE-NEXT:    bl fminf
; SOFTFP-NOLSE-NEXT:    bl __gnu_f2h_ieee
; SOFTFP-NOLSE-NEXT:    mov w24, w0
; SOFTFP-NOLSE-NEXT:    and w0, w21, #0xffff
; SOFTFP-NOLSE-NEXT:    bl __gnu_h2f_ieee
; SOFTFP-NOLSE-NEXT:    mov w25, w0
; SOFTFP-NOLSE-NEXT:    and w0, w22, #0xffff
; SOFTFP-NOLSE-NEXT:    bl __gnu_h2f_ieee
; SOFTFP-NOLSE-NEXT:    mov w1, w25
; SOFTFP-NOLSE-NEXT:    bl fminf
; SOFTFP-NOLSE-NEXT:    bl __gnu_f2h_ieee
; SOFTFP-NOLSE-NEXT:    mov w8, w22
; SOFTFP-NOLSE-NEXT:    bfi w0, w24, #16, #16
; SOFTFP-NOLSE-NEXT:    bfi w8, w23, #16, #16
; SOFTFP-NOLSE-NEXT:  .LBB6_3: // %cmpxchg.start
; SOFTFP-NOLSE-NEXT:    // Parent Loop BB6_2 Depth=1
; SOFTFP-NOLSE-NEXT:    // => This Inner Loop Header: Depth=2
; SOFTFP-NOLSE-NEXT:    ldaxr w22, [x20]
; SOFTFP-NOLSE-NEXT:    cmp w22, w8
; SOFTFP-NOLSE-NEXT:    b.ne .LBB6_1
; SOFTFP-NOLSE-NEXT:  // %bb.4: // %cmpxchg.trystore
; SOFTFP-NOLSE-NEXT:    // in Loop: Header=BB6_3 Depth=2
; SOFTFP-NOLSE-NEXT:    stlxr w9, w0, [x20]
; SOFTFP-NOLSE-NEXT:    cbnz w9, .LBB6_3
; SOFTFP-NOLSE-NEXT:  // %bb.5: // in Loop: Header=BB6_2 Depth=1
; SOFTFP-NOLSE-NEXT:    mov w8, #1 // =0x1
; SOFTFP-NOLSE-NEXT:    lsr w23, w22, #16
; SOFTFP-NOLSE-NEXT:    cbz w8, .LBB6_2
; SOFTFP-NOLSE-NEXT:  .LBB6_6: // %atomicrmw.end
; SOFTFP-NOLSE-NEXT:    mov w0, w22
; SOFTFP-NOLSE-NEXT:    mov w1, w23
; SOFTFP-NOLSE-NEXT:    ldp x20, x19, [sp, #48] // 16-byte Folded Reload
; SOFTFP-NOLSE-NEXT:    ldp x22, x21, [sp, #32] // 16-byte Folded Reload
; SOFTFP-NOLSE-NEXT:    ldp x24, x23, [sp, #16] // 16-byte Folded Reload
; SOFTFP-NOLSE-NEXT:    ldp x30, x25, [sp], #64 // 16-byte Folded Reload
; SOFTFP-NOLSE-NEXT:    ret
  %res = atomicrmw fmin ptr %ptr, <2 x half> %value seq_cst, align 4
  ret <2 x half> %res
}

define <2 x bfloat> @test_atomicrmw_fmin_v2bf16_seq_cst_align4(ptr %ptr, <2 x bfloat> %value) #0 {
; NOLSE-LABEL: test_atomicrmw_fmin_v2bf16_seq_cst_align4:
; NOLSE:       // %bb.0:
; NOLSE-NEXT:    // kill: def $d0 killed $d0 def $q0
; NOLSE-NEXT:    dup v1.4h, v0.h[1]
; NOLSE-NEXT:    mov w8, #32767 // =0x7fff
; NOLSE-NEXT:    shll v0.4s, v0.4h, #16
; NOLSE-NEXT:    shll v1.4s, v1.4h, #16
; NOLSE-NEXT:  .LBB7_1: // %atomicrmw.start
; NOLSE-NEXT:    // =>This Inner Loop Header: Depth=1
; NOLSE-NEXT:    ldaxr w9, [x0]
; NOLSE-NEXT:    fmov s2, w9
; NOLSE-NEXT:    dup v3.4h, v2.h[1]
; NOLSE-NEXT:    shll v2.4s, v2.4h, #16
; NOLSE-NEXT:    fminnm s2, s2, s0
; NOLSE-NEXT:    shll v3.4s, v3.4h, #16
; NOLSE-NEXT:    fminnm s3, s3, s1
; NOLSE-NEXT:    fmov w11, s2
; NOLSE-NEXT:    ubfx w13, w11, #16, #1
; NOLSE-NEXT:    add w11, w11, w8
; NOLSE-NEXT:    fmov w10, s3
; NOLSE-NEXT:    add w11, w13, w11
; NOLSE-NEXT:    lsr w11, w11, #16
; NOLSE-NEXT:    ubfx w12, w10, #16, #1
; NOLSE-NEXT:    add w10, w10, w8
; NOLSE-NEXT:    fmov s3, w11
; NOLSE-NEXT:    add w10, w12, w10
; NOLSE-NEXT:    lsr w10, w10, #16
; NOLSE-NEXT:    fmov s2, w10
; NOLSE-NEXT:    mov v3.h[1], v2.h[0]
; NOLSE-NEXT:    fmov w10, s3
; NOLSE-NEXT:    stlxr w11, w10, [x0]
; NOLSE-NEXT:    cbnz w11, .LBB7_1
; NOLSE-NEXT:  // %bb.2: // %atomicrmw.end
; NOLSE-NEXT:    fmov d0, x9
; NOLSE-NEXT:    ret
;
; LSE-LABEL: test_atomicrmw_fmin_v2bf16_seq_cst_align4:
; LSE:       // %bb.0:
; LSE-NEXT:    // kill: def $d0 killed $d0 def $q0
; LSE-NEXT:    dup v1.4h, v0.h[1]
; LSE-NEXT:    shll v2.4s, v0.4h, #16
; LSE-NEXT:    mov w8, #32767 // =0x7fff
; LSE-NEXT:    ldr s0, [x0]
; LSE-NEXT:    shll v1.4s, v1.4h, #16
; LSE-NEXT:  .LBB7_1: // %atomicrmw.start
; LSE-NEXT:    // =>This Inner Loop Header: Depth=1
; LSE-NEXT:    dup v3.4h, v0.h[1]
; LSE-NEXT:    shll v4.4s, v0.4h, #16
; LSE-NEXT:    fminnm s4, s4, s2
; LSE-NEXT:    shll v3.4s, v3.4h, #16
; LSE-NEXT:    fminnm s3, s3, s1
; LSE-NEXT:    fmov w10, s4
; LSE-NEXT:    ubfx w12, w10, #16, #1
; LSE-NEXT:    add w10, w10, w8
; LSE-NEXT:    fmov w9, s3
; LSE-NEXT:    add w10, w12, w10
; LSE-NEXT:    lsr w10, w10, #16
; LSE-NEXT:    ubfx w11, w9, #16, #1
; LSE-NEXT:    add w9, w9, w8
; LSE-NEXT:    fmov s4, w10
; LSE-NEXT:    add w9, w11, w9
; LSE-NEXT:    lsr w9, w9, #16
; LSE-NEXT:    fmov s3, w9
; LSE-NEXT:    fmov w9, s0
; LSE-NEXT:    mov v4.h[1], v3.h[0]
; LSE-NEXT:    mov w11, w9
; LSE-NEXT:    fmov w10, s4
; LSE-NEXT:    casal w11, w10, [x0]
; LSE-NEXT:    fmov s0, w11
; LSE-NEXT:    cmp w11, w9
; LSE-NEXT:    b.ne .LBB7_1
; LSE-NEXT:  // %bb.2: // %atomicrmw.end
; LSE-NEXT:    // kill: def $d0 killed $d0 killed $q0
; LSE-NEXT:    ret
;
; SOFTFP-NOLSE-LABEL: test_atomicrmw_fmin_v2bf16_seq_cst_align4:
; SOFTFP-NOLSE:       // %bb.0:
; SOFTFP-NOLSE-NEXT:    str x30, [sp, #-64]! // 8-byte Folded Spill
; SOFTFP-NOLSE-NEXT:    mov w8, w1
; SOFTFP-NOLSE-NEXT:    stp x22, x21, [sp, #32] // 16-byte Folded Spill
; SOFTFP-NOLSE-NEXT:    ldrh w1, [x0, #2]
; SOFTFP-NOLSE-NEXT:    stp x20, x19, [sp, #48] // 16-byte Folded Spill
; SOFTFP-NOLSE-NEXT:    ldrh w22, [x0]
; SOFTFP-NOLSE-NEXT:    lsl w20, w2, #16
; SOFTFP-NOLSE-NEXT:    lsl w21, w8, #16
; SOFTFP-NOLSE-NEXT:    mov x19, x0
; SOFTFP-NOLSE-NEXT:    stp x24, x23, [sp, #16] // 16-byte Folded Spill
; SOFTFP-NOLSE-NEXT:    b .LBB7_2
; SOFTFP-NOLSE-NEXT:  .LBB7_1: // %cmpxchg.nostore
; SOFTFP-NOLSE-NEXT:    // in Loop: Header=BB7_2 Depth=1
; SOFTFP-NOLSE-NEXT:    mov w8, wzr
; SOFTFP-NOLSE-NEXT:    clrex
; SOFTFP-NOLSE-NEXT:    lsr w1, w22, #16
; SOFTFP-NOLSE-NEXT:    cbnz w8, .LBB7_6
; SOFTFP-NOLSE-NEXT:  .LBB7_2: // %atomicrmw.start
; SOFTFP-NOLSE-NEXT:    // =>This Loop Header: Depth=1
; SOFTFP-NOLSE-NEXT:    // Child Loop BB7_3 Depth 2
; SOFTFP-NOLSE-NEXT:    lsl w23, w1, #16
; SOFTFP-NOLSE-NEXT:    mov w1, w20
; SOFTFP-NOLSE-NEXT:    mov w0, w23
; SOFTFP-NOLSE-NEXT:    bl fminf
; SOFTFP-NOLSE-NEXT:    bl __truncsfbf2
; SOFTFP-NOLSE-NEXT:    mov w24, w0
; SOFTFP-NOLSE-NEXT:    lsl w0, w22, #16
; SOFTFP-NOLSE-NEXT:    mov w1, w21
; SOFTFP-NOLSE-NEXT:    bl fminf
; SOFTFP-NOLSE-NEXT:    bl __truncsfbf2
; SOFTFP-NOLSE-NEXT:    bfxil w23, w22, #0, #16
; SOFTFP-NOLSE-NEXT:    bfi w0, w24, #16, #16
; SOFTFP-NOLSE-NEXT:  .LBB7_3: // %cmpxchg.start
; SOFTFP-NOLSE-NEXT:    // Parent Loop BB7_2 Depth=1
; SOFTFP-NOLSE-NEXT:    // => This Inner Loop Header: Depth=2
; SOFTFP-NOLSE-NEXT:    ldaxr w22, [x19]
; SOFTFP-NOLSE-NEXT:    cmp w22, w23
; SOFTFP-NOLSE-NEXT:    b.ne .LBB7_1
; SOFTFP-NOLSE-NEXT:  // %bb.4: // %cmpxchg.trystore
; SOFTFP-NOLSE-NEXT:    // in Loop: Header=BB7_3 Depth=2
; SOFTFP-NOLSE-NEXT:    stlxr w8, w0, [x19]
; SOFTFP-NOLSE-NEXT:    cbnz w8, .LBB7_3
; SOFTFP-NOLSE-NEXT:  // %bb.5: // in Loop: Header=BB7_2 Depth=1
; SOFTFP-NOLSE-NEXT:    mov w8, #1 // =0x1
; SOFTFP-NOLSE-NEXT:    lsr w1, w22, #16
; SOFTFP-NOLSE-NEXT:    cbz w8, .LBB7_2
; SOFTFP-NOLSE-NEXT:  .LBB7_6: // %atomicrmw.end
; SOFTFP-NOLSE-NEXT:    mov w0, w22
; SOFTFP-NOLSE-NEXT:    ldp x20, x19, [sp, #48] // 16-byte Folded Reload
; SOFTFP-NOLSE-NEXT:    ldp x22, x21, [sp, #32] // 16-byte Folded Reload
; SOFTFP-NOLSE-NEXT:    ldp x24, x23, [sp, #16] // 16-byte Folded Reload
; SOFTFP-NOLSE-NEXT:    ldr x30, [sp], #64 // 8-byte Folded Reload
; SOFTFP-NOLSE-NEXT:    ret
  %res = atomicrmw fmin ptr %ptr, <2 x bfloat> %value seq_cst, align 4
  ret <2 x bfloat> %res
}

define <2 x float> @test_atomicrmw_fmin_v2f32_seq_cst_align8(ptr %ptr, <2 x float> %value) #0 {
; NOLSE-LABEL: test_atomicrmw_fmin_v2f32_seq_cst_align8:
; NOLSE:       // %bb.0:
; NOLSE-NEXT:  .LBB8_1: // %atomicrmw.start
; NOLSE-NEXT:    // =>This Inner Loop Header: Depth=1
; NOLSE-NEXT:    ldaxr x8, [x0]
; NOLSE-NEXT:    fmov d1, x8
; NOLSE-NEXT:    fminnm v2.2s, v1.2s, v0.2s
; NOLSE-NEXT:    fmov x8, d2
; NOLSE-NEXT:    stlxr w9, x8, [x0]
; NOLSE-NEXT:    cbnz w9, .LBB8_1
; NOLSE-NEXT:  // %bb.2: // %atomicrmw.end
; NOLSE-NEXT:    fmov d0, d1
; NOLSE-NEXT:    ret
;
; LSE-LABEL: test_atomicrmw_fmin_v2f32_seq_cst_align8:
; LSE:       // %bb.0:
; LSE-NEXT:    ldr d1, [x0]
; LSE-NEXT:  .LBB8_1: // %atomicrmw.start
; LSE-NEXT:    // =>This Inner Loop Header: Depth=1
; LSE-NEXT:    fminnm v2.2s, v1.2s, v0.2s
; LSE-NEXT:    fmov x8, d1
; LSE-NEXT:    mov x10, x8
; LSE-NEXT:    fmov x9, d2
; LSE-NEXT:    casal x10, x9, [x0]
; LSE-NEXT:    fmov d1, x10
; LSE-NEXT:    cmp x10, x8
; LSE-NEXT:    b.ne .LBB8_1
; LSE-NEXT:  // %bb.2: // %atomicrmw.end
; LSE-NEXT:    fmov d0, d1
; LSE-NEXT:    ret
;
; SOFTFP-NOLSE-LABEL: test_atomicrmw_fmin_v2f32_seq_cst_align8:
; SOFTFP-NOLSE:       // %bb.0:
; SOFTFP-NOLSE-NEXT:    str x30, [sp, #-64]! // 8-byte Folded Spill
; SOFTFP-NOLSE-NEXT:    stp x24, x23, [sp, #16] // 16-byte Folded Spill
; SOFTFP-NOLSE-NEXT:    stp x22, x21, [sp, #32] // 16-byte Folded Spill
; SOFTFP-NOLSE-NEXT:    mov w21, w1
; SOFTFP-NOLSE-NEXT:    ldp w22, w23, [x0]
; SOFTFP-NOLSE-NEXT:    stp x20, x19, [sp, #48] // 16-byte Folded Spill
; SOFTFP-NOLSE-NEXT:    mov w19, w2
; SOFTFP-NOLSE-NEXT:    mov x20, x0
; SOFTFP-NOLSE-NEXT:    b .LBB8_2
; SOFTFP-NOLSE-NEXT:  .LBB8_1: // %cmpxchg.nostore
; SOFTFP-NOLSE-NEXT:    // in Loop: Header=BB8_2 Depth=1
; SOFTFP-NOLSE-NEXT:    mov w8, wzr
; SOFTFP-NOLSE-NEXT:    clrex
; SOFTFP-NOLSE-NEXT:    lsr x23, x22, #32
; SOFTFP-NOLSE-NEXT:    cbnz w8, .LBB8_6
; SOFTFP-NOLSE-NEXT:  .LBB8_2: // %atomicrmw.start
; SOFTFP-NOLSE-NEXT:    // =>This Loop Header: Depth=1
; SOFTFP-NOLSE-NEXT:    // Child Loop BB8_3 Depth 2
; SOFTFP-NOLSE-NEXT:    mov w0, w23
; SOFTFP-NOLSE-NEXT:    mov w1, w19
; SOFTFP-NOLSE-NEXT:    bl fminf
; SOFTFP-NOLSE-NEXT:    mov w24, w0
; SOFTFP-NOLSE-NEXT:    mov w0, w22
; SOFTFP-NOLSE-NEXT:    mov w1, w21
; SOFTFP-NOLSE-NEXT:    bl fminf
; SOFTFP-NOLSE-NEXT:    mov w8, w0
; SOFTFP-NOLSE-NEXT:    mov w9, w22
; SOFTFP-NOLSE-NEXT:    // kill: def $w23 killed $w23 killed $x23 def $x23
; SOFTFP-NOLSE-NEXT:    orr x8, x8, x24, lsl #32
; SOFTFP-NOLSE-NEXT:    orr x9, x9, x23, lsl #32
; SOFTFP-NOLSE-NEXT:  .LBB8_3: // %cmpxchg.start
; SOFTFP-NOLSE-NEXT:    // Parent Loop BB8_2 Depth=1
; SOFTFP-NOLSE-NEXT:    // => This Inner Loop Header: Depth=2
; SOFTFP-NOLSE-NEXT:    ldaxr x22, [x20]
; SOFTFP-NOLSE-NEXT:    cmp x22, x9
; SOFTFP-NOLSE-NEXT:    b.ne .LBB8_1
; SOFTFP-NOLSE-NEXT:  // %bb.4: // %cmpxchg.trystore
; SOFTFP-NOLSE-NEXT:    // in Loop: Header=BB8_3 Depth=2
; SOFTFP-NOLSE-NEXT:    stlxr w10, x8, [x20]
; SOFTFP-NOLSE-NEXT:    cbnz w10, .LBB8_3
; SOFTFP-NOLSE-NEXT:  // %bb.5: // in Loop: Header=BB8_2 Depth=1
; SOFTFP-NOLSE-NEXT:    mov w8, #1 // =0x1
; SOFTFP-NOLSE-NEXT:    lsr x23, x22, #32
; SOFTFP-NOLSE-NEXT:    cbz w8, .LBB8_2
; SOFTFP-NOLSE-NEXT:  .LBB8_6: // %atomicrmw.end
; SOFTFP-NOLSE-NEXT:    mov w0, w22
; SOFTFP-NOLSE-NEXT:    mov w1, w23
; SOFTFP-NOLSE-NEXT:    ldp x20, x19, [sp, #48] // 16-byte Folded Reload
; SOFTFP-NOLSE-NEXT:    ldp x22, x21, [sp, #32] // 16-byte Folded Reload
; SOFTFP-NOLSE-NEXT:    ldp x24, x23, [sp, #16] // 16-byte Folded Reload
; SOFTFP-NOLSE-NEXT:    ldr x30, [sp], #64 // 8-byte Folded Reload
; SOFTFP-NOLSE-NEXT:    ret
  %res = atomicrmw fmin ptr %ptr, <2 x float> %value seq_cst, align 8
  ret <2 x float> %res
}

define <2 x double> @test_atomicrmw_fmin_v2f64_seq_cst_align8(ptr %ptr, <2 x double> %value) #0 {
; NOLSE-LABEL: test_atomicrmw_fmin_v2f64_seq_cst_align8:
; NOLSE:       // %bb.0:
; NOLSE-NEXT:  .LBB9_1: // %atomicrmw.start
; NOLSE-NEXT:    // =>This Inner Loop Header: Depth=1
; NOLSE-NEXT:    ldaxp x8, x9, [x0]
; NOLSE-NEXT:    fmov d1, x8
; NOLSE-NEXT:    mov v1.d[1], x9
; NOLSE-NEXT:    fminnm v2.2d, v1.2d, v0.2d
; NOLSE-NEXT:    mov x8, v2.d[1]
; NOLSE-NEXT:    fmov x9, d2
; NOLSE-NEXT:    stlxp w10, x9, x8, [x0]
; NOLSE-NEXT:    cbnz w10, .LBB9_1
; NOLSE-NEXT:  // %bb.2: // %atomicrmw.end
; NOLSE-NEXT:    mov v0.16b, v1.16b
; NOLSE-NEXT:    ret
;
; LSE-LABEL: test_atomicrmw_fmin_v2f64_seq_cst_align8:
; LSE:       // %bb.0:
; LSE-NEXT:    ldr q1, [x0]
; LSE-NEXT:  .LBB9_1: // %atomicrmw.start
; LSE-NEXT:    // =>This Inner Loop Header: Depth=1
; LSE-NEXT:    fminnm v2.2d, v1.2d, v0.2d
; LSE-NEXT:    mov x3, v1.d[1]
; LSE-NEXT:    fmov x2, d1
; LSE-NEXT:    mov x7, x3
; LSE-NEXT:    mov x5, v2.d[1]
; LSE-NEXT:    mov x6, x2
; LSE-NEXT:    fmov x4, d2
; LSE-NEXT:    caspal x6, x7, x4, x5, [x0]
; LSE-NEXT:    fmov d1, x6
; LSE-NEXT:    cmp x7, x3
; LSE-NEXT:    ccmp x6, x2, #0, eq
; LSE-NEXT:    mov v1.d[1], x7
; LSE-NEXT:    b.ne .LBB9_1
; LSE-NEXT:  // %bb.2: // %atomicrmw.end
; LSE-NEXT:    mov v0.16b, v1.16b
; LSE-NEXT:    ret
;
; SOFTFP-NOLSE-LABEL: test_atomicrmw_fmin_v2f64_seq_cst_align8:
; SOFTFP-NOLSE:       // %bb.0:
; SOFTFP-NOLSE-NEXT:    str x30, [sp, #-64]! // 8-byte Folded Spill
; SOFTFP-NOLSE-NEXT:    stp x20, x19, [sp, #48] // 16-byte Folded Spill
; SOFTFP-NOLSE-NEXT:    mov x20, x0
; SOFTFP-NOLSE-NEXT:    mov x19, x3
; SOFTFP-NOLSE-NEXT:    ldp x0, x1, [x0]
; SOFTFP-NOLSE-NEXT:    stp x22, x21, [sp, #32] // 16-byte Folded Spill
; SOFTFP-NOLSE-NEXT:    mov x21, x2
; SOFTFP-NOLSE-NEXT:    stp x24, x23, [sp, #16] // 16-byte Folded Spill
; SOFTFP-NOLSE-NEXT:    b .LBB9_2
; SOFTFP-NOLSE-NEXT:  .LBB9_1: // %atomicrmw.start
; SOFTFP-NOLSE-NEXT:    // in Loop: Header=BB9_2 Depth=1
; SOFTFP-NOLSE-NEXT:    cmp x1, x22
; SOFTFP-NOLSE-NEXT:    ccmp x0, x23, #0, eq
; SOFTFP-NOLSE-NEXT:    b.eq .LBB9_6
; SOFTFP-NOLSE-NEXT:  .LBB9_2: // %atomicrmw.start
; SOFTFP-NOLSE-NEXT:    // =>This Loop Header: Depth=1
; SOFTFP-NOLSE-NEXT:    // Child Loop BB9_3 Depth 2
; SOFTFP-NOLSE-NEXT:    mov x22, x1
; SOFTFP-NOLSE-NEXT:    mov x23, x0
; SOFTFP-NOLSE-NEXT:    mov x0, x1
; SOFTFP-NOLSE-NEXT:    mov x1, x19
; SOFTFP-NOLSE-NEXT:    bl fmin
; SOFTFP-NOLSE-NEXT:    mov x24, x0
; SOFTFP-NOLSE-NEXT:    mov x0, x23
; SOFTFP-NOLSE-NEXT:    mov x1, x21
; SOFTFP-NOLSE-NEXT:    bl fmin
; SOFTFP-NOLSE-NEXT:    mov x8, x0
; SOFTFP-NOLSE-NEXT:  .LBB9_3: // %atomicrmw.start
; SOFTFP-NOLSE-NEXT:    // Parent Loop BB9_2 Depth=1
; SOFTFP-NOLSE-NEXT:    // => This Inner Loop Header: Depth=2
; SOFTFP-NOLSE-NEXT:    ldaxp x0, x1, [x20]
; SOFTFP-NOLSE-NEXT:    cmp x0, x23
; SOFTFP-NOLSE-NEXT:    cset w9, ne
; SOFTFP-NOLSE-NEXT:    cmp x1, x22
; SOFTFP-NOLSE-NEXT:    cinc w9, w9, ne
; SOFTFP-NOLSE-NEXT:    cbz w9, .LBB9_5
; SOFTFP-NOLSE-NEXT:  // %bb.4: // %atomicrmw.start
; SOFTFP-NOLSE-NEXT:    // in Loop: Header=BB9_3 Depth=2
; SOFTFP-NOLSE-NEXT:    stlxp w9, x0, x1, [x20]
; SOFTFP-NOLSE-NEXT:    cbnz w9, .LBB9_3
; SOFTFP-NOLSE-NEXT:    b .LBB9_1
; SOFTFP-NOLSE-NEXT:  .LBB9_5: // %atomicrmw.start
; SOFTFP-NOLSE-NEXT:    // in Loop: Header=BB9_3 Depth=2
; SOFTFP-NOLSE-NEXT:    stlxp w9, x8, x24, [x20]
; SOFTFP-NOLSE-NEXT:    cbnz w9, .LBB9_3
; SOFTFP-NOLSE-NEXT:    b .LBB9_1
; SOFTFP-NOLSE-NEXT:  .LBB9_6: // %atomicrmw.end
; SOFTFP-NOLSE-NEXT:    ldp x20, x19, [sp, #48] // 16-byte Folded Reload
; SOFTFP-NOLSE-NEXT:    ldp x22, x21, [sp, #32] // 16-byte Folded Reload
; SOFTFP-NOLSE-NEXT:    ldp x24, x23, [sp, #16] // 16-byte Folded Reload
; SOFTFP-NOLSE-NEXT:    ldr x30, [sp], #64 // 8-byte Folded Reload
; SOFTFP-NOLSE-NEXT:    ret
  %res = atomicrmw fmin ptr %ptr, <2 x double> %value seq_cst, align 16
  ret <2 x double> %res
}

attributes #0 = { nounwind }