kopia lustrzana https://github.com/raspberrypi/pico-extras
fixup for clang
rodzic
71590f2a9f
commit
5200ce5fe3
|
@ -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
|
||||
|
|
|
@ -20,19 +20,19 @@ public:
|
|||
typedef _sample_t sample_t;
|
||||
};
|
||||
|
||||
typedef struct : public FmtDetails<uint8_t> {
|
||||
} FmtU8;
|
||||
struct FmtU8 : public FmtDetails<uint8_t> {
|
||||
};
|
||||
|
||||
typedef struct : public FmtDetails<int8_t> {
|
||||
} FmtS8;
|
||||
struct FmtS8 : public FmtDetails<int8_t> {
|
||||
};
|
||||
|
||||
typedef struct : public FmtDetails<uint16_t> {
|
||||
} FmtU16;
|
||||
struct FmtU16 : public FmtDetails<uint16_t> {
|
||||
};
|
||||
|
||||
typedef struct : public FmtDetails<int16_t> {
|
||||
} FmtS16;
|
||||
struct FmtS16 : public FmtDetails<int16_t> {
|
||||
};
|
||||
|
||||
// Multi channel is just N samples back to back
|
||||
// Multi-channel is just N samples back to back
|
||||
template<typename Fmt, uint ChannelCount>
|
||||
struct MultiChannelFmt {
|
||||
static const uint channel_count = ChannelCount;
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -14,8 +14,8 @@
|
|||
static_assert(8 == sizeof(spdif_subframe_t), "");
|
||||
|
||||
// subframe within SPDIF
|
||||
typedef struct : public FmtDetails<spdif_subframe_t> {
|
||||
} FmtSPDIF;
|
||||
struct FmtSPDIF : public FmtDetails<spdif_subframe_t> {
|
||||
};
|
||||
|
||||
template<typename FromFmt>
|
||||
struct converting_copy<Stereo<FmtSPDIF>, Stereo<FromFmt>> {
|
||||
|
|
|
@ -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()
|
|
@ -4,17 +4,18 @@
|
|||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
#pragma GCC push_options
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#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 <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#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")
|
||||
|
|
Ładowanie…
Reference in New Issue