1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 2
2 ; RUN: llc --mtriple=loongarch64 --mattr=+lasx < %s | FileCheck %s
4 define void @register_xr1() nounwind {
5 ; CHECK-LABEL: register_xr1:
6 ; CHECK: # %bb.0: # %entry
8 ; CHECK-NEXT: xvldi $xr1, 1
12 %0 = tail call <4 x i64> asm sideeffect "xvldi ${0:u}, 1", "={$xr1}"()
16 define void @register_xr7() nounwind {
17 ; CHECK-LABEL: register_xr7:
18 ; CHECK: # %bb.0: # %entry
20 ; CHECK-NEXT: xvldi $xr7, 1
24 %0 = tail call <4 x i64> asm sideeffect "xvldi ${0:u}, 1", "={$xr7}"()
28 define void @register_xr23() nounwind {
29 ; CHECK-LABEL: register_xr23:
30 ; CHECK: # %bb.0: # %entry
32 ; CHECK-NEXT: xvldi $xr23, 1
36 %0 = tail call <4 x i64> asm sideeffect "xvldi ${0:u}, 1", "={$xr23}"()
40 ;; The lower 64-bit of the vector register '$xr31' is overlapped with
41 ;; the floating-point register '$f31' ('$fs7'). And '$f31' ('$fs7')
42 ;; is a callee-saved register which is preserved across calls.
43 ;; That's why the fst.d and fld.d instructions are emitted.
44 define void @register_xr31() nounwind {
45 ; CHECK-LABEL: register_xr31:
46 ; CHECK: # %bb.0: # %entry
47 ; CHECK-NEXT: addi.d $sp, $sp, -16
48 ; CHECK-NEXT: fst.d $fs7, $sp, 8 # 8-byte Folded Spill
50 ; CHECK-NEXT: xvldi $xr31, 1
52 ; CHECK-NEXT: fld.d $fs7, $sp, 8 # 8-byte Folded Reload
53 ; CHECK-NEXT: addi.d $sp, $sp, 16
56 %0 = tail call <4 x i64> asm sideeffect "xvldi ${0:u}, 1", "={$xr31}"()