[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: porting efforts
From: |
Ekaitz Zarraga |
Subject: |
Re: porting efforts |
Date: |
Thu, 09 Dec 2021 14:02:25 +0000 |
Hi all,
> > The question remains if i should just dedicate a register or
> > two for zero- and carry-flags or if the operations should just work
> > entirely differently -- instead of setting a zero flag somewhere in code
> > and then eventually do a jump-z the RISC-V way is to simply BEQZ (branch
> > if equal to zero).
>
> That sounds like a feasible plan, but I do not know anything about
> RISC-V yet. Ekaitz?
I had to take a couple of similar decisions when I worked on Lightening[1].
If I remember correctly I chose to use one register as a carry, but there
weren't too many cases of this kind of behavior.
If you think about it, the result is basically the same. Use a temporary
register for the flags and do your thing, it's probably the best choice. You
have to make sure you reserve that register, though, so you avoid overwriting
the flags with unexpected instructions.
Hope that helps, if you have any further question don't hesitate to ask!
Ekaitz
PS: You can use Lightening as an example for some of the things, it might be
easy to understand, but I can't guarantee it works 100% (even if it passes all
the tests).
[1]: https://gitlab.com/wingo/lightening/-/merge_requests/14
- porting efforts, Gabriel Wicki, 2021/12/08
- Re: porting efforts, Jan Nieuwenhuizen, 2021/12/09
- Re: porting efforts, Jan Nieuwenhuizen, 2021/12/09
- Re: porting efforts,
Ekaitz Zarraga <=
- Re: porting efforts, Ekaitz Zarraga, 2021/12/09
- Re: porting efforts, Gabriel Wicki, 2021/12/13
- Re: porting efforts, Ekaitz Zarraga, 2021/12/13
- Re: porting efforts, Gabriel Wicki, 2021/12/21
- Re: porting efforts, Ekaitz Zarraga, 2021/12/21
- Re: porting efforts, Gabriel Wicki, 2021/12/21
- Re: porting efforts, Ekaitz Zarraga, 2021/12/21