Skip to content

Platform agnostic register setup #200

@nnarain

Description

@nnarain
        union Register
        {
            struct {
#ifdef __LITTLEENDIAN__
                uint8_t lo;
                uint8_t hi;
#else
                uint8_t hi;
                uint8_t lo;
#endif
            };
            uint16_t val;
        };

Currently, registers are set up as above. This requires the CMake build to determine endianness of the system and set a compiler definition to ensure registers are in the correct order in memory.

This works fine at the moment but it probably unnecessary and could cause issues with platforms such as webassembly.

Consider changing this to a class that uses bit operations to set the 16 bit combined values explicitly.

Might be worth keeping an eye on benchmarks for this one but I don't think there will be a huge impact.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions