Skip to content

Commit 9ca61d1

Browse files
committed
[AArch64] Use roundeven intrinsic for tests
1 parent 0886610 commit 9ca61d1

File tree

2 files changed

+16
-60
lines changed

2 files changed

+16
-60
lines changed

llvm/test/CodeGen/AArch64/round-fptosi-sat-scalar.ll

Lines changed: 8 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -479,63 +479,43 @@ entry:
479479
define i32 @testnsws(float %a) {
480480
; CHECK-LABEL: testnsws:
481481
; CHECK: // %bb.0: // %entry
482-
; CHECK-NEXT: str x30, [sp, #-16]! // 8-byte Folded Spill
483-
; CHECK-NEXT: .cfi_def_cfa_offset 16
484-
; CHECK-NEXT: .cfi_offset w30, -16
485-
; CHECK-NEXT: bl roundevenf
486-
; CHECK-NEXT: fcvtzs w0, s0
487-
; CHECK-NEXT: ldr x30, [sp], #16 // 8-byte Folded Reload
482+
; CHECK-NEXT: fcvtns w0, s0
488483
; CHECK-NEXT: ret
489484
entry:
490-
%r = call float @roundevenf(float %a) nounwind readnone
485+
%r = call float @llvm.roundeven.f32(float %a) nounwind readnone
491486
%i = call i32 @llvm.fptosi.sat.i32.f32(float %r)
492487
ret i32 %i
493488
}
494489

495490
define i64 @testnsxs(float %a) {
496491
; CHECK-LABEL: testnsxs:
497492
; CHECK: // %bb.0: // %entry
498-
; CHECK-NEXT: str x30, [sp, #-16]! // 8-byte Folded Spill
499-
; CHECK-NEXT: .cfi_def_cfa_offset 16
500-
; CHECK-NEXT: .cfi_offset w30, -16
501-
; CHECK-NEXT: bl roundevenf
502-
; CHECK-NEXT: fcvtzs x0, s0
503-
; CHECK-NEXT: ldr x30, [sp], #16 // 8-byte Folded Reload
493+
; CHECK-NEXT: fcvtns x0, s0
504494
; CHECK-NEXT: ret
505495
entry:
506-
%r = call float @roundevenf(float %a) nounwind readnone
496+
%r = call float @llvm.roundeven.f32(float %a) nounwind readnone
507497
%i = call i64 @llvm.fptosi.sat.i64.f32(float %r)
508498
ret i64 %i
509499
}
510500

511501
define i32 @testnswd(double %a) {
512502
; CHECK-LABEL: testnswd:
513503
; CHECK: // %bb.0: // %entry
514-
; CHECK-NEXT: str x30, [sp, #-16]! // 8-byte Folded Spill
515-
; CHECK-NEXT: .cfi_def_cfa_offset 16
516-
; CHECK-NEXT: .cfi_offset w30, -16
517-
; CHECK-NEXT: bl roundeven
518-
; CHECK-NEXT: fcvtzs w0, d0
519-
; CHECK-NEXT: ldr x30, [sp], #16 // 8-byte Folded Reload
504+
; CHECK-NEXT: fcvtns w0, d0
520505
; CHECK-NEXT: ret
521506
entry:
522-
%r = call double @roundeven(double %a) nounwind readnone
507+
%r = call double @llvm.roundeven.f64(double %a) nounwind readnone
523508
%i = call i32 @llvm.fptosi.sat.i32.f64(double %r)
524509
ret i32 %i
525510
}
526511

527512
define i64 @testnsxd(double %a) {
528513
; CHECK-LABEL: testnsxd:
529514
; CHECK: // %bb.0: // %entry
530-
; CHECK-NEXT: str x30, [sp, #-16]! // 8-byte Folded Spill
531-
; CHECK-NEXT: .cfi_def_cfa_offset 16
532-
; CHECK-NEXT: .cfi_offset w30, -16
533-
; CHECK-NEXT: bl roundeven
534-
; CHECK-NEXT: fcvtzs x0, d0
535-
; CHECK-NEXT: ldr x30, [sp], #16 // 8-byte Folded Reload
515+
; CHECK-NEXT: fcvtns x0, d0
536516
; CHECK-NEXT: ret
537517
entry:
538-
%r = call double @roundeven(double %a) nounwind readnone
518+
%r = call double @llvm.roundeven.f64(double %a) nounwind readnone
539519
%i = call i64 @llvm.fptosi.sat.i64.f64(double %r)
540520
ret i64 %i
541521
}
@@ -562,9 +542,7 @@ declare float @floorf(float) nounwind readnone
562542
declare float @ceilf(float) nounwind readnone
563543
declare float @truncf(float) nounwind readnone
564544
declare float @roundf(float) nounwind readnone
565-
declare float @roundevenf(float) nounwind readnone
566545
declare double @floor(double) nounwind readnone
567546
declare double @ceil(double) nounwind readnone
568547
declare double @trunc(double) nounwind readnone
569548
declare double @round(double) nounwind readnone
570-
declare double @roundeven(double) nounwind readnone

llvm/test/CodeGen/AArch64/round-fptoui-sat-scalar.ll

Lines changed: 8 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -391,63 +391,43 @@ entry:
391391
define i32 @testnuws(float %a) {
392392
; CHECK-LABEL: testnuws:
393393
; CHECK: // %bb.0: // %entry
394-
; CHECK-NEXT: str x30, [sp, #-16]! // 8-byte Folded Spill
395-
; CHECK-NEXT: .cfi_def_cfa_offset 16
396-
; CHECK-NEXT: .cfi_offset w30, -16
397-
; CHECK-NEXT: bl roundevenf
398-
; CHECK-NEXT: fcvtzu w0, s0
399-
; CHECK-NEXT: ldr x30, [sp], #16 // 8-byte Folded Reload
394+
; CHECK-NEXT: fcvtnu w0, s0
400395
; CHECK-NEXT: ret
401396
entry:
402-
%r = call float @roundevenf(float %a) nounwind readnone
397+
%r = call float @llvm.roundeven.f32(float %a) nounwind readnone
403398
%i = call i32 @llvm.fptoui.sat.i32.f32(float %r)
404399
ret i32 %i
405400
}
406401

407402
define i64 @testnuxs(float %a) {
408403
; CHECK-LABEL: testnuxs:
409404
; CHECK: // %bb.0: // %entry
410-
; CHECK-NEXT: str x30, [sp, #-16]! // 8-byte Folded Spill
411-
; CHECK-NEXT: .cfi_def_cfa_offset 16
412-
; CHECK-NEXT: .cfi_offset w30, -16
413-
; CHECK-NEXT: bl roundevenf
414-
; CHECK-NEXT: fcvtzu x0, s0
415-
; CHECK-NEXT: ldr x30, [sp], #16 // 8-byte Folded Reload
405+
; CHECK-NEXT: fcvtnu x0, s0
416406
; CHECK-NEXT: ret
417407
entry:
418-
%r = call float @roundevenf(float %a) nounwind readnone
408+
%r = call float @llvm.roundeven.f32(float %a) nounwind readnone
419409
%i = call i64 @llvm.fptoui.sat.i64.f32(float %r)
420410
ret i64 %i
421411
}
422412

423413
define i32 @testnuwd(double %a) {
424414
; CHECK-LABEL: testnuwd:
425415
; CHECK: // %bb.0: // %entry
426-
; CHECK-NEXT: str x30, [sp, #-16]! // 8-byte Folded Spill
427-
; CHECK-NEXT: .cfi_def_cfa_offset 16
428-
; CHECK-NEXT: .cfi_offset w30, -16
429-
; CHECK-NEXT: bl roundeven
430-
; CHECK-NEXT: fcvtzu w0, d0
431-
; CHECK-NEXT: ldr x30, [sp], #16 // 8-byte Folded Reload
416+
; CHECK-NEXT: fcvtnu w0, d0
432417
; CHECK-NEXT: ret
433418
entry:
434-
%r = call double @roundeven(double %a) nounwind readnone
419+
%r = call double @llvm.roundeven.f64(double %a) nounwind readnone
435420
%i = call i32 @llvm.fptoui.sat.i32.f64(double %r)
436421
ret i32 %i
437422
}
438423

439424
define i64 @testnuxd(double %a) {
440425
; CHECK-LABEL: testnuxd:
441426
; CHECK: // %bb.0: // %entry
442-
; CHECK-NEXT: str x30, [sp, #-16]! // 8-byte Folded Spill
443-
; CHECK-NEXT: .cfi_def_cfa_offset 16
444-
; CHECK-NEXT: .cfi_offset w30, -16
445-
; CHECK-NEXT: bl roundeven
446-
; CHECK-NEXT: fcvtzu x0, d0
447-
; CHECK-NEXT: ldr x30, [sp], #16 // 8-byte Folded Reload
427+
; CHECK-NEXT: fcvtnu x0, d0
448428
; CHECK-NEXT: ret
449429
entry:
450-
%r = call double @roundeven(double %a) nounwind readnone
430+
%r = call double @llvm.roundeven.f64(double %a) nounwind readnone
451431
%i = call i64 @llvm.fptoui.sat.i64.f64(double %r)
452432
ret i64 %i
453433
}
@@ -468,9 +448,7 @@ declare float @floorf(float) nounwind readnone
468448
declare float @ceilf(float) nounwind readnone
469449
declare float @truncf(float) nounwind readnone
470450
declare float @roundf(float) nounwind readnone
471-
declare float @roundevenf(float) nounwind readnone
472451
declare double @floor(double) nounwind readnone
473452
declare double @ceil(double) nounwind readnone
474453
declare double @trunc(double) nounwind readnone
475454
declare double @round(double) nounwind readnone
476-
declare double @roundeven(double) nounwind readnone

0 commit comments

Comments
 (0)