From: yu.dongliang <18588496441@163.com> Date: Mon, 15 May 2023 09:51:21 +0000 (+0800) Subject: support arm32: 'qsort.c' of 'scf/examples' test ok X-Git-Url: http://baseworks.info/?a=commitdiff_plain;h=2825e959e47e18369f70a91f23848a111e73d023;p=scf.git support arm32: 'qsort.c' of 'scf/examples' test ok --- diff --git a/native/risc/scf_risc_reg.c b/native/risc/scf_risc_reg.c index dda0bca..47f1ca9 100644 --- a/native/risc/scf_risc_reg.c +++ b/native/risc/scf_risc_reg.c @@ -429,8 +429,11 @@ int risc_array_index_reg(scf_sib_t* sib, scf_dag_node_t* base, scf_dag_node_t* i int32_t s = scale->var->data.i; assert(s > 0); + if (scale->var->size > f->rops->MAX_BYTES) + scale->var->size = f->rops->MAX_BYTES; + if (vb->nb_pointers + vb->nb_dimentions > 1 || vb->type >= SCF_STRUCT) - sib->size = 8; + sib->size = f->rops->MAX_BYTES; else { sib->size = vb->data_size; assert(8 >= vb->data_size); @@ -452,7 +455,7 @@ int risc_array_index_reg(scf_sib_t* sib, scf_dag_node_t* base, scf_dag_node_t* i return ret; } - scf_register_t* ri2 = f->rops->find_register_color_bytes(ri->color, 8); + scf_register_t* ri2 = f->rops->find_register_color_bytes(ri->color, f->rops->MAX_BYTES); if (ri->bytes < ri2->bytes) { @@ -470,8 +473,6 @@ int risc_array_index_reg(scf_sib_t* sib, scf_dag_node_t* base, scf_dag_node_t* i && 4 != s && 8 != s) { - assert(8 == scale->var->size); - ret = risc_select_reg(&rs, scale, c, f, 0); if (ret < 0) { scf_loge("\n");