Implement core_log
and rtio_log
to ARTIQ
#488
No reviewers
Labels
No Milestone
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: M-Labs/nac3#488
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "feature/core-rtio-log"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I had to rollback a lot of script changes to
check_demo.sh
because it breaks how custom arguments are passed into NAC3, including regressions to the SSE problem encountered withmandelbrot.py
.Fixes #297.
@ -60,3 +61,3 @@
clang -o demo module.o demo.o $DEMO_LINALG_STUB -lm -Wl,--no-warn-search-mismatch
else
$nac3standalone --triple i686-unknown-linux-gnu "${nac3args[@]}"
$nac3standalone --triple i686-unknown-linux-gnu --target-features +sse2 "${nac3args[@]}"
@abdul124 I thought you said this sse2 option was no longer required when using i686 instead of i386?
sse2 should be enforced by default on rustc i686 target https://github.com/rust-lang/rust/issues/82435#issuecomment-783939789
Okay, but that comment is about Rust, not LLVM. nac3 is only using the latter here.
LLVM does interpret "i686" as implying sse2 for most part (Debian LLVM requires patch though). This commit
56d3ad9d23
describes the LLVM situation for sse2 support on LLVM i686 target.So the present change should be reverted i.e. there is no need to add
--target-features +sse2
?Yes, since the feature is already implied by i686 target,
--target-feature +sse2
is redundant.I don't think any of that is true. The reason why BoringSSL requires SSE2 on i686 targets is because (from the commit message)
So it should be seen as OpenSSL's own project requirements, rather than a behavior of the compiler.
In fact, the quoted issue in LLVM's repo says that while SSE2 support is implied by
i686
, it is ultimately treated as ani386
target.When compiling without any flags, all below
f
-prefixed instructions are from the X87 ISA (List of X87 Instructions).With
--target-features +sse2
, all the above X87 instructions are replaced with their SSE2 counterparts (note the use ofxmm
registers):This also explains the test failures when removing
--target-features +sse2
withsrc/mandelbrot.py
.@ -727,0 +740,4 @@
/// * `suffix` - String to terminate the printed string, if any.
/// * `as_repr` - Whether the `repr()` output of values instead of `str()`.
/// * `as_rtio` - Whether to print to `rtio_log` instead of `core_log`.
fn polymorphic_print<'ctx>(
I suppose this should make it straightforward now to implement the full
print_rpc()
with several arguments?Not really. This only makes it straightforward to implement
print_rpc
/core_log
/rtio_log
with several arguments of the same type, as is required by the current implementation of varargs (Varargs are typechecked against its expected type, e.g.*int32
requires all arguments in the variadic position to beint32
).In order to implement these functions with variadic arguments of different types, we still need a type category which accepts any type (think
TypeEnum::TAny
), and that needs to be first implemented. The closest equivalent we have is*T
(whereT
is a typevar), but this still requires all arguments to be of the same typeT
.So the _log functions currently have the same limitation, correct?
_log
functions are currently implemented with a single non-vararg parameter. I think we can merge this first before expanding support to homogeneous varargs?Yes, just trying to understand where we are.
@ -1097,0 +1100,4 @@
/// Note that, similar to format constants in `<inttypes.h>`, these constants need to be prepended
/// with `%`.
#[must_use]
pub fn get_fprintf_format_constant<'ctx>(
Shouldn't this go into nac3artiq? I cannot think of a use for it in core.
I have the opposite POV. It is because these format constants are not
nac3artiq
-specific which is why I put it innac3core
. My thought is that only ARTIQ-specific logic would be put in that module, andfprintf
constants are "global" in the sense that it can be used by artiq or standalone alike.But only ARTIQ needs them in the forseeable future. nac3core is a compiler library, not a string formatter library. Keep it as simple as possible.
Moved
get_fprintf_format_constant
tocodegen.rs
innac3artiq
.Implement `core_log` and `rtio_log` to ARTIQto WIP: Implement `core_log` and `rtio_log` to ARTIQFound a bug with the standalone scripts.
91506f05f6
to9b06640dec
WIP: Implement `core_log` and `rtio_log` to ARTIQto Implement `core_log` and `rtio_log` to ARTIQReady for re-review.
9b06640dec
to274f493fe9