jeudi 11 novembre 2021

How to write reverse_prefix_sum in mips?

I was wondering how to convert the following code:

```uint32_t reverse_prefix_sum(uint32_t *arr) {
  uint32_t r;

  if(*arr == -1) return 0;
  r = reverse_prefix_sum(arr+1) + (uint32_t)*arr;
  *arr = r;
  return(r);
}```

Aucun commentaire:

Enregistrer un commentaire