Skip to content

Commit

Permalink
rv64,vector: fix uninitialized error
Browse files Browse the repository at this point in the history
  • Loading branch information
huxuan0307 authored and cebarobot committed Nov 2, 2023
1 parent 5285f49 commit 5e081a5
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/isa/riscv64/instr/rvv/vcompute_impl.c
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ void arthimetic_instr(int opcode, int is_signed, int widening, int narrow, int d
void floating_arthimetic_instr(int opcode, int is_signed, int widening, int dest_mask, Decode *s) {
if(check_vstart_ignore(s)) return;
int idx;
word_t FPCALL_TYPE;
word_t FPCALL_TYPE = FPCALL_W64;
// fpcall type
switch (vtype->vsew) {
case 0 : panic("f8 not supported"); break;
Expand All @@ -484,6 +484,7 @@ void floating_arthimetic_instr(int opcode, int is_signed, int widening, int dest
}
break;
case 3 : FPCALL_TYPE = FPCALL_W64; break;
default: panic("other fp type not supported"); break;
}
for(idx = vstart->val; idx < vl->val; idx ++) {
// mask
Expand Down Expand Up @@ -736,7 +737,7 @@ void float_reduction_instr(int opcode, int widening, Decode *s) {
get_vreg(id_src->reg, 0, s1, vtype->vsew, vtype->vlmul, 0, 1);

int idx;
word_t FPCALL_TYPE;
word_t FPCALL_TYPE = FPCALL_W64;

// fpcall type
switch (vtype->vsew) {
Expand All @@ -754,6 +755,7 @@ void float_reduction_instr(int opcode, int widening, Decode *s) {
}
break;
case 3 : FPCALL_TYPE = FPCALL_W64; break;
default: panic("other fp type not supported"); break;
}

for(idx = vstart->val; idx < vl->val; idx ++) {
Expand Down Expand Up @@ -786,14 +788,15 @@ void float_reduction_instr(int opcode, int widening, Decode *s) {
}

void float_reduction_step2(uint64_t src, Decode *s) {
word_t FPCALL_TYPE;
word_t FPCALL_TYPE = FPCALL_W64;

// fpcall type
switch (vtype->vsew) {
case 0 : panic("f8 not supported"); break;
case 1 : FPCALL_TYPE = FPCALL_W16; break;
case 2 : FPCALL_TYPE = FPCALL_W32; break;
case 3 : FPCALL_TYPE = FPCALL_W64; break;
default: panic("other fp type not supported"); break;
}

int element_num = VLEN >> (3 + vtype->vsew);
Expand All @@ -810,14 +813,15 @@ void float_reduction_step2(uint64_t src, Decode *s) {
}

void float_reduction_step1(uint64_t src1, uint64_t src2, Decode *s) {
word_t FPCALL_TYPE;
word_t FPCALL_TYPE = FPCALL_W64;

// fpcall type
switch (vtype->vsew) {
case 0 : panic("f8 not supported"); break;
case 1 : FPCALL_TYPE = FPCALL_W16; break;
case 2 : FPCALL_TYPE = FPCALL_W32; break;
case 3 : FPCALL_TYPE = FPCALL_W64; break;
default: panic("other fp type not supported"); break;
}

int element_num = VLEN >> (3 + vtype->vsew);
Expand All @@ -831,7 +835,7 @@ void float_reduction_step1(uint64_t src1, uint64_t src2, Decode *s) {
}

void float_reduction_computing(Decode *s) {
word_t FPCALL_TYPE;
word_t FPCALL_TYPE = FPCALL_W64;
int idx;

// fpcall type
Expand Down Expand Up @@ -880,7 +884,7 @@ void float_reduction_computing(Decode *s) {
float_reduction_step1(0, 4, s);
float_reduction_step2(0, s);
break;
default : break;
default: panic("other fp type not supported"); break;
}

get_vreg(id_src->reg, 0, s1, vtype->vsew, vtype->vlmul, 0, 1);
Expand Down

0 comments on commit 5e081a5

Please sign in to comment.