diff --git a/src/common/pico_audio/audio_utils.S b/src/common/pico_audio/audio_utils.S index e46ec5e..f812d69 100644 --- a/src/common/pico_audio/audio_utils.S +++ b/src/common/pico_audio/audio_utils.S @@ -24,12 +24,12 @@ audio_upsample: lsls r2, #1 mov ip, r1 add ip, r2 - ldr r6, =#SIO_BASE + SIO_INTERP0_ACCUM0_OFFSET + ldr r6, =SIO_BASE + SIO_INTERP0_ACCUM0_OFFSET // interp_configure_with_signed_and_blend - ldr r4, =# ((AUDIO_UPSAMPLE_SCALE_BITS - 1) << SIO_INTERP0_CTRL_LANE0_SHIFT_LSB) | (1 << SIO_INTERP0_CTRL_LANE0_MASK_LSB_LSB) | ((24 - AUDIO_UPSAMPLE_SCALE_BITS) << SIO_INTERP0_CTRL_LANE0_MASK_MSB_LSB) | SIO_INTERP0_CTRL_LANE0_BLEND_BITS + ldr r4, =((AUDIO_UPSAMPLE_SCALE_BITS - 1) << SIO_INTERP0_CTRL_LANE0_SHIFT_LSB) | (1 << SIO_INTERP0_CTRL_LANE0_MASK_LSB_LSB) | ((24 - AUDIO_UPSAMPLE_SCALE_BITS) << SIO_INTERP0_CTRL_LANE0_MASK_MSB_LSB) | SIO_INTERP0_CTRL_LANE0_BLEND_BITS str r4, [r6, #SIO_INTERP0_CTRL_LANE0_OFFSET - SIO_INTERP0_ACCUM0_OFFSET] // interp_configure_with_signed_and_cross_input - ldr r4, =# ((AUDIO_UPSAMPLE_SCALE_BITS - 8) << SIO_INTERP0_CTRL_LANE1_SHIFT_LSB) | (0 << SIO_INTERP0_CTRL_LANE1_MASK_LSB_LSB) | (7 << SIO_INTERP0_CTRL_LANE1_MASK_MSB_LSB) | SIO_INTERP0_CTRL_LANE1_SIGNED_BITS | SIO_INTERP0_CTRL_LANE1_CROSS_INPUT_BITS + ldr r4, =((AUDIO_UPSAMPLE_SCALE_BITS - 8) << SIO_INTERP0_CTRL_LANE1_SHIFT_LSB) | (0 << SIO_INTERP0_CTRL_LANE1_MASK_LSB_LSB) | (7 << SIO_INTERP0_CTRL_LANE1_MASK_MSB_LSB) | SIO_INTERP0_CTRL_LANE1_SIGNED_BITS | SIO_INTERP0_CTRL_LANE1_CROSS_INPUT_BITS str r4, [r6, #SIO_INTERP0_CTRL_LANE1_OFFSET - SIO_INTERP0_ACCUM0_OFFSET] str r0, [r6, #SIO_INTERP0_BASE2_OFFSET - SIO_INTERP0_ACCUM0_OFFSET] movs r0, #0 @@ -91,12 +91,12 @@ audio_upsample_words: lsls r2, #2 mov ip, r1 add ip, r2 - ldr r6, =#SIO_BASE + SIO_INTERP0_ACCUM0_OFFSET + ldr r6, =SIO_BASE + SIO_INTERP0_ACCUM0_OFFSET // interp_configure_with_blend - ldr r4, =# ((AUDIO_UPSAMPLE_SCALE_BITS - 1) << SIO_INTERP0_CTRL_LANE0_SHIFT_LSB) | (1 << SIO_INTERP0_CTRL_LANE0_MASK_LSB_LSB) | ((24 -AUDIO_UPSAMPLE_SCALE_BITS) << SIO_INTERP0_CTRL_LANE0_MASK_MSB_LSB) | SIO_INTERP0_CTRL_LANE0_BLEND_BITS + ldr r4, =((AUDIO_UPSAMPLE_SCALE_BITS - 1) << SIO_INTERP0_CTRL_LANE0_SHIFT_LSB) | (1 << SIO_INTERP0_CTRL_LANE0_MASK_LSB_LSB) | ((24 -AUDIO_UPSAMPLE_SCALE_BITS) << SIO_INTERP0_CTRL_LANE0_MASK_MSB_LSB) | SIO_INTERP0_CTRL_LANE0_BLEND_BITS str r4, [r6, #SIO_INTERP0_CTRL_LANE0_OFFSET - SIO_INTERP0_ACCUM0_OFFSET] // interp_configure_with_signed_and_cross_input - ldr r4, =# ((AUDIO_UPSAMPLE_SCALE_BITS - 8) << SIO_INTERP0_CTRL_LANE1_SHIFT_LSB) | (0 << SIO_INTERP0_CTRL_LANE1_MASK_LSB_LSB) | (7 << SIO_INTERP0_CTRL_LANE1_MASK_MSB_LSB) | SIO_INTERP0_CTRL_LANE1_SIGNED_BITS | SIO_INTERP0_CTRL_LANE1_CROSS_INPUT_BITS + ldr r4, =((AUDIO_UPSAMPLE_SCALE_BITS - 8) << SIO_INTERP0_CTRL_LANE1_SHIFT_LSB) | (0 << SIO_INTERP0_CTRL_LANE1_MASK_LSB_LSB) | (7 << SIO_INTERP0_CTRL_LANE1_MASK_MSB_LSB) | SIO_INTERP0_CTRL_LANE1_SIGNED_BITS | SIO_INTERP0_CTRL_LANE1_CROSS_INPUT_BITS str r4, [r6, #SIO_INTERP0_CTRL_LANE1_OFFSET - SIO_INTERP0_ACCUM0_OFFSET] str r0, [r6, #SIO_INTERP0_BASE2_OFFSET - SIO_INTERP0_ACCUM0_OFFSET] movs r0, #0 @@ -196,12 +196,12 @@ audio_upsample_double: lsls r2, #2 mov ip, r1 add ip, r2 - ldr r6, =#SIO_BASE + SIO_INTERP0_ACCUM0_OFFSET + ldr r6, =SIO_BASE + SIO_INTERP0_ACCUM0_OFFSET // interp_configure_with_signed_and_blend - ldr r4, =# ((AUDIO_UPSAMPLE_SCALE_BITS - 1) << SIO_INTERP0_CTRL_LANE0_SHIFT_LSB) | (1 << SIO_INTERP0_CTRL_LANE0_MASK_LSB_LSB) | ((24 - AUDIO_UPSAMPLE_SCALE_BITS) << SIO_INTERP0_CTRL_LANE0_MASK_MSB_LSB) | SIO_INTERP0_CTRL_LANE0_BLEND_BITS + ldr r4, =((AUDIO_UPSAMPLE_SCALE_BITS - 1) << SIO_INTERP0_CTRL_LANE0_SHIFT_LSB) | (1 << SIO_INTERP0_CTRL_LANE0_MASK_LSB_LSB) | ((24 - AUDIO_UPSAMPLE_SCALE_BITS) << SIO_INTERP0_CTRL_LANE0_MASK_MSB_LSB) | SIO_INTERP0_CTRL_LANE0_BLEND_BITS str r4, [r6, #SIO_INTERP0_CTRL_LANE0_OFFSET - SIO_INTERP0_ACCUM0_OFFSET] // interp_configure_with_signed_and_cross_input - ldr r4, =# ((AUDIO_UPSAMPLE_SCALE_BITS - 8) << SIO_INTERP0_CTRL_LANE1_SHIFT_LSB) | (0 << SIO_INTERP0_CTRL_LANE1_MASK_LSB_LSB) | (7 << SIO_INTERP0_CTRL_LANE1_MASK_MSB_LSB) | SIO_INTERP0_CTRL_LANE1_SIGNED_BITS | SIO_INTERP0_CTRL_LANE1_CROSS_INPUT_BITS + ldr r4, =((AUDIO_UPSAMPLE_SCALE_BITS - 8) << SIO_INTERP0_CTRL_LANE1_SHIFT_LSB) | (0 << SIO_INTERP0_CTRL_LANE1_MASK_LSB_LSB) | (7 << SIO_INTERP0_CTRL_LANE1_MASK_MSB_LSB) | SIO_INTERP0_CTRL_LANE1_SIGNED_BITS | SIO_INTERP0_CTRL_LANE1_CROSS_INPUT_BITS str r4, [r6, #SIO_INTERP0_CTRL_LANE1_OFFSET - SIO_INTERP0_ACCUM0_OFFSET] str r0, [r6, #SIO_INTERP0_BASE2_OFFSET - SIO_INTERP0_ACCUM0_OFFSET] movs r0, #0 diff --git a/src/common/pico_audio/include/pico/sample_conversion.h b/src/common/pico_audio/include/pico/sample_conversion.h index 223fdd9..515cb03 100644 --- a/src/common/pico_audio/include/pico/sample_conversion.h +++ b/src/common/pico_audio/include/pico/sample_conversion.h @@ -20,19 +20,19 @@ public: typedef _sample_t sample_t; }; -typedef struct : public FmtDetails { -} FmtU8; +struct FmtU8 : public FmtDetails { +}; -typedef struct : public FmtDetails { -} FmtS8; +struct FmtS8 : public FmtDetails { +}; -typedef struct : public FmtDetails { -} FmtU16; +struct FmtU16 : public FmtDetails { +}; -typedef struct : public FmtDetails { -} FmtS16; +struct FmtS16 : public FmtDetails { +}; -// Multi channel is just N samples back to back +// Multi-channel is just N samples back to back template struct MultiChannelFmt { static const uint channel_count = ChannelCount; diff --git a/src/common/platypus/decompress_row.S b/src/common/platypus/decompress_row.S index efae1f1..e241c18 100644 --- a/src/common/platypus/decompress_row.S +++ b/src/common/platypus/decompress_row.S @@ -92,7 +92,7 @@ .macro shuffle_7_bytes_to_8 tmp_a tmp_b #ifndef VIDEO_DBI - ldr \tmp_b, =#0xff018401 + ldr \tmp_b, =0xff018401 lsls \tmp_a, \tmp_b, #16 ands \tmp_b, r_bottom ands \tmp_a, r_top @@ -107,7 +107,7 @@ orrs \tmp_b, \tmp_a orrs r_bottom, \tmp_b #else - ldr \tmp_b, =#0xff210821 + ldr \tmp_b, =0xff210821 lsls \tmp_a, \tmp_b, #16 ands \tmp_b, r_bottom ands \tmp_a, r_top @@ -203,7 +203,7 @@ subs r1, r_output mov r_row_delta, r1 // todo assert r_interps is r1 - ldr r_interps, =#SIO_BASE + SIO_INTERP0_ACCUM0_OFFSET + ldr r_interps, =SIO_BASE + SIO_INTERP0_ACCUM0_OFFSET // todo assert r_source is r2 mov r_output_end, r3 diff --git a/src/rp2_common/pico_audio_spdif/sample_encoding.cpp b/src/rp2_common/pico_audio_spdif/sample_encoding.cpp index 4a1c070..430b974 100644 --- a/src/rp2_common/pico_audio_spdif/sample_encoding.cpp +++ b/src/rp2_common/pico_audio_spdif/sample_encoding.cpp @@ -14,8 +14,8 @@ static_assert(8 == sizeof(spdif_subframe_t), ""); // subframe within SPDIF -typedef struct : public FmtDetails { -} FmtSPDIF; +struct FmtSPDIF : public FmtDetails { +}; template struct converting_copy, Stereo> { diff --git a/src/rp2_common/pico_scanvideo_dpi/CMakeLists.txt b/src/rp2_common/pico_scanvideo_dpi/CMakeLists.txt index ebae8a0..0c1ae55 100644 --- a/src/rp2_common/pico_scanvideo_dpi/CMakeLists.txt +++ b/src/rp2_common/pico_scanvideo_dpi/CMakeLists.txt @@ -10,4 +10,13 @@ if (TARGET pico_scanvideo) target_include_directories(pico_scanvideo_dpi INTERFACE ${CMAKE_CURRENT_LIST_DIR}/include) target_compile_definitions(pico_scanvideo_dpi INTERFACE VIDEO_DPI) target_link_libraries(pico_scanvideo_dpi INTERFACE hardware_dma hardware_pio hardware_irq pico_scanvideo) + + if (PICO_C_COMPILER_IS_CLANG) + # Clang does not support optimize pragma + set_source_files_properties( + ${CMAKE_CURRENT_LIST_DIR}/scanvideo.c + PROPERTIES + COMPILE_OPTIONS "-O3" + ) + endif() endif() \ No newline at end of file diff --git a/src/rp2_common/pico_scanvideo_dpi/scanvideo.c b/src/rp2_common/pico_scanvideo_dpi/scanvideo.c index 104a45c..0e78cc3 100644 --- a/src/rp2_common/pico_scanvideo_dpi/scanvideo.c +++ b/src/rp2_common/pico_scanvideo_dpi/scanvideo.c @@ -4,17 +4,18 @@ * SPDX-License-Identifier: BSD-3-Clause */ -#pragma GCC push_options +#include +#include +#include "pico.h" + +GCC_Pragma("GCC push_options") #if !PICO_SCANVIDEO_DEBUG_IMPL #undef PARAM_ASSERTIONS_DISABLE_ALL #define PARAM_ASSERTIONS_DISABLE_ALL 1 -#pragma GCC optimize("O3") +GCC_Pragma("GCC optimize(\"O3\")") #endif -#include -#include -#include "pico/platform.h" #include "pico/sem.h" #include "pico/util/buffer.h" #include "hardware/clocks.h" @@ -1855,4 +1856,4 @@ void validate_scanline(const uint32_t *dma_data, uint dma_data_size, } #endif -#pragma GCC pop_options +GCC_Pragma("GCC pop_options")