Closed IrinaYatsenko closed 4 years ago
LLVM does specify a way to do this using intrinsics, but I agree, it's awkward in C/C++. Unfortunately the i64*
approach is also awkward on the LLVM side; I think the idea of adding 2d specialized versions ameliorates that, because I suspect that manipulating arrays of more than 2 dimensions will be rare.
LLVM does specify a way to do this using intrinsics
This is the intrinsics I'm using in the bridge (https://github.com/microsoft/qsharp-runtime/blob/main/src/QirRuntime/lib/QIR/bridge-rt.ll) and am still having issues on Linux. Is it possible that different platforms must set up differently for the call? If so, we still have cross-platform compatibility issue.
LLVM does specify a way to do this using intrinsics
This is the intrinsics I'm using in the bridge (https://github.com/microsoft/qsharp-runtime/blob/main/src/QirRuntime/lib/QIR/bridge-rt.ll) and am still having issues on Linux. Is it possible that different platforms must set up differently for the call? If so, we still have cross-platform compatibility issue.
Agreed. In the PR (#55) I went with your suggestion.
As far as I can tell, there is no platform-agnostic way to implement variadic functions at the IR level and it's also error-prone, which creates a burden on the runtime implementers.
Instead of requiring:
consider similar to 1D specialization for 2D arrays (the arguments will be still passed via registers) and a generic buffer-based signature for larger arrays:
Notes: