Skip to contentSkip to conversation

target/riscv/vector_helper.c: clean up reference of MTYPE

PATCH Applied Xiao Wang 4 participants 4 messages Jun 8, 2023 – Jun 12, 2023 RISC-V

lore
Share & tools
lore

Xiao Wang

author
#0 lore raw

PATCH 1/1 target/riscv/vector_helper.c: clean up reference of MTYPE

There's no code using MTYPE, which was a concept used in older vector implementation.

---
 target/riscv/vector_helper.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
target/riscv/vector_helper.c +1 -5
index f261e726c2..1e06e7447c 100644
@@ -378,7 +378,7 @@ vext_ldst_us(void *vd, target_ulong base, CPURISCVState *env, uint32_t desc,
 
 /*
  * masked unit-stride load and store operation will be a special case of
- * stride, stride = NF * sizeof (MTYPE)
+ * stride, stride = NF * sizeof (ETYPE)
  */
 
 #define GEN_VEXT_LD_US(NAME, ETYPE, LOAD_FN)                            \
@@ -650,10 +650,6 @@ GEN_VEXT_LDFF(vle64ff_v, int64_t, lde_d)
 #define DO_MAX(N, M)  ((N) >= (M) ? (N) : (M))
 #define DO_MIN(N, M)  ((N) >= (M) ? (M) : (N))
 
-/* Unsigned min/max */
-#define DO_MAXU(N, M) DO_MAX((UMTYPE)N, (UMTYPE)M)
-#define DO_MINU(N, M) DO_MIN((UMTYPE)N, (UMTYPE)M)
-
 /*
  * load and store whole register instructions
  */
Signature · 1 line
2.25.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Xiao Wang

There's no code using MTYPE, which was a concept used in older vector implementation.

---

Quoted 27 lines
  target/riscv/vector_helper.c | 6 +-----
  1 file changed, 1 insertion(+), 5 deletions(-)
target/riscv/vector_helper.c +1 -5
index f261e726c2..1e06e7447c 100644
@@ -378,7 +378,7 @@ vext_ldst_us(void *vd, target_ulong base, CPURISCVState *env, uint32_t desc,
 
  /*
   * masked unit-stride load and store operation will be a special case of
- * stride, stride = NF * sizeof (MTYPE)
+ * stride, stride = NF * sizeof (ETYPE)
   */
 
  #define GEN_VEXT_LD_US(NAME, ETYPE, LOAD_FN)                            \
@@ -650,10 +650,6 @@ GEN_VEXT_LDFF(vle64ff_v, int64_t, lde_d)
  #define DO_MAX(N, M)  ((N) >= (M) ? (N) : (M))
  #define DO_MIN(N, M)  ((N) >= (M) ? (M) : (N))
 
-/* Unsigned min/max */
-#define DO_MAXU(N, M) DO_MAX((UMTYPE)N, (UMTYPE)M)
-#define DO_MINU(N, M) DO_MIN((UMTYPE)N, (UMTYPE)M)
-
  /*
   * load and store whole register instructions
   */
#2 lore raw
In reply to Xiao Wang
Quoted 5 lines · Xiao Wang

There's no code using MTYPE, which was a concept used in older vector implementation.

Thanks!

Applied to riscv-to-apply.next

Alistair

Quoted 32 lines
---
 target/riscv/vector_helper.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
target/riscv/vector_helper.c +1 -6
index f261e726c2..1e06e7447c 100644
@@ -378,7 +378,7 @@ vext_ldst_us(void *vd, target_ulong base, CPURISCVState *env, uint32_t desc,
 
 /*
  * masked unit-stride load and store operation will be a special case of
- * stride, stride = NF * sizeof (MTYPE)
+ * stride, stride = NF * sizeof (ETYPE)
  */
 
 #define GEN_VEXT_LD_US(NAME, ETYPE, LOAD_FN)                            \
@@ -650,10 +650,6 @@ GEN_VEXT_LDFF(vle64ff_v, int64_t, lde_d)
 #define DO_MAX(N, M)  ((N) >= (M) ? (N) : (M))
 #define DO_MIN(N, M)  ((N) >= (M) ? (M) : (N))
 
-/* Unsigned min/max */
-#define DO_MAXU(N, M) DO_MAX((UMTYPE)N, (UMTYPE)M)
-#define DO_MINU(N, M) DO_MIN((UMTYPE)N, (UMTYPE)M)
-
 /*
  * load and store whole register instructions
  */
--

2.25.1

Reviewed-by on v1 1/1
#3 lore raw
In reply to Xiao Wang
Quoted 1 line · Xiao Wang

There's no code using MTYPE,

Yes, it means memory access type.

Quoted 22 lines

which was a concept used in older vector
implementation.

---
  target/riscv/vector_helper.c | 6 +-----
  1 file changed, 1 insertion(+), 5 deletions(-)
target/riscv/vector_helper.c +1 -1
index f261e726c2..1e06e7447c 100644
@@ -378,7 +378,7 @@ vext_ldst_us(void *vd, target_ulong base, CPURISCVState *env, uint32_t desc,
 
  /*
   * masked unit-stride load and store operation will be a special case of
- * stride, stride = NF * sizeof (MTYPE)
+ * stride, stride = NF * sizeof (ETYPE)
   */
 
  #define GEN_VEXT_LD_US(NAME, ETYPE, LOAD_FN)                            \

target/riscv/vector_helper.c GEN_VEXT_LDFF(vle64ff_v, int64_t, lde_d) · line 655

Quoted 6 lines
target/riscv/vector_helper.c +0 -3
@@ -650,10 +650,6 @@ GEN_VEXT_LDFF(vle64ff_v, int64_t, lde_d)
  #define DO_MAX(N, M)  ((N) >= (M) ? (N) : (M))
  #define DO_MIN(N, M)  ((N) >= (M) ? (M) : (N))
 
-/* Unsigned min/max */
-#define DO_MAXU(N, M) DO_MAX((UMTYPE)N, (UMTYPE)M)
-#define DO_MINU(N, M) DO_MIN((UMTYPE)N, (UMTYPE)M)

This once has been used by the vector atomic instructions, which has been moved to the Zvamo.

Zhiwei

Quoted 4 lines
target/riscv/vector_helper.c +0 -1
-
  /*
   * load and store whole register instructions
   */