You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: llvm/test/CodeGen/RISCV/rvv/vl-opt-instrs.ll
+100Lines changed: 100 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -2925,3 +2925,103 @@ define <vscale x 4 x i32> @vid.v(<vscale x 4 x i32> %c, iXLen %vl) {
2925
2925
%2 = call <vscale x 4 x i32> @llvm.riscv.vadd.nxv4i32.nxv4i32(<vscale x 4 x i32> poison, <vscale x 4 x i32> %1, <vscale x 4 x i32> %c, iXLen %vl)
2926
2926
ret <vscale x 4 x i32> %2
2927
2927
}
2928
+
2929
+
define <vscale x 4 x float> @vfadd_vv(<vscale x 4 x float> %a, <vscale x 4 x float> %b, iXLen %vl) {
2930
+
; NOVLOPT-LABEL: vfadd_vv:
2931
+
; NOVLOPT: # %bb.0:
2932
+
; NOVLOPT-NEXT: vsetvli a1, zero, e32, m2, ta, ma
2933
+
; NOVLOPT-NEXT: vfadd.vv v8, v8, v10
2934
+
; NOVLOPT-NEXT: vsetvli zero, a0, e32, m2, ta, ma
2935
+
; NOVLOPT-NEXT: vfadd.vv v8, v8, v10
2936
+
; NOVLOPT-NEXT: ret
2937
+
;
2938
+
; VLOPT-LABEL: vfadd_vv:
2939
+
; VLOPT: # %bb.0:
2940
+
; VLOPT-NEXT: vsetvli zero, a0, e32, m2, ta, ma
2941
+
; VLOPT-NEXT: vfadd.vv v8, v8, v10
2942
+
; VLOPT-NEXT: vfadd.vv v8, v8, v10
2943
+
; VLOPT-NEXT: ret
2944
+
%1 = call <vscale x 4 x float> @llvm.riscv.vfadd.nxv4f32.nxv4f32(<vscale x 4 x float> poison, <vscale x 4 x float> %a, <vscale x 4 x float> %b, iXLen 7, iXLen -1)
2945
+
%2 = call <vscale x 4 x float> @llvm.riscv.vfadd.nxv4f32.nxv4f32(<vscale x 4 x float> poison, <vscale x 4 x float> %1, <vscale x 4 x float> %b, iXLen 7, iXLen %vl)
2946
+
ret <vscale x 4 x float> %2
2947
+
}
2948
+
2949
+
define <vscale x 4 x float> @vfadd_vx(<vscale x 4 x float> %a, float%b, iXLen %vl) {
2950
+
; NOVLOPT-LABEL: vfadd_vx:
2951
+
; NOVLOPT: # %bb.0:
2952
+
; NOVLOPT-NEXT: vsetvli a1, zero, e32, m2, ta, ma
2953
+
; NOVLOPT-NEXT: vfadd.vf v10, v8, fa0
2954
+
; NOVLOPT-NEXT: vsetvli zero, a0, e32, m2, ta, ma
2955
+
; NOVLOPT-NEXT: vfadd.vv v8, v10, v8
2956
+
; NOVLOPT-NEXT: ret
2957
+
;
2958
+
; VLOPT-LABEL: vfadd_vx:
2959
+
; VLOPT: # %bb.0:
2960
+
; VLOPT-NEXT: vsetvli zero, a0, e32, m2, ta, ma
2961
+
; VLOPT-NEXT: vfadd.vf v10, v8, fa0
2962
+
; VLOPT-NEXT: vfadd.vv v8, v10, v8
2963
+
; VLOPT-NEXT: ret
2964
+
%1 = call <vscale x 4 x float> @llvm.riscv.vfadd.nxv4f32.nxv4f32(<vscale x 4 x float> poison, <vscale x 4 x float> %a, float%b, iXLen 7, iXLen -1)
2965
+
%2 = call <vscale x 4 x float> @llvm.riscv.vfadd.nxv4f32.nxv4f32(<vscale x 4 x float> poison, <vscale x 4 x float> %1, <vscale x 4 x float> %a, iXLen 7, iXLen %vl)
2966
+
ret <vscale x 4 x float> %2
2967
+
}
2968
+
2969
+
define <vscale x 4 x float> @vfsub_vv(<vscale x 4 x float> %a, <vscale x 4 x float> %b, iXLen %vl) {
2970
+
; NOVLOPT-LABEL: vfsub_vv:
2971
+
; NOVLOPT: # %bb.0:
2972
+
; NOVLOPT-NEXT: vsetvli a1, zero, e32, m2, ta, ma
2973
+
; NOVLOPT-NEXT: vfsub.vv v8, v8, v10
2974
+
; NOVLOPT-NEXT: vsetvli zero, a0, e32, m2, ta, ma
2975
+
; NOVLOPT-NEXT: vfadd.vv v8, v8, v10
2976
+
; NOVLOPT-NEXT: ret
2977
+
;
2978
+
; VLOPT-LABEL: vfsub_vv:
2979
+
; VLOPT: # %bb.0:
2980
+
; VLOPT-NEXT: vsetvli zero, a0, e32, m2, ta, ma
2981
+
; VLOPT-NEXT: vfsub.vv v8, v8, v10
2982
+
; VLOPT-NEXT: vfadd.vv v8, v8, v10
2983
+
; VLOPT-NEXT: ret
2984
+
%1 = call <vscale x 4 x float> @llvm.riscv.vfsub.nxv4f32.nxv4f32(<vscale x 4 x float> poison, <vscale x 4 x float> %a, <vscale x 4 x float> %b, iXLen 7, iXLen -1)
2985
+
%2 = call <vscale x 4 x float> @llvm.riscv.vfadd.nxv4f32.nxv4f32(<vscale x 4 x float> poison, <vscale x 4 x float> %1, <vscale x 4 x float> %b, iXLen 7, iXLen %vl)
2986
+
ret <vscale x 4 x float> %2
2987
+
}
2988
+
2989
+
define <vscale x 4 x float> @vfsub_vx(<vscale x 4 x float> %a, float%b, iXLen %vl) {
2990
+
; NOVLOPT-LABEL: vfsub_vx:
2991
+
; NOVLOPT: # %bb.0:
2992
+
; NOVLOPT-NEXT: vsetvli a1, zero, e32, m2, ta, ma
2993
+
; NOVLOPT-NEXT: vfsub.vf v10, v8, fa0
2994
+
; NOVLOPT-NEXT: vsetvli zero, a0, e32, m2, ta, ma
2995
+
; NOVLOPT-NEXT: vfadd.vv v8, v10, v8
2996
+
; NOVLOPT-NEXT: ret
2997
+
;
2998
+
; VLOPT-LABEL: vfsub_vx:
2999
+
; VLOPT: # %bb.0:
3000
+
; VLOPT-NEXT: vsetvli zero, a0, e32, m2, ta, ma
3001
+
; VLOPT-NEXT: vfsub.vf v10, v8, fa0
3002
+
; VLOPT-NEXT: vfadd.vv v8, v10, v8
3003
+
; VLOPT-NEXT: ret
3004
+
%1 = call <vscale x 4 x float> @llvm.riscv.vfsub.nxv4f32.nxv4f32(<vscale x 4 x float> poison, <vscale x 4 x float> %a, float%b, iXLen 7, iXLen -1)
3005
+
%2 = call <vscale x 4 x float> @llvm.riscv.vfadd.nxv4f32.nxv4f32(<vscale x 4 x float> poison, <vscale x 4 x float> %1, <vscale x 4 x float> %a, iXLen 7, iXLen %vl)
3006
+
ret <vscale x 4 x float> %2
3007
+
}
3008
+
3009
+
define <vscale x 4 x float> @vfrsub_vx(<vscale x 4 x float> %a, float%b, iXLen %vl) {
3010
+
; NOVLOPT-LABEL: vfrsub_vx:
3011
+
; NOVLOPT: # %bb.0:
3012
+
; NOVLOPT-NEXT: vsetvli a1, zero, e32, m2, ta, ma
3013
+
; NOVLOPT-NEXT: vfrsub.vf v10, v8, fa0
3014
+
; NOVLOPT-NEXT: vsetvli zero, a0, e32, m2, ta, ma
3015
+
; NOVLOPT-NEXT: vfadd.vv v8, v10, v8
3016
+
; NOVLOPT-NEXT: ret
3017
+
;
3018
+
; VLOPT-LABEL: vfrsub_vx:
3019
+
; VLOPT: # %bb.0:
3020
+
; VLOPT-NEXT: vsetvli zero, a0, e32, m2, ta, ma
3021
+
; VLOPT-NEXT: vfrsub.vf v10, v8, fa0
3022
+
; VLOPT-NEXT: vfadd.vv v8, v10, v8
3023
+
; VLOPT-NEXT: ret
3024
+
%1 = call <vscale x 4 x float> @llvm.riscv.vfrsub.nxv4f32.nxv4f32(<vscale x 4 x float> poison, <vscale x 4 x float> %a, float%b, iXLen 7, iXLen -1)
3025
+
%2 = call <vscale x 4 x float> @llvm.riscv.vfadd.nxv4f32.nxv4f32(<vscale x 4 x float> poison, <vscale x 4 x float> %1, <vscale x 4 x float> %a, iXLen 7, iXLen %vl)
0 commit comments