Skip to content

Bonus instructions #105

@mjcaisse

Description

@mjcaisse

Including groov/write.hpp results in extra instructions.

Using arm-none-eabi-g++

// #include <groov/write.hpp>
#include <stdx/concepts.hpp>
#include <conc/concurrency.hpp>

struct concurrency_policy {
    template <typename = void, stdx::invocable F>
    static inline auto call_in_critical_section(F &&f, auto &&...) -> decltype(auto) {
        return std::forward<F>(f)();
    }
};

template <> inline auto conc::injected_policy<> = concurrency_policy{};

int main() {}

results in the assembly:

main:
     mov r0, #0 
     bx  lr

Adding groov/write.hpp (uncomment above), results some additional things coming in:

main:
     mov r0, #0 
     bx  lr
_GLOBAL__sub_I_main:
     ldr r3, .L5
     ldr r2, [r3]
     tst r2, #1
     moveq   r2, #1
     streq   r2, [r3]
     bx  lr
.L5:
    .word   guard variable for fmt::v11::format_facet<std::locale>::id

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions