Skip to content

Commit e1958eb

Browse files
committed
Fixes RVV masked intrinsics for iamax/iamin/imax/imin kernels
Changes masked intrinsics from _m to _mu and reintroduces maskedoff argument.
1 parent 62f0f50 commit e1958eb

File tree

4 files changed

+32
-32
lines changed

4 files changed

+32
-32
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);

0 commit comments

Comments
 (0)