Skip to content

Commit 2d316c2

Browse files
authored
Merge pull request #4125 from OMaghiarIMG/risc-v
Fixes RVV masked intrinsics for iamax/iamin/imax/imin kernels
2 parents 62f0f50 + 1e4a3a2 commit 2d316c2

File tree

6 files changed

+49
-49
lines changed

6 files changed

+49
-49
lines changed

kernel/riscv64/iamax_rvv.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4545
#define VFMAXVV_FLOAT __riscv_vfmax_vv_f64m8
4646
#define VFIRSTM __riscv_vfirst_m_b8
4747
#define UINT_V_T vuint64m8_t
48-
#define VIDV_MASK_UINT __riscv_vid_v_u64m8_m
48+
#define VIDV_MASK_UINT __riscv_vid_v_u64m8_mu
4949
#define VIDV_UINT __riscv_vid_v_u64m8
50-
#define VADDVX_MASK_UINT __riscv_vadd_vx_u64m8_m
50+
#define VADDVX_MASK_UINT __riscv_vadd_vx_u64m8_mu
5151
#define VADDVX_UINT __riscv_vadd_vx_u64m8
5252
#define VMVVX_UINT __riscv_vmv_v_x_u64m8
5353
#define VFMVFS_FLOAT_M1 __riscv_vfmv_f_s_f64m1_f64
@@ -71,9 +71,9 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
7171
#define VFMAXVV_FLOAT __riscv_vfmax_vv_f32m8
7272
#define VFIRSTM __riscv_vfirst_m_b4
7373
#define UINT_V_T vuint32m8_t
74-
#define VIDV_MASK_UINT __riscv_vid_v_u32m8_m
74+
#define VIDV_MASK_UINT __riscv_vid_v_u32m8_mu
7575
#define VIDV_UINT __riscv_vid_v_u32m8
76-
#define VADDVX_MASK_UINT __riscv_vadd_vx_u32m8_m
76+
#define VADDVX_MASK_UINT __riscv_vadd_vx_u32m8_mu
7777
#define VADDVX_UINT __riscv_vadd_vx_u32m8
7878
#define VMVVX_UINT __riscv_vmv_v_x_u32m8
7979
#define VFMVFS_FLOAT_M1 __riscv_vfmv_f_s_f32m1_f32
@@ -106,8 +106,8 @@ BLASLONG CNAME(BLASLONG n, FLOAT *x, BLASLONG inc_x)
106106

107107
//index where element greater than v_max
108108
mask = VMFLTVV_FLOAT(v_max, vx, vl);
109-
v_max_index = VIDV_MASK_UINT(mask, vl);
110-
v_max_index = VADDVX_MASK_UINT(mask, v_max_index, j, vl);
109+
v_max_index = VIDV_MASK_UINT(mask, v_max_index, vl);
110+
v_max_index = VADDVX_MASK_UINT(mask, v_max_index, v_max_index, j, vl);
111111

112112
//update v_max
113113
v_max = VFMAXVV_FLOAT(v_max, vx, vl);
@@ -125,8 +125,8 @@ BLASLONG CNAME(BLASLONG n, FLOAT *x, BLASLONG inc_x)
125125

126126
//index where element greater than v_max
127127
mask = VMFLTVV_FLOAT(v_max, vx, vl);
128-
v_max_index = VIDV_MASK_UINT(mask, vl);
129-
v_max_index = VADDVX_MASK_UINT(mask, v_max_index, j, vl);
128+
v_max_index = VIDV_MASK_UINT(mask, v_max_index, vl);
129+
v_max_index = VADDVX_MASK_UINT(mask, v_max_index, v_max_index, j, vl);
130130

131131
//update v_max
132132
v_max = VFMAXVV_FLOAT(v_max, vx, vl);

kernel/riscv64/iamin_rvv.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4646
#define VFMINVV_FLOAT __riscv_vfmin_vv_f64m8
4747
#define VFIRSTM __riscv_vfirst_m_b8
4848
#define UINT_V_T vuint64m8_t
49-
#define VIDV_MASK_UINT __riscv_vid_v_u64m8_m
49+
#define VIDV_MASK_UINT __riscv_vid_v_u64m8_mu
5050
#define VIDV_UINT __riscv_vid_v_u64m8
51-
#define VADDVX_MASK_UINT __riscv_vadd_vx_u64m8_m
51+
#define VADDVX_MASK_UINT __riscv_vadd_vx_u64m8_mu
5252
#define VADDVX_UINT __riscv_vadd_vx_u64m8
5353
#define VMVVX_UINT __riscv_vmv_v_x_u64m8
5454
#define VFMVFS_FLOAT_M1 __riscv_vfmv_f_s_f64m1_f64
@@ -72,9 +72,9 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
7272
#define VFMINVV_FLOAT __riscv_vfmin_vv_f32m8
7373
#define VFIRSTM __riscv_vfirst_m_b4
7474
#define UINT_V_T vuint32m8_t
75-
#define VIDV_MASK_UINT __riscv_vid_v_u32m8_m
75+
#define VIDV_MASK_UINT __riscv_vid_v_u32m8_mu
7676
#define VIDV_UINT __riscv_vid_v_u32m8
77-
#define VADDVX_MASK_UINT __riscv_vadd_vx_u32m8_m
77+
#define VADDVX_MASK_UINT __riscv_vadd_vx_u32m8_mu
7878
#define VADDVX_UINT __riscv_vadd_vx_u32m8
7979
#define VMVVX_UINT __riscv_vmv_v_x_u32m8
8080
#define VFMVFS_FLOAT_M1 __riscv_vfmv_f_s_f32m1_f32
@@ -107,8 +107,8 @@ BLASLONG CNAME(BLASLONG n, FLOAT *x, BLASLONG inc_x)
107107

108108
// index where element less than v_min
109109
mask = VMFLTVV_FLOAT(vx, v_min, vl);
110-
v_min_index = VIDV_MASK_UINT(mask, vl);
111-
v_min_index = VADDVX_MASK_UINT(mask, v_min_index, j, vl);
110+
v_min_index = VIDV_MASK_UINT(mask, v_min_index, vl);
111+
v_min_index = VADDVX_MASK_UINT(mask, v_min_index, v_min_index, j, vl);
112112

113113
//update v_min and start_index j
114114
v_min = VFMINVV_FLOAT(v_min, vx, vl);
@@ -126,8 +126,8 @@ BLASLONG CNAME(BLASLONG n, FLOAT *x, BLASLONG inc_x)
126126

127127
// index where element less than v_min
128128
mask = VMFLTVV_FLOAT(vx, v_min, vl);
129-
v_min_index = VIDV_MASK_UINT(mask, vl);
130-
v_min_index = VADDVX_MASK_UINT(mask, v_min_index, j, vl);
129+
v_min_index = VIDV_MASK_UINT(mask, v_min_index, vl);
130+
v_min_index = VADDVX_MASK_UINT(mask, v_min_index, v_min_index, j, vl);
131131

132132
//update v_min and start_index j
133133
v_min = VFMINVV_FLOAT(v_min, vx, vl);

kernel/riscv64/imax_rvv.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4545
#define VFMAXVV_FLOAT __riscv_vfmax_vv_f64m8
4646
#define VFIRSTM __riscv_vfirst_m_b8
4747
#define UINT_V_T vuint64m8_t
48-
#define VIDV_MASK_UINT __riscv_vid_v_u64m8_m
48+
#define VIDV_MASK_UINT __riscv_vid_v_u64m8_mu
4949
#define VIDV_UINT __riscv_vid_v_u64m8
50-
#define VADDVX_MASK_UINT __riscv_vadd_vx_u64m8_m
50+
#define VADDVX_MASK_UINT __riscv_vadd_vx_u64m8_mu
5151
#define VADDVX_UINT __riscv_vadd_vx_u64m8
5252
#define VMVVX_UINT __riscv_vmv_v_x_u64m8
5353
#define VFMVFS_FLOAT_M1 __riscv_vfmv_f_s_f64m1_f64
@@ -70,9 +70,9 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
7070
#define VFMAXVV_FLOAT __riscv_vfmax_vv_f32m8
7171
#define VFIRSTM __riscv_vfirst_m_b4
7272
#define UINT_V_T vuint32m8_t
73-
#define VIDV_MASK_UINT __riscv_vid_v_u32m8_m
73+
#define VIDV_MASK_UINT __riscv_vid_v_u32m8_mu
7474
#define VIDV_UINT __riscv_vid_v_u32m8
75-
#define VADDVX_MASK_UINT __riscv_vadd_vx_u32m8_m
75+
#define VADDVX_MASK_UINT __riscv_vadd_vx_u32m8_mu
7676
#define VADDVX_UINT __riscv_vadd_vx_u32m8
7777
#define VMVVX_UINT __riscv_vmv_v_x_u32m8
7878
#define VFMVFS_FLOAT_M1 __riscv_vfmv_f_s_f32m1_f32
@@ -104,8 +104,8 @@ BLASLONG CNAME(BLASLONG n, FLOAT *x, BLASLONG inc_x)
104104

105105
//index where element greater than v_max
106106
mask = VMFLTVV_FLOAT(v_max, vx, vl);
107-
v_max_index = VIDV_MASK_UINT(mask, vl);
108-
v_max_index = VADDVX_MASK_UINT(mask, v_max_index, j, vl);
107+
v_max_index = VIDV_MASK_UINT(mask, v_max_index, vl);
108+
v_max_index = VADDVX_MASK_UINT(mask, v_max_index, v_max_index, j, vl);
109109

110110
//update v_max and start_index j
111111
v_max = VFMAXVV_FLOAT(v_max, vx, vl);
@@ -122,8 +122,8 @@ BLASLONG CNAME(BLASLONG n, FLOAT *x, BLASLONG inc_x)
122122

123123
//index where element greater than v_max
124124
mask = VMFLTVV_FLOAT(v_max, vx, vl);
125-
v_max_index = VIDV_MASK_UINT(mask, vl);
126-
v_max_index = VADDVX_MASK_UINT(mask, v_max_index, j, vl);
125+
v_max_index = VIDV_MASK_UINT(mask, v_max_index, vl);
126+
v_max_index = VADDVX_MASK_UINT(mask, v_max_index, v_max_index, j, vl);
127127

128128
//update v_max and start_index j
129129
v_max = VFMAXVV_FLOAT(v_max, vx, vl);

kernel/riscv64/imin_rvv.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4545
#define VFMINVV_FLOAT __riscv_vfmin_vv_f64m8
4646
#define VFIRSTM __riscv_vfirst_m_b8
4747
#define UINT_V_T vuint64m8_t
48-
#define VIDV_MASK_UINT __riscv_vid_v_u64m8_m
48+
#define VIDV_MASK_UINT __riscv_vid_v_u64m8_mu
4949
#define VIDV_UINT __riscv_vid_v_u64m8
50-
#define VADDVX_MASK_UINT __riscv_vadd_vx_u64m8_m
50+
#define VADDVX_MASK_UINT __riscv_vadd_vx_u64m8_mu
5151
#define VADDVX_UINT __riscv_vadd_vx_u64m8
5252
#define VMVVX_UINT __riscv_vmv_v_x_u64m8
5353
#define VFMVFS_FLOAT_M1 __riscv_vfmv_f_s_f64m1_f64
@@ -70,9 +70,9 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
7070
#define VFMINVV_FLOAT __riscv_vfmin_vv_f32m8
7171
#define VFIRSTM __riscv_vfirst_m_b4
7272
#define UINT_V_T vuint32m8_t
73-
#define VIDV_MASK_UINT __riscv_vid_v_u32m8_m
73+
#define VIDV_MASK_UINT __riscv_vid_v_u32m8_mu
7474
#define VIDV_UINT __riscv_vid_v_u32m8
75-
#define VADDVX_MASK_UINT __riscv_vadd_vx_u32m8_m
75+
#define VADDVX_MASK_UINT __riscv_vadd_vx_u32m8_mu
7676
#define VADDVX_UINT __riscv_vadd_vx_u32m8
7777
#define VMVVX_UINT __riscv_vmv_v_x_u32m8
7878
#define VFMVFS_FLOAT_M1 __riscv_vfmv_f_s_f32m1_f32
@@ -104,8 +104,8 @@ BLASLONG CNAME(BLASLONG n, FLOAT *x, BLASLONG inc_x)
104104

105105
// index where element less than v_min
106106
mask = VMFLTVV_FLOAT(vx, v_min, vl);
107-
v_min_index = VIDV_MASK_UINT(mask, vl);
108-
v_min_index = VADDVX_MASK_UINT(mask, v_min_index, j, vl);
107+
v_min_index = VIDV_MASK_UINT(mask, v_min_index, vl);
108+
v_min_index = VADDVX_MASK_UINT(mask, v_min_index, v_min_index, j, vl);
109109

110110
//update v_min and start_index j
111111
v_min = VFMINVV_FLOAT(v_min, vx, vl);
@@ -122,8 +122,8 @@ BLASLONG CNAME(BLASLONG n, FLOAT *x, BLASLONG inc_x)
122122

123123
// index where element less than v_min
124124
mask = VMFLTVV_FLOAT(vx, v_min, vl);
125-
v_min_index = VIDV_MASK_UINT(mask, vl);
126-
v_min_index = VADDVX_MASK_UINT(mask, v_min_index, j, vl);
125+
v_min_index = VIDV_MASK_UINT(mask, v_min_index, vl);
126+
v_min_index = VADDVX_MASK_UINT(mask, v_min_index, v_min_index, j, vl);
127127

128128
//update v_min and start_index j
129129
v_min = VFMINVV_FLOAT(v_min, vx, vl);

kernel/riscv64/izamax_rvv.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4848
#define VFADDVV_FLOAT __riscv_vfadd_vv_f64m4
4949
#define VFIRSTM __riscv_vfirst_m_b16
5050
#define UINT_V_T vuint64m4_t
51-
#define VIDV_MASK_UINT __riscv_vid_v_u64m4_m
51+
#define VIDV_MASK_UINT __riscv_vid_v_u64m4_mu
5252
#define VIDV_UINT __riscv_vid_v_u64m4
53-
#define VADDVX_MASK_UINT __riscv_vadd_vx_u64m4_m
53+
#define VADDVX_MASK_UINT __riscv_vadd_vx_u64m4_mu
5454
#define VADDVX_UINT __riscv_vadd_vx_u64m4
5555
#define VMVVX_UINT __riscv_vmv_v_x_u64m4
5656
#define VFMVFS_FLOAT_M1 __riscv_vfmv_f_s_f64m1_f64
@@ -77,9 +77,9 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
7777
#define VFADDVV_FLOAT __riscv_vfadd_vv_f32m4
7878
#define VFIRSTM __riscv_vfirst_m_b8
7979
#define UINT_V_T vuint32m4_t
80-
#define VIDV_MASK_UINT __riscv_vid_v_u32m4_m
80+
#define VIDV_MASK_UINT __riscv_vid_v_u32m4_mu
8181
#define VIDV_UINT __riscv_vid_v_u32m4
82-
#define VADDVX_MASK_UINT __riscv_vadd_vx_u32m4_m
82+
#define VADDVX_MASK_UINT __riscv_vadd_vx_u32m4_mu
8383
#define VADDVX_UINT __riscv_vadd_vx_u32m4
8484
#define VMVVX_UINT __riscv_vmv_v_x_u32m4
8585
#define VFMVFS_FLOAT_M1 __riscv_vfmv_f_s_f32m1_f32
@@ -116,8 +116,8 @@ BLASLONG CNAME(BLASLONG n, FLOAT *x, BLASLONG inc_x)
116116

117117
//index where element greater than v_max
118118
mask = VMFLTVV_FLOAT(v_max, vx0, vl);
119-
v_max_index = VIDV_MASK_UINT(mask, vl);
120-
v_max_index = VADDVX_MASK_UINT(mask, v_max_index, j, vl);
119+
v_max_index = VIDV_MASK_UINT(mask, v_max_index, vl);
120+
v_max_index = VADDVX_MASK_UINT(mask, v_max_index, v_max_index, j, vl);
121121

122122
//update v_max and start_index j
123123
v_max = VFMAXVV_FLOAT(v_max, vx0, vl);
@@ -138,9 +138,9 @@ BLASLONG CNAME(BLASLONG n, FLOAT *x, BLASLONG inc_x)
138138

139139
//index where element greater than v_max
140140
mask = VMFLTVV_FLOAT(v_max, vx0, vl);
141-
v_max_index = VIDV_MASK_UINT(mask, vl);
142-
v_max_index = VADDVX_MASK_UINT(mask, v_max_index, j, vl);
143-
141+
v_max_index = VIDV_MASK_UINT(mask, v_max_index, vl);
142+
v_max_index = VADDVX_MASK_UINT(mask, v_max_index, v_max_index, j, vl);
143+
144144
//update v_max and start_index j
145145
v_max = VFMAXVV_FLOAT(v_max, vx0, vl);
146146
}

kernel/riscv64/izamin_rvv.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4747
#define VFADDVV_FLOAT __riscv_vfadd_vv_f64m4
4848
#define VFIRSTM __riscv_vfirst_m_b16
4949
#define UINT_V_T vuint64m4_t
50-
#define VIDV_MASK_UINT __riscv_vid_v_u64m4_m
50+
#define VIDV_MASK_UINT __riscv_vid_v_u64m4_mu
5151
#define VIDV_UINT __riscv_vid_v_u64m4
52-
#define VADDVX_MASK_UINT __riscv_vadd_vx_u64m4_m
52+
#define VADDVX_MASK_UINT __riscv_vadd_vx_u64m4_mu
5353
#define VADDVX_UINT __riscv_vadd_vx_u64m4
5454
#define VMVVX_UINT __riscv_vmv_v_x_u64m4
5555
#define VFMVFS_FLOAT_M1 __riscv_vfmv_f_s_f64m1_f64
@@ -74,9 +74,9 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
7474
#define VFADDVV_FLOAT __riscv_vfadd_vv_f32m4
7575
#define VFIRSTM __riscv_vfirst_m_b8
7676
#define UINT_V_T vuint32m4_t
77-
#define VIDV_MASK_UINT __riscv_vid_v_u32m4_m
77+
#define VIDV_MASK_UINT __riscv_vid_v_u32m4_mu
7878
#define VIDV_UINT __riscv_vid_v_u32m4
79-
#define VADDVX_MASK_UINT __riscv_vadd_vx_u32m4_m
79+
#define VADDVX_MASK_UINT __riscv_vadd_vx_u32m4_mu
8080
#define VADDVX_UINT __riscv_vadd_vx_u32m4
8181
#define VMVVX_UINT __riscv_vmv_v_x_u32m4
8282
#define VFMVFS_FLOAT_M1 __riscv_vfmv_f_s_f32m1_f32
@@ -113,8 +113,8 @@ BLASLONG CNAME(BLASLONG n, FLOAT *x, BLASLONG inc_x)
113113

114114
// index where element less than v_min
115115
mask = VMFLTVV_FLOAT(vx0, v_min, vl);
116-
v_min_index = VIDV_MASK_UINT(mask, vl);
117-
v_min_index = VADDVX_MASK_UINT(mask, v_min_index, j, vl);
116+
v_min_index = VIDV_MASK_UINT(mask, v_min_index, vl);
117+
v_min_index = VADDVX_MASK_UINT(mask, v_min_index, v_min_index, j, vl);
118118

119119
//update v_min and start_index j
120120
v_min = VFMINVV_FLOAT(v_min, vx0, vl);
@@ -136,8 +136,8 @@ BLASLONG CNAME(BLASLONG n, FLOAT *x, BLASLONG inc_x)
136136

137137
// index where element less than v_min
138138
mask = VMFLTVV_FLOAT(vx0, v_min, vl);
139-
v_min_index = VIDV_MASK_UINT(mask, vl);
140-
v_min_index = VADDVX_MASK_UINT(mask, v_min_index, j, vl);
139+
v_min_index = VIDV_MASK_UINT(mask, v_min_index, vl);
140+
v_min_index = VADDVX_MASK_UINT(mask, v_min_index, v_min_index, j, vl);
141141

142142
//update v_min and start_index j
143143
v_min = VFMINVV_FLOAT(v_min, vx0, vl);

0 commit comments

Comments
 (0)