Skip to content

Commit 5200ce5

Browse files
committed
fixup for clang
1 parent 71590f2 commit 5200ce5

File tree

6 files changed

+39
-29
lines changed

6 files changed

+39
-29
lines changed

src/common/pico_audio/audio_utils.S

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ audio_upsample:
2424
lsls r2, #1
2525
mov ip, r1
2626
add ip, r2
27-
ldr r6, =#SIO_BASE + SIO_INTERP0_ACCUM0_OFFSET
27+
ldr r6, =SIO_BASE + SIO_INTERP0_ACCUM0_OFFSET
2828
// interp_configure_with_signed_and_blend
29-
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
29+
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
3030
str r4, [r6, #SIO_INTERP0_CTRL_LANE0_OFFSET - SIO_INTERP0_ACCUM0_OFFSET]
3131
// interp_configure_with_signed_and_cross_input
32-
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
32+
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
3333
str r4, [r6, #SIO_INTERP0_CTRL_LANE1_OFFSET - SIO_INTERP0_ACCUM0_OFFSET]
3434
str r0, [r6, #SIO_INTERP0_BASE2_OFFSET - SIO_INTERP0_ACCUM0_OFFSET]
3535
movs r0, #0
@@ -91,12 +91,12 @@ audio_upsample_words:
9191
lsls r2, #2
9292
mov ip, r1
9393
add ip, r2
94-
ldr r6, =#SIO_BASE + SIO_INTERP0_ACCUM0_OFFSET
94+
ldr r6, =SIO_BASE + SIO_INTERP0_ACCUM0_OFFSET
9595
// interp_configure_with_blend
96-
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
96+
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
9797
str r4, [r6, #SIO_INTERP0_CTRL_LANE0_OFFSET - SIO_INTERP0_ACCUM0_OFFSET]
9898
// interp_configure_with_signed_and_cross_input
99-
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
99+
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
100100
str r4, [r6, #SIO_INTERP0_CTRL_LANE1_OFFSET - SIO_INTERP0_ACCUM0_OFFSET]
101101
str r0, [r6, #SIO_INTERP0_BASE2_OFFSET - SIO_INTERP0_ACCUM0_OFFSET]
102102
movs r0, #0
@@ -196,12 +196,12 @@ audio_upsample_double:
196196
lsls r2, #2
197197
mov ip, r1
198198
add ip, r2
199-
ldr r6, =#SIO_BASE + SIO_INTERP0_ACCUM0_OFFSET
199+
ldr r6, =SIO_BASE + SIO_INTERP0_ACCUM0_OFFSET
200200
// interp_configure_with_signed_and_blend
201-
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
201+
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
202202
str r4, [r6, #SIO_INTERP0_CTRL_LANE0_OFFSET - SIO_INTERP0_ACCUM0_OFFSET]
203203
// interp_configure_with_signed_and_cross_input
204-
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
204+
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
205205
str r4, [r6, #SIO_INTERP0_CTRL_LANE1_OFFSET - SIO_INTERP0_ACCUM0_OFFSET]
206206
str r0, [r6, #SIO_INTERP0_BASE2_OFFSET - SIO_INTERP0_ACCUM0_OFFSET]
207207
movs r0, #0

src/common/pico_audio/include/pico/sample_conversion.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,19 @@ struct FmtDetails {
2020
typedef _sample_t sample_t;
2121
};
2222

23-
typedef struct : public FmtDetails<uint8_t> {
24-
} FmtU8;
23+
struct FmtU8 : public FmtDetails<uint8_t> {
24+
};
2525

26-
typedef struct : public FmtDetails<int8_t> {
27-
} FmtS8;
26+
struct FmtS8 : public FmtDetails<int8_t> {
27+
};
2828

29-
typedef struct : public FmtDetails<uint16_t> {
30-
} FmtU16;
29+
struct FmtU16 : public FmtDetails<uint16_t> {
30+
};
3131

32-
typedef struct : public FmtDetails<int16_t> {
33-
} FmtS16;
32+
struct FmtS16 : public FmtDetails<int16_t> {
33+
};
3434

35-
// Multi channel is just N samples back to back
35+
// Multi-channel is just N samples back to back
3636
template<typename Fmt, uint ChannelCount>
3737
struct MultiChannelFmt {
3838
static const uint channel_count = ChannelCount;

src/common/platypus/decompress_row.S

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292

9393
.macro shuffle_7_bytes_to_8 tmp_a tmp_b
9494
#ifndef VIDEO_DBI
95-
ldr \tmp_b, =#0xff018401
95+
ldr \tmp_b, =0xff018401
9696
lsls \tmp_a, \tmp_b, #16
9797
ands \tmp_b, r_bottom
9898
ands \tmp_a, r_top
@@ -107,7 +107,7 @@
107107
orrs \tmp_b, \tmp_a
108108
orrs r_bottom, \tmp_b
109109
#else
110-
ldr \tmp_b, =#0xff210821
110+
ldr \tmp_b, =0xff210821
111111
lsls \tmp_a, \tmp_b, #16
112112
ands \tmp_b, r_bottom
113113
ands \tmp_a, r_top
@@ -203,7 +203,7 @@
203203
subs r1, r_output
204204
mov r_row_delta, r1
205205
// todo assert r_interps is r1
206-
ldr r_interps, =#SIO_BASE + SIO_INTERP0_ACCUM0_OFFSET
206+
ldr r_interps, =SIO_BASE + SIO_INTERP0_ACCUM0_OFFSET
207207
// todo assert r_source is r2
208208
mov r_output_end, r3
209209

src/rp2_common/pico_audio_spdif/sample_encoding.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
static_assert(8 == sizeof(spdif_subframe_t), "");
1515

1616
// subframe within SPDIF
17-
typedef struct : public FmtDetails<spdif_subframe_t> {
18-
} FmtSPDIF;
17+
struct FmtSPDIF : public FmtDetails<spdif_subframe_t> {
18+
};
1919

2020
template<typename FromFmt>
2121
struct converting_copy<Stereo<FmtSPDIF>, Stereo<FromFmt>> {

src/rp2_common/pico_scanvideo_dpi/CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,13 @@ if (TARGET pico_scanvideo)
1010
target_include_directories(pico_scanvideo_dpi INTERFACE ${CMAKE_CURRENT_LIST_DIR}/include)
1111
target_compile_definitions(pico_scanvideo_dpi INTERFACE VIDEO_DPI)
1212
target_link_libraries(pico_scanvideo_dpi INTERFACE hardware_dma hardware_pio hardware_irq pico_scanvideo)
13+
14+
if (PICO_C_COMPILER_IS_CLANG)
15+
# Clang does not support optimize pragma
16+
set_source_files_properties(
17+
${CMAKE_CURRENT_LIST_DIR}/scanvideo.c
18+
PROPERTIES
19+
COMPILE_OPTIONS "-O3"
20+
)
21+
endif()
1322
endif()

src/rp2_common/pico_scanvideo_dpi/scanvideo.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,18 @@
44
* SPDX-License-Identifier: BSD-3-Clause
55
*/
66

7-
#pragma GCC push_options
7+
#include <stdlib.h>
8+
#include <stdio.h>
9+
#include "pico.h"
10+
11+
GCC_Pragma("GCC push_options")
812

913
#if !PICO_SCANVIDEO_DEBUG_IMPL
1014
#undef PARAM_ASSERTIONS_DISABLE_ALL
1115
#define PARAM_ASSERTIONS_DISABLE_ALL 1
12-
#pragma GCC optimize("O3")
16+
GCC_Pragma("GCC optimize(\"O3\")")
1317
#endif
1418

15-
#include <stdlib.h>
16-
#include <stdio.h>
17-
#include "pico/platform.h"
1819
#include "pico/sem.h"
1920
#include "pico/util/buffer.h"
2021
#include "hardware/clocks.h"
@@ -1855,4 +1856,4 @@ void validate_scanline(const uint32_t *dma_data, uint dma_data_size,
18551856
}
18561857
#endif
18571858

1858-
#pragma GCC pop_options
1859+
GCC_Pragma("GCC pop_options")

0 commit comments

Comments
 (0)