Skip to content

Commit ba114ab

Browse files
committed
[AArch64] Add extra SME attribute tests for expanded intrinsics. NFC
See D136361.
1 parent c8c5f31 commit ba114ab

File tree

1 file changed

+63
-0
lines changed

1 file changed

+63
-0
lines changed

llvm/test/CodeGen/AArch64/sme-disable-gisel-fisel.ll

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,3 +357,66 @@ define fp128 @f128_call_sm(fp128 %a, fp128 %b) "aarch64_pstate_sm_enabled" nounw
357357
%res = fadd fp128 %a, %b
358358
ret fp128 %res
359359
}
360+
361+
; FIXME: As above this should use Selection DAG to make sure the libcall call is lowered correctly.
362+
define double @frem_call_za(double %a, double %b) "aarch64_pstate_za_shared" nounwind {
363+
; CHECK-FISEL-LABEL: frem_call_za:
364+
; CHECK-FISEL: // %bb.0:
365+
; CHECK-FISEL-NEXT: stp x29, x30, [sp, #-16]! // 16-byte Folded Spill
366+
; CHECK-FISEL-NEXT: mov x29, sp
367+
; CHECK-FISEL-NEXT: sub sp, sp, #16
368+
; CHECK-FISEL-NEXT: rdsvl x8, #1
369+
; CHECK-FISEL-NEXT: mov x9, sp
370+
; CHECK-FISEL-NEXT: mul x8, x8, x8
371+
; CHECK-FISEL-NEXT: sub x9, x9, x8
372+
; CHECK-FISEL-NEXT: mov sp, x9
373+
; CHECK-FISEL-NEXT: stur x9, [x29, #-16]
374+
; CHECK-FISEL-NEXT: sub x9, x29, #16
375+
; CHECK-FISEL-NEXT: sturh w8, [x29, #-8]
376+
; CHECK-FISEL-NEXT: msr TPIDR2_EL0, x9
377+
; CHECK-FISEL-NEXT: bl fmod
378+
; CHECK-FISEL-NEXT: smstart za
379+
; CHECK-FISEL-NEXT: mrs x8, TPIDR2_EL0
380+
; CHECK-FISEL-NEXT: sub x0, x29, #16
381+
; CHECK-FISEL-NEXT: cbnz x8, .LBB10_2
382+
; CHECK-FISEL-NEXT: // %bb.1:
383+
; CHECK-FISEL-NEXT: bl __arm_tpidr2_restore
384+
; CHECK-FISEL-NEXT: .LBB10_2:
385+
; CHECK-FISEL-NEXT: msr TPIDR2_EL0, xzr
386+
; CHECK-FISEL-NEXT: mov sp, x29
387+
; CHECK-FISEL-NEXT: ldp x29, x30, [sp], #16 // 16-byte Folded Reload
388+
; CHECK-FISEL-NEXT: ret
389+
;
390+
; CHECK-GISEL-LABEL: frem_call_za:
391+
; CHECK-GISEL: // %bb.0:
392+
; CHECK-GISEL-NEXT: str x30, [sp, #-16]! // 8-byte Folded Spill
393+
; CHECK-GISEL-NEXT: bl fmod
394+
; CHECK-GISEL-NEXT: ldr x30, [sp], #16 // 8-byte Folded Reload
395+
; CHECK-GISEL-NEXT: ret
396+
%res = frem double %a, %b
397+
ret double %res
398+
}
399+
400+
; FIXME: As above this should use Selection DAG to make sure the libcall is lowered correctly.
401+
define float @frem_call_sm(float %a, float %b) "aarch64_pstate_sm_enabled" nounwind {
402+
; CHECK-COMMON-LABEL: frem_call_sm:
403+
; CHECK-COMMON: // %bb.0:
404+
; CHECK-COMMON-NEXT: str x30, [sp, #-16]! // 8-byte Folded Spill
405+
; CHECK-COMMON-NEXT: bl fmodf
406+
; CHECK-COMMON-NEXT: ldr x30, [sp], #16 // 8-byte Folded Reload
407+
; CHECK-COMMON-NEXT: ret
408+
%res = frem float %a, %b
409+
ret float %res
410+
}
411+
412+
; FIXME: As above this should use Selection DAG to make sure the libcall is lowered correctly.
413+
define float @frem_call_sm_compat(float %a, float %b) "aarch64_pstate_sm_compatible" nounwind {
414+
; CHECK-COMMON-LABEL: frem_call_sm_compat:
415+
; CHECK-COMMON: // %bb.0:
416+
; CHECK-COMMON-NEXT: str x30, [sp, #-16]! // 8-byte Folded Spill
417+
; CHECK-COMMON-NEXT: bl fmodf
418+
; CHECK-COMMON-NEXT: ldr x30, [sp], #16 // 8-byte Folded Reload
419+
; CHECK-COMMON-NEXT: ret
420+
%res = frem float %a, %b
421+
ret float %res
422+
}

0 commit comments

Comments
 (0)