[Libre-soc-bugs] [Bug 981] Support PowerPC ABI in cavatools

bugzilla-daemon at libre-soc.org bugzilla-daemon at libre-soc.org
Thu Sep 21 22:58:07 BST 2023


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

--- Comment #3 from Dmitry Selyutin <ghostmansd at gmail.com> ---
This was quite a step-by-step development.

First, I had to fix some things in cavatools, like inability to reuse headers.
https://git.libre-soc.org/?p=cavatools.git;a=commitdiff;h=9bd7bb427e195aa29656f33acb758f3e2abced1c
https://git.libre-soc.org/?p=cavatools.git;a=commitdiff;h=11adcb0291d2267f14b375b1f57b6a50e90b51f1
https://git.libre-soc.org/?p=cavatools.git;a=commitdiff;h=5394b37dc8825ce618f6fc117318ae5724ac6162

Second, since cavatools is quite architecture-specific, I had no other choice
but refactor the code to make it more generic:
https://git.libre-soc.org/?p=cavatools.git;a=commitdiff;h=3e8ff210980e83f4ec0627196b8cc72e5a63aaa0
https://git.libre-soc.org/?p=cavatools.git;a=commitdiff;h=005252f3e2a64902079d92ac031e2a536919deb2

Then I implemented the code generation for riscv64 and ppc/ppc64 in
cavatools-friendly format:
https://git.libre-soc.org/?p=openpower-isa.git;a=commitdiff;h=5172b93982f042f5d7a273cb0e92562305c03ccc
https://git.libre-soc.org/?p=openpower-isa.git;a=commitdiff;h=c7510177d5cd00b2db7cc97a4d60ac405f56f35d
https://git.libre-soc.org/?p=openpower-isa.git;a=commitdiff;h=34572b57ea72fb22e38af830565b5ad7f50a0cc0
https://git.libre-soc.org/?p=dev-env-setup.git;a=commitdiff;h=f79e0ceb28de39380bf1f27debfdc527910d0d23
https://git.libre-soc.org/?p=openpower-isa.git;a=commitdiff;h=7a3fe407a232baaa535a86efab95a85a90552fa7
https://git.libre-soc.org/?p=openpower-isa.git;a=commitdiff;h=b2839bc6b13965acb95a3b3792fdf9f0042755d2
https://git.libre-soc.org/?p=openpower-isa.git;a=commitdiff;h=f3dada849e14b33a8a10f31826c73342a605c193


Third, I dropped the original system calls mechanism and replaced it with the
one capable of generating riscv64, ppc and ppc64:
https://git.libre-soc.org/?p=cavatools.git;a=commitdiff;h=97e66b71006a8e1ea9957c7cb80078abbc01d9e3

Then I introduced the G and H variables (cavatools tend to use short variables,
they already had B and R variables for build and prefix directories):
https://git.libre-soc.org/?p=cavatools.git;a=commitdiff;h=5f03e28394fcf2963eb17b6c6b3153b93fa25d4f


Obviously, since cavatools cannot yet execute PPC instructions, I only had an
option to check whether the original RISC-V code works; however, I checked
whether the table is generated correctly for PPC as well. I also adjusted the
calling convention for PPC (that is, the register identifiers to be used as
arguments and result). Once we support ecall analogue for PPC (sc/scv), the
code can be enabled.

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


More information about the libre-soc-bugs mailing list