Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dspinst.h exposes inline assembly #478

Open
danngreen opened this issue Aug 26, 2024 · 0 comments
Open

dspinst.h exposes inline assembly #478

danngreen opened this issue Aug 26, 2024 · 0 comments

Comments

@danngreen
Copy link

Description

Describe your problem.

dspinst.h contains inline assembly specific to ARM_ARCH_7EM, most of which is wrapped in an #ifdef, but there are two inline assembly calls at the bottom of the file that aren't wrapped: get_q_psr() and clr_q_psr(). This causes lots of warnings when compiling for a different architecture (e.g. unit tests, or in our case: porting to virtual synthesizer platform that runs on a different hardware platform).

The warnings can be silenced with -Wno-asm-operand-widths with the downside of possibly missing an actually important warning in the future. Or we could just fork and change the source, but it'd be nice to keep in sync with upstream (this repo).

Was there a reason to expose these two functions and their inline assembly to all archtectures, or was that just an oversight? If the latter, I'm happy to submit a PR wrapping those functions with the same macro test as the rest of the functions in the file.

Example warning:

In file included from /Users/dann/4ms/stm32/meta-module/firmware/vcv_ports/Befaco/src/noise-plethora/teensy/synth_pinknoise.cpp:39:
In file included from /Users/dann/4ms/stm32/meta-module/firmware/vcv_ports/Befaco/src/noise-plethora/teensy/synth_pinknoise.hpp:29:
In file included from /Users/dann/4ms/stm32/meta-module/firmware/vcv_ports/Befaco/src/noise-plethora/teensy/audio_core.hpp:4:
/Users/dann/4ms/stm32/meta-module/firmware/vcv_ports/Befaco/src/noise-plethora/teensy/dspinst.h:343:28: warning: value size does not match register size specified by the constraint and modifier [-Wasm-operand-widths]
        asm("mrs %0, APSR" : "=r"(out));
                                  ^
/Users/dann/4ms/stm32/meta-module/firmware/vcv_ports/Befaco/src/noise-plethora/teensy/dspinst.h:343:11: note: use constraint modifier "w"
        asm("mrs %0, APSR" : "=r"(out));
                 ^~
                 %w0
/Users/dann/4ms/stm32/meta-module/firmware/vcv_ports/Befaco/src/noise-plethora/teensy/dspinst.h:352:40: warning: value size does not match register size specified by the constraint and modifier [-Wasm-operand-widths]
            "msr APSR_nzcvq,%0\n" : [t] "=&r"(t)::"cc");
                                              ^
/Users/dann/4ms/stm32/meta-module/firmware/vcv_ports/Befaco/src/noise-plethora/teensy/dspinst.h:351:11: note: use constraint modifier "w"
        asm("mov %[t],#0\n"
                 ^~~~
                 %w[t]
/Users/dann/4ms/stm32/meta-module/firmware/vcv_ports/Befaco/src/noise-plethora/teensy/dspinst.h:352:40: warning: value size does not match register size specified by the constraint and modifier [-Wasm-operand-widths]
            "msr APSR_nzcvq,%0\n" : [t] "=&r"(t)::"cc");
                                              ^
/Users/dann/4ms/stm32/meta-module/firmware/vcv_ports/Befaco/src/noise-plethora/teensy/dspinst.h:352:22: note: use constraint modifier "w"
            "msr APSR_nzcvq,%0\n" : [t] "=&r"(t)::"cc");
                            ^~
                            %w0
@danngreen danngreen changed the title Macro dspinst.h exposes inline assembly Aug 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
@danngreen and others