[Libre-soc-bugs] [Bug 980] Implement C-based Power ISA pseudocode compiler

bugzilla-daemon at libre-soc.org bugzilla-daemon at libre-soc.org
Sat Jan 13 05:31:46 GMT 2024


https://bugs.libre-soc.org/show_bug.cgi?id=980

--- Comment #84 from Dmitry Selyutin <ghostmansd at gmail.com> ---
(In reply to Jacob Lifshay from comment #83)
> (In reply to Dmitry Selyutin from comment #82)
> 
> code looks nice!

Thanks! It's funny though that the process is mostly the same as for the
pseudocode, it's just that the representation is different. Now I know for sure
that the idea with the custom tree format was correct and that I did the right
thing when I decided to check with the pseudocode first.

> >     uint64_t result;
> 
> eventually we'll need to support things with >64 bits, but this should be
> mostly good for now.

Hm. Perhaps all the operations should be calls then. Plus after you wrote I
recalled that we probably should keep a number of bits an integer has as
well... So probably these all should deal with some kind of structure.

> >     for (i = UINT64_C(0x0); i != (UINT64_C(0x1) + 1); ++i) {
> 
> I would write that i <= UINT64_C(0x1) because that way you don't need the +
> 1 and because there may be for loops that need to loop zero times e.g. they
> start at 5 and end at 3, tho I don't remember any particular examples.

Nice catch, haven't thought of that. I just tend to use not equal
automatically, but here, when we don't fully control code, we should be extra
careful.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the libre-soc-bugs mailing list