Skip to content

Commit d00cc40

Browse files
author
tingbo.liao
committed
Replaced the __riscv_vid_v_i32m2 and __riscv_vid_v_i64m2 with __riscv_vid_v_u32m2 and __riscv_vid_v_u64m2 for riscv64-unknown-linux-gnu-gcc compiling.
Signed-off-by: tingbo.liao <tingbo.liao@starfivetech.com>
1 parent 229d8a0 commit d00cc40

File tree

7 files changed

+40
-29
lines changed

7 files changed

+40
-29
lines changed

kernel/riscv64/symm_lcopy_rvv_v1.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,12 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3535
#define VSEV_FLOAT __riscv_vse32_v_f32m2
3636
#define VLSEV_FLOAT __riscv_vlse32_v_f32m2
3737
#define INT_V_T vint32m2_t
38-
#define VID_V_INT __riscv_vid_v_i32m2
38+
#define VID_V_INT __riscv_vid_v_u32m2
3939
#define VADD_VX_INT __riscv_vadd_vx_i32m2
4040
#define VMSGT_VX_INT __riscv_vmsgt_vx_i32m2_b16
4141
#define VBOOL_T vbool16_t
4242
#define VMERGE_VVM_FLOAT __riscv_vmerge_vvm_f32m2
43+
#define V_UM2_TO_IM2 __riscv_vreinterpret_v_u32m2_i32m2
4344
#else
4445
#define VSETVL(n) __riscv_vsetvl_e64m2(n)
4546
#define VSETVL_MAX __riscv_vsetvlmax_e64m2()
@@ -48,11 +49,12 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4849
#define VSEV_FLOAT __riscv_vse64_v_f64m2
4950
#define VLSEV_FLOAT __riscv_vlse64_v_f64m2
5051
#define INT_V_T vint64m2_t
51-
#define VID_V_INT __riscv_vid_v_i64m2
52+
#define VID_V_INT __riscv_vid_v_u64m2
5253
#define VADD_VX_INT __riscv_vadd_vx_i64m2
5354
#define VMSGT_VX_INT __riscv_vmsgt_vx_i64m2_b32
5455
#define VBOOL_T vbool32_t
5556
#define VMERGE_VVM_FLOAT __riscv_vmerge_vvm_f64m2
57+
#define V_UM2_TO_IM2 __riscv_vreinterpret_v_u64m2_i64m2
5658
#endif
5759

5860
// Optimizes the implementation in ../generic/symm_lcopy_4.c
@@ -70,7 +72,7 @@ int CNAME(BLASLONG m, BLASLONG n, FLOAT *a, BLASLONG lda, BLASLONG posX, BLASLON
7072
INT_V_T vindex_max, vindex;
7173

7274
size_t vl = VSETVL_MAX;
73-
vindex_max = VID_V_INT(vl);
75+
vindex_max = V_UM2_TO_IM2(VID_V_INT(vl));
7476

7577
for (js = n; js > 0; js -= vl, posX += vl) {
7678
vl = VSETVL(js);
@@ -98,4 +100,3 @@ int CNAME(BLASLONG m, BLASLONG n, FLOAT *a, BLASLONG lda, BLASLONG posX, BLASLON
98100

99101
return 0;
100102
}
101-

kernel/riscv64/symm_ucopy_rvv_v1.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,12 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3535
#define VSEV_FLOAT __riscv_vse32_v_f32m2
3636
#define VLSEV_FLOAT __riscv_vlse32_v_f32m2
3737
#define INT_V_T vint32m2_t
38-
#define VID_V_INT __riscv_vid_v_i32m2
38+
#define VID_V_INT __riscv_vid_v_u32m2
3939
#define VADD_VX_INT __riscv_vadd_vx_i32m2
4040
#define VMSGT_VX_INT __riscv_vmsgt_vx_i32m2_b16
4141
#define VBOOL_T vbool16_t
4242
#define VMERGE_VVM_FLOAT __riscv_vmerge_vvm_f32m2
43+
#define V_UM2_TO_IM2 __riscv_vreinterpret_v_u32m2_i32m2
4344
#else
4445
#define VSETVL(n) __riscv_vsetvl_e64m2(n)
4546
#define VSETVL_MAX __riscv_vsetvlmax_e64m2()
@@ -48,11 +49,12 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4849
#define VSEV_FLOAT __riscv_vse64_v_f64m2
4950
#define VLSEV_FLOAT __riscv_vlse64_v_f64m2
5051
#define INT_V_T vint64m2_t
51-
#define VID_V_INT __riscv_vid_v_i64m2
52+
#define VID_V_INT __riscv_vid_v_u64m2
5253
#define VADD_VX_INT __riscv_vadd_vx_i64m2
5354
#define VMSGT_VX_INT __riscv_vmsgt_vx_i64m2_b32
5455
#define VBOOL_T vbool32_t
5556
#define VMERGE_VVM_FLOAT __riscv_vmerge_vvm_f64m2
57+
#define V_UM2_TO_IM2 __riscv_vreinterpret_v_u64m2_i64m2
5658
#endif
5759

5860
// Optimizes the implementation in ../generic/symm_ucopy_4.c
@@ -70,7 +72,7 @@ int CNAME(BLASLONG m, BLASLONG n, FLOAT *a, BLASLONG lda, BLASLONG posX, BLASLON
7072
INT_V_T vindex_max, vindex;
7173

7274
size_t vl = VSETVL_MAX;
73-
vindex_max = VID_V_INT(vl);
75+
vindex_max = V_UM2_TO_IM2(VID_V_INT(vl));
7476

7577
for (js = n; js > 0; js -= vl, posX += vl) {
7678
vl = VSETVL(js);
@@ -97,4 +99,4 @@ int CNAME(BLASLONG m, BLASLONG n, FLOAT *a, BLASLONG lda, BLASLONG posX, BLASLON
9799
}
98100

99101
return 0;
100-
}
102+
}

kernel/riscv64/zhemm_ltcopy_rvv_v1.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4141
#define VLSSEG2_FLOAT __riscv_vlsseg2e32_v_f32m2x2
4242
#define VSSEG2_FLOAT __riscv_vsseg2e32_v_f32m2x2
4343
#define INT_V_T vint32m2_t
44-
#define VID_V_INT __riscv_vid_v_i32m2
44+
#define VID_V_INT __riscv_vid_v_u32m2
4545
#define VADD_VX_INT __riscv_vadd_vx_i32m2
4646
#define VFRSUB_VF_FLOAT __riscv_vfrsub_vf_f32m2
4747
#define VMSGT_VX_INT __riscv_vmsgt_vx_i32m2_b16
@@ -50,6 +50,7 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
5050
#define VBOOL_T vbool16_t
5151
#define VMERGE_VVM_FLOAT __riscv_vmerge_vvm_f32m2
5252
#define VFMVVF_FLOAT __riscv_vfmv_v_f_f32m2
53+
#define V_UM2_TO_IM2 __riscv_vreinterpret_v_u32m2_i32m2
5354
#else
5455
#define VSETVL(n) __riscv_vsetvl_e64m2(n)
5556
#define VSETVL_MAX __riscv_vsetvlmax_e64m2()
@@ -64,7 +65,7 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
6465
#define VLSSEG2_FLOAT __riscv_vlsseg2e64_v_f64m2x2
6566
#define VSSEG2_FLOAT __riscv_vsseg2e64_v_f64m2x2
6667
#define INT_V_T vint64m2_t
67-
#define VID_V_INT __riscv_vid_v_i64m2
68+
#define VID_V_INT __riscv_vid_v_u64m2
6869
#define VADD_VX_INT __riscv_vadd_vx_i64m2
6970
#define VFRSUB_VF_FLOAT __riscv_vfrsub_vf_f64m2
7071
#define VMSGT_VX_INT __riscv_vmsgt_vx_i64m2_b32
@@ -73,6 +74,7 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
7374
#define VBOOL_T vbool32_t
7475
#define VMERGE_VVM_FLOAT __riscv_vmerge_vvm_f64m2
7576
#define VFMVVF_FLOAT __riscv_vfmv_v_f_f64m2
77+
#define V_UM2_TO_IM2 __riscv_vreinterpret_v_u64m2_i64m2
7678
#endif
7779

7880

@@ -92,7 +94,7 @@ int CNAME(BLASLONG m, BLASLONG n, FLOAT *a, BLASLONG lda, BLASLONG posX, BLASLON
9294
INT_V_T vindex_max, vindex;
9395

9496
size_t vl = VSETVL_MAX;
95-
vindex_max = VID_V_INT(vl);
97+
vindex_max = V_UM2_TO_IM2(VID_V_INT(vl));
9698
vzero = VFMVVF_FLOAT(ZERO, vl);
9799

98100
for (js = n; js > 0; js -= vl, posX += vl) {
@@ -136,4 +138,3 @@ int CNAME(BLASLONG m, BLASLONG n, FLOAT *a, BLASLONG lda, BLASLONG posX, BLASLON
136138

137139
return 0;
138140
}
139-

kernel/riscv64/zhemm_utcopy_rvv_v1.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4141
#define VLSSEG2_FLOAT __riscv_vlsseg2e32_v_f32m2x2
4242
#define VSSEG2_FLOAT __riscv_vsseg2e32_v_f32m2x2
4343
#define INT_V_T vint32m2_t
44-
#define VID_V_INT __riscv_vid_v_i32m2
44+
#define VID_V_INT __riscv_vid_v_u32m2
4545
#define VADD_VX_INT __riscv_vadd_vx_i32m2
4646
#define VFRSUB_VF_FLOAT __riscv_vfrsub_vf_f32m2
4747
#define VMSGT_VX_INT __riscv_vmsgt_vx_i32m2_b16
@@ -50,6 +50,7 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
5050
#define VBOOL_T vbool16_t
5151
#define VMERGE_VVM_FLOAT __riscv_vmerge_vvm_f32m2
5252
#define VFMVVF_FLOAT __riscv_vfmv_v_f_f32m2
53+
#define V_UM2_TO_IM2 __riscv_vreinterpret_v_u32m2_i32m2
5354
#else
5455
#define VSETVL(n) __riscv_vsetvl_e64m2(n)
5556
#define VSETVL_MAX __riscv_vsetvlmax_e64m2()
@@ -64,7 +65,7 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
6465
#define VLSSEG2_FLOAT __riscv_vlsseg2e64_v_f64m2x2
6566
#define VSSEG2_FLOAT __riscv_vsseg2e64_v_f64m2x2
6667
#define INT_V_T vint64m2_t
67-
#define VID_V_INT __riscv_vid_v_i64m2
68+
#define VID_V_INT __riscv_vid_v_u64m2
6869
#define VADD_VX_INT __riscv_vadd_vx_i64m2
6970
#define VFRSUB_VF_FLOAT __riscv_vfrsub_vf_f64m2
7071
#define VMSGT_VX_INT __riscv_vmsgt_vx_i64m2_b32
@@ -73,6 +74,7 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
7374
#define VBOOL_T vbool32_t
7475
#define VMERGE_VVM_FLOAT __riscv_vmerge_vvm_f64m2
7576
#define VFMVVF_FLOAT __riscv_vfmv_v_f_f64m2
77+
#define V_UM2_TO_IM2 __riscv_vreinterpret_v_u64m2_i64m2
7678
#endif
7779

7880

@@ -90,7 +92,7 @@ int CNAME(BLASLONG m, BLASLONG n, FLOAT *a, BLASLONG lda, BLASLONG posX, BLASLON
9092
INT_V_T vindex_max, vindex;
9193

9294
size_t vl = VSETVL_MAX;
93-
vindex_max = VID_V_INT(vl);
95+
vindex_max = V_UM2_TO_IM2(VID_V_INT(vl));
9496
vzero = VFMVVF_FLOAT(ZERO, vl);
9597

9698
for (js = n; js > 0; js -= vl, posX += vl) {
@@ -132,4 +134,4 @@ int CNAME(BLASLONG m, BLASLONG n, FLOAT *a, BLASLONG lda, BLASLONG posX, BLASLON
132134
}
133135

134136
return 0;
135-
}
137+
}

kernel/riscv64/zsymm_lcopy_rvv_v1.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,12 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4141
#define VLSSEG2_FLOAT __riscv_vlsseg2e32_v_f32m2x2
4242
#define VSSEG2_FLOAT __riscv_vsseg2e32_v_f32m2x2
4343
#define INT_V_T vint32m2_t
44-
#define VID_V_INT __riscv_vid_v_i32m2
44+
#define VID_V_INT __riscv_vid_v_u32m2
4545
#define VADD_VX_INT __riscv_vadd_vx_i32m2
4646
#define VMSGT_VX_INT __riscv_vmsgt_vx_i32m2_b16
4747
#define VBOOL_T vbool16_t
4848
#define VMERGE_VVM_FLOAT __riscv_vmerge_vvm_f32m2
49+
#define V_UM2_TO_IM2 __riscv_vreinterpret_v_u32m2_i32m2
4950
#else
5051
#define VSETVL(n) __riscv_vsetvl_e64m2(n)
5152
#define VSETVL_MAX __riscv_vsetvlmax_e64m2()
@@ -60,11 +61,12 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
6061
#define VLSSEG2_FLOAT __riscv_vlsseg2e64_v_f64m2x2
6162
#define VSSEG2_FLOAT __riscv_vsseg2e64_v_f64m2x2
6263
#define INT_V_T vint64m2_t
63-
#define VID_V_INT __riscv_vid_v_i64m2
64+
#define VID_V_INT __riscv_vid_v_u64m2
6465
#define VADD_VX_INT __riscv_vadd_vx_i64m2
6566
#define VMSGT_VX_INT __riscv_vmsgt_vx_i64m2_b32
6667
#define VBOOL_T vbool32_t
6768
#define VMERGE_VVM_FLOAT __riscv_vmerge_vvm_f64m2
69+
#define V_UM2_TO_IM2 __riscv_vreinterpret_v_u64m2_i64m2
6870
#endif
6971

7072
int CNAME(BLASLONG m, BLASLONG n, FLOAT *a, BLASLONG lda, BLASLONG posX, BLASLONG posY, FLOAT *b)
@@ -81,7 +83,7 @@ int CNAME(BLASLONG m, BLASLONG n, FLOAT *a, BLASLONG lda, BLASLONG posX, BLASLON
8183
INT_V_T vindex_max, vindex;
8284

8385
size_t vl = VSETVL_MAX;
84-
vindex_max = VID_V_INT(vl);
86+
vindex_max = V_UM2_TO_IM2(VID_V_INT(vl));
8587

8688
for (js = n; js > 0; js -= vl, posX += vl) {
8789
vl = VSETVL(js);
@@ -118,4 +120,3 @@ int CNAME(BLASLONG m, BLASLONG n, FLOAT *a, BLASLONG lda, BLASLONG posX, BLASLON
118120

119121
return 0;
120122
}
121-

kernel/riscv64/zsymm_ucopy_rvv_v1.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,12 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4141
#define VLSSEG2_FLOAT __riscv_vlsseg2e32_v_f32m2x2
4242
#define VSSEG2_FLOAT __riscv_vsseg2e32_v_f32m2x2
4343
#define INT_V_T vint32m2_t
44-
#define VID_V_INT __riscv_vid_v_i32m2
44+
#define VID_V_INT __riscv_vid_v_u32m2
4545
#define VADD_VX_INT __riscv_vadd_vx_i32m2
4646
#define VMSGT_VX_INT __riscv_vmsgt_vx_i32m2_b16
4747
#define VBOOL_T vbool16_t
4848
#define VMERGE_VVM_FLOAT __riscv_vmerge_vvm_f32m2
49+
#define V_UM2_TO_IM2 __riscv_vreinterpret_v_u32m2_i32m2
4950
#else
5051
#define VSETVL(n) __riscv_vsetvl_e64m2(n)
5152
#define VSETVL_MAX __riscv_vsetvlmax_e64m2()
@@ -60,11 +61,12 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
6061
#define VLSSEG2_FLOAT __riscv_vlsseg2e64_v_f64m2x2
6162
#define VSSEG2_FLOAT __riscv_vsseg2e64_v_f64m2x2
6263
#define INT_V_T vint64m2_t
63-
#define VID_V_INT __riscv_vid_v_i64m2
64+
#define VID_V_INT __riscv_vid_v_u64m2
6465
#define VADD_VX_INT __riscv_vadd_vx_i64m2
6566
#define VMSGT_VX_INT __riscv_vmsgt_vx_i64m2_b32
6667
#define VBOOL_T vbool32_t
6768
#define VMERGE_VVM_FLOAT __riscv_vmerge_vvm_f64m2
69+
#define V_UM2_TO_IM2 __riscv_vreinterpret_v_u64m2_i64m2
6870
#endif
6971

7072

@@ -83,7 +85,7 @@ int CNAME(BLASLONG m, BLASLONG n, FLOAT *a, BLASLONG lda, BLASLONG posX, BLASLON
8385

8486

8587
size_t vl = VSETVL_MAX;
86-
vindex_max = VID_V_INT(vl);
88+
vindex_max = V_UM2_TO_IM2(VID_V_INT(vl));
8789

8890
for (js = n; js > 0; js -= vl, posX += vl) {
8991
vl = VSETVL(js);
@@ -118,4 +120,4 @@ int CNAME(BLASLONG m, BLASLONG n, FLOAT *a, BLASLONG lda, BLASLONG posX, BLASLON
118120
}
119121

120122
return 0;
121-
}
123+
}

kernel/riscv64/ztrmm_lncopy_rvv_v1.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,11 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4242
#define VSSEG2_FLOAT __riscv_vsseg2e32_v_f32m2x2
4343
#define VBOOL_T vbool16_t
4444
#define UINT_V_T vint32m2_t
45-
#define VID_V_UINT __riscv_vid_v_i32m2
45+
#define VID_V_UINT __riscv_vid_v_u32m2
4646
#define VMSGTU_VX_UINT __riscv_vmsgt_vx_i32m2_b16
4747
#define VMSEQ_VX_UINT __riscv_vmseq_vx_i32m2_b16
4848
#define VFMERGE_VFM_FLOAT __riscv_vfmerge_vfm_f32m2
49+
#define V_UM2_TO_IM2 __riscv_vreinterpret_v_u32m2_i32m2
4950
#else
5051
#define VSETVL(n) __riscv_vsetvl_e64m2(n)
5152
#define FLOAT_V_T vfloat64m2_t
@@ -63,6 +64,7 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
6364
#define VMSGTU_VX_UINT __riscv_vmsgtu_vx_u64m2_b32
6465
#define VMSEQ_VX_UINT __riscv_vmseq_vx_u64m2_b32
6566
#define VFMERGE_VFM_FLOAT __riscv_vfmerge_vfm_f64m2
67+
#define V_UM2_TO_IM2(values) values
6668
#endif
6769

6870
int CNAME(BLASLONG m, BLASLONG n, FLOAT *a, BLASLONG lda, BLASLONG posX, BLASLONG posY, FLOAT *b){
@@ -99,7 +101,7 @@ int CNAME(BLASLONG m, BLASLONG n, FLOAT *a, BLASLONG lda, BLASLONG posX, BLASLON
99101
}
100102

101103
i = 0;
102-
do
104+
do
103105
{
104106
if (X > posY)
105107
{
@@ -119,9 +121,9 @@ int CNAME(BLASLONG m, BLASLONG n, FLOAT *a, BLASLONG lda, BLASLONG posX, BLASLON
119121
X ++;
120122
i ++;
121123
}
122-
else
124+
else
123125
{
124-
vindex = VID_V_UINT(vl);
126+
vindex = V_UM2_TO_IM2(VID_V_UINT(vl));
125127
for (unsigned int j = 0; j < vl; j++)
126128
{
127129
vax2 = VLSSEG2_FLOAT(ao, stride_lda, vl);
@@ -152,4 +154,4 @@ int CNAME(BLASLONG m, BLASLONG n, FLOAT *a, BLASLONG lda, BLASLONG posX, BLASLON
152154
}
153155

154156
return 0;
155-
}
157+
}

0 commit comments

Comments
 (0)