terralang / terra

Terra is a low-level system programming language that is embedded in and meta-programmed by the Lua programming language.
terralang.org
Other
2.71k stars 197 forks source link

More fixes for PPC64le calling convention #575

Closed elliottslaughter closed 2 years ago

elliottslaughter commented 2 years ago

This PR includes substantial fixes to the PPC64le calling convention for passing structs. In particular, PPC64le now passes the cconv.t test, as well as cconv_more.t (which is substantially upgraded in this PR).

The test cconv_more.t has been upgraded to use metaprogramming, so that it's easier to extend and modify parameters. In particular the test covers:

The test is also set to helpfully print out the failing LLVM bitcode (if any), which makes debugging immensely easier.

TODO:

elliottslaughter commented 2 years ago

With this change I am also currently passing 98.5% of tests:

=================
= FAILING tests
=================
benchmark_dgemm.t
constanttypes.t
coverage3.t
dgemm3.t
gemm.t
multiterra.t
sgemm3.t
vecobj.t
=================

540 tests passed. 8 tests failed.
elliottslaughter commented 2 years ago

I have updated cconv_more.t to include various array cases.

This fails on x86 with N = 10. I'm going to skip this for now and commit the test with N = 9, since x86 calling conv isn't in scope for this PR. However, this is something that needs to be looked at later.

But it passes on PPC64le up to N = 22.