@@ -35,6 +35,7 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35
35
#define VFMACCVF_FLOAT vfmacc_vf_f32m4
36
36
#define VFMULVF_FLOAT vfmul_vf_f32m4
37
37
#define VFNMSACVF_FLOAT vfnmsac_vf_f32m4
38
+ #define VFMVVF_FLOAT vfmv_v_f_f32m4
38
39
#else
39
40
#define VSETVL (n ) vsetvl_e64m4(n)
40
41
#define VSETVL_MAX vsetvlmax_e64m1()
@@ -44,6 +45,7 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
44
45
#define VFMACCVF_FLOAT vfmacc_vf_f64m4
45
46
#define VFMULVF_FLOAT vfmul_vf_f64m4
46
47
#define VFNMSACVF_FLOAT vfnmsac_vf_f64m4
48
+ #define VFMVVF_FLOAT vfmv_v_f_f64m4
47
49
#endif
48
50
49
51
int CNAME (BLASLONG n , BLASLONG dummy0 , BLASLONG dummy1 , FLOAT da_r ,FLOAT da_i , FLOAT * x , BLASLONG inc_x , FLOAT * y , BLASLONG inc_y , FLOAT * dummy , BLASLONG dummy2 )
@@ -58,7 +60,26 @@ int CNAME(BLASLONG n, BLASLONG dummy0, BLASLONG dummy1, FLOAT da_r,FLOAT da_i, F
58
60
unsigned int gvl = 0 ;
59
61
FLOAT_V_T vt , v0 , v1 ;
60
62
if (da_r == 0.0 && da_i == 0.0 ){
61
- memset (& x [0 ], 0 , n * 2 * sizeof (FLOAT ));
63
+ gvl = VSETVL (n );
64
+ BLASLONG stride_x = inc_x * 2 * sizeof (FLOAT );
65
+ BLASLONG inc_xv = inc_x * 2 * gvl ;
66
+ vt = VFMVVF_FLOAT (0.0 , gvl );
67
+ for (i = 0 ,j = 0 ; i < n /(gvl * 2 ); i ++ ){
68
+ VSSEV_FLOAT (& x [ix ], stride_x , vt , gvl );
69
+ VSSEV_FLOAT (& x [ix + 1 ], stride_x , vt , gvl );
70
+ VSSEV_FLOAT (& x [ix + inc_xv ], stride_x , vt , gvl );
71
+ VSSEV_FLOAT (& x [ix + inc_xv + 1 ], stride_x , vt , gvl );
72
+
73
+ j += gvl * 2 ;
74
+ ix += inc_xv * 2 ;
75
+ }
76
+ for (; j < n ; ){
77
+ gvl = VSETVL (n - j );
78
+ VSSEV_FLOAT (& x [ix ], stride_x , vt , gvl );
79
+ VSSEV_FLOAT (& x [ix + 1 ], stride_x , vt , gvl );
80
+ j += gvl ;
81
+ ix += inc_x * 2 * gvl ;
82
+ }
62
83
}else if (da_r == 0.0 ){
63
84
gvl = VSETVL (n );
64
85
BLASLONG stride_x = inc_x * 2 * sizeof (FLOAT );
0 commit comments