Skip to content

Commit eacf44e

Browse files
committed
Merge remote-tracking branch 'irixxxx/ogg' into lr-ogg
2 parents 975cdaf + 43da7c1 commit eacf44e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+14763
-755
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ jobs:
2222
- uses: actions/checkout@v4
2323
with:
2424
submodules: true
25+
- name: Install dependencies
26+
run: |
27+
sudo apt-get update -qq
28+
sudo apt-get install -y libvorbis-dev
2529
- name: make
2630
run: LDFLAGS=-Wl,--no-undefined make -j$(getconf _NPROCESSORS_ONLN) -f Makefile.libretro
2731
- name: artifacts

Makefile

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,19 @@ OBJS += platform/common/mp3_drmp3.o
330330
endif
331331
endif
332332

333+
OBJS += platform/common/ogg.o
334+
ifeq "$(PLATFORM_TREMOR)" "1"
335+
TREMOR = platform/common/tremor
336+
TREMOR_OBJS += $(TREMOR)/block.o $(TREMOR)/codebook.o $(TREMOR)/floor0.o $(TREMOR)/floor1.o
337+
TREMOR_OBJS += $(TREMOR)/info.o $(TREMOR)/mapping0.o $(TREMOR)/mdct.o $(TREMOR)/registry.o
338+
TREMOR_OBJS += $(TREMOR)/res012.o $(TREMOR)/sharedbook.o $(TREMOR)/synthesis.o $(TREMOR)/window.o
339+
TREMOR_OBJS += $(TREMOR)/vorbisfile.o $(TREMOR)/framing.o $(TREMOR)/bitwise.o
340+
CFLAGS += -I$(TREMOR) -DUSE_TREMOR
341+
OBJS += $(TREMOR_OBJS)
342+
else
343+
LDLIBS += -lvorbisfile
344+
endif
345+
333346
ifeq (1,$(use_libchdr))
334347
CFLAGS += -DUSE_LIBCHDR
335348

@@ -368,9 +381,10 @@ endif
368381

369382
ifeq "$(PLATFORM_ZLIB)" "1"
370383
# zlib
371-
OBJS += zlib/gzio.o zlib/inffast.o zlib/inflate.o zlib/inftrees.o zlib/trees.o \
384+
ZLIB_OBJS = zlib/gzio.o zlib/inffast.o zlib/inflate.o zlib/inftrees.o zlib/trees.o \
372385
zlib/deflate.o zlib/crc32.o zlib/adler32.o zlib/zutil.o zlib/compress.o zlib/uncompr.o
373386
CFLAGS += -Izlib
387+
OBJS += $(ZLIB_OBJS)
374388
endif
375389
# unzip
376390
OBJS += unzip/unzip.o

Makefile.libretro

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -711,6 +711,8 @@ else
711711
LD = $(CC)
712712
endif
713713

714+
# rely on ogg vorbis in retroarch to avoid version conflicts
715+
PLATFORM_TREMOR ?= 0
714716
PLATFORM_ZLIB ?= 1
715717

716718
include Makefile

configure

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -496,15 +496,12 @@ echo >> $config_mak
496496
echo "ARCH = $ARCH" >> $config_mak
497497
echo "PLATFORM = $platform" >> $config_mak
498498
echo "SOUND_DRIVERS = $sound_drivers" >> $config_mak
499-
if [ "$have_gles" = "yes" ]; then
500-
echo "HAVE_GLES = 1" >> $config_mak
501-
fi
502-
if [ "$have_libavcodec" = "yes" ]; then
503-
echo "HAVE_LIBAVCODEC = 1" >> $config_mak
504-
fi
505-
if [ "$need_zlib" = "yes" ]; then
506-
echo "PLATFORM_ZLIB = 1" >> $config_mak
507-
fi
499+
[ "$have_gles" = "yes" ] && echo "HAVE_GLES = 1" >> $config_mak
500+
[ "$have_libavcodec" = "yes" ] && echo "HAVE_LIBAVCODEC = 1" >> $config_mak
501+
[ "$need_zlib" = "yes" ] && echo "PLATFORM_ZLIB = 1" >> $config_mak
502+
# we always use the internal tremor decoder for standalone
503+
echo "PLATFORM_TREMOR = 1" >> $config_mak
504+
508505
if [ "$ARCH" = "arm" -a "$have_armv6" != "yes" -a "$have_armv7" != "yes" ]; then
509506
# pass info to cyclone not to use newer arm arch instructions
510507
echo "HAVE_ARMv6 = 0" >> $config_mak

cpu/drc/emit_arm.c

Lines changed: 167 additions & 213 deletions
Large diffs are not rendered by default.

cpu/drc/emit_arm64.c

Lines changed: 13 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -363,16 +363,16 @@ enum { AM_IDX, AM_IDXPOST, AM_IDXREG, AM_IDXPRE };
363363
EMIT_PTR(ptr, A64_B(val_ & 0x0fffffff)); \
364364
}
365365

366-
#define EMITH_JMP_START(cond) { \
367-
u8 *cond_ptr; \
366+
#define EMITH_JMP_START(cond) \
367+
{ u8 *cond_ptr; \
368368
JMP_POS(cond_ptr)
369369

370370
#define EMITH_JMP_END(cond) \
371371
JMP_EMIT(cond, cond_ptr); \
372372
}
373373

374-
#define EMITH_JMP3_START(cond) { \
375-
u8 *cond_ptr, *else_ptr; \
374+
#define EMITH_JMP3_START(cond) \
375+
{ u8 *cond_ptr, *else_ptr; \
376376
JMP_POS(cond_ptr)
377377

378378
#define EMITH_JMP3_MID(cond) \
@@ -405,13 +405,9 @@ enum { AM_IDX, AM_IDXPOST, AM_IDXREG, AM_IDXPRE };
405405
// data processing, register
406406
#define emith_move_r_r_ptr(d, s) \
407407
EMIT(A64_MOVX_REG(d, s, ST_LSL, 0))
408-
#define emith_move_r_r_ptr_c(cond, d, s) \
409-
emith_move_r_r_ptr(d, s)
410408

411409
#define emith_move_r_r(d, s) \
412410
EMIT(A64_MOV_REG(d, s, ST_LSL, 0))
413-
#define emith_move_r_r_c(cond, d, s) \
414-
emith_move_r_r(d, s)
415411

416412
#define emith_mvn_r_r(d, s) \
417413
EMIT(A64_MVN_REG(d, s, ST_LSL, 0))
@@ -530,8 +526,6 @@ enum { AM_IDX, AM_IDXPOST, AM_IDXREG, AM_IDXPRE };
530526

531527
#define emith_and_r_r(d, s) \
532528
emith_and_r_r_r(d, d, s)
533-
#define emith_and_r_r_c(cond, d, s) \
534-
emith_and_r_r(d, s)
535529

536530
#define emith_or_r_r(d, s) \
537531
emith_or_r_r_r(d, d, s)
@@ -598,8 +592,6 @@ static void emith_move_imm64(int r, int wx, int64_t imm)
598592

599593
#define emith_move_r_imm(r, imm) \
600594
emith_move_imm64(r, 0, (s32)(imm))
601-
#define emith_move_r_imm_c(cond, r, imm) \
602-
emith_move_r_imm(r, imm)
603595

604596
#define emith_move_r_imm_s8_patchable(r, imm) do { \
605597
if ((s8)(imm) < 0) \
@@ -648,16 +640,12 @@ static void emith_arith_imm(int op, int wx, int rd, int rn, s32 imm)
648640

649641
#define emith_add_r_imm(r, imm) \
650642
emith_arith_imm(OP_ADD, 0, r, r, imm)
651-
#define emith_add_r_imm_c(cond, r, imm) \
652-
emith_add_r_imm(r, imm)
653643

654644
#define emith_addf_r_imm(r, imm) \
655645
emith_arith_imm(OP_ADDS, 0, r, r, imm)
656646

657647
#define emith_sub_r_imm(r, imm) \
658648
emith_arith_imm(OP_SUB, 0, r, r, imm)
659-
#define emith_sub_r_imm_c(cond, r, imm) \
660-
emith_sub_r_imm(r, imm)
661649

662650
#define emith_subf_r_imm(r, imm) \
663651
emith_arith_imm(OP_SUBS, 0, r, r, imm)
@@ -695,8 +683,6 @@ static void emith_arith_imm(int op, int wx, int rd, int rn, s32 imm)
695683

696684
#define emith_sub_r_r_imm(d, s, imm) \
697685
emith_arith_imm(OP_SUB, 0, d, s, imm)
698-
#define emith_sub_r_r_imm_c(cond, d, s, imm) \
699-
emith_sub_r_r_imm(d, s, imm)
700686

701687
#define emith_subf_r_r_imm(d, s, imm) \
702688
emith_arith_imm(OP_SUBS, 0, d, s, imm)
@@ -748,29 +734,19 @@ static void emith_log_imm(int op, int wx, int rd, int rn, u32 imm)
748734

749735
#define emith_or_r_imm(r, imm) \
750736
emith_log_imm(OP_OR, 0, r, r, imm)
751-
#define emith_or_r_imm_c(cond, r, imm) \
752-
emith_or_r_imm(r, imm)
753737

754738
#define emith_eor_r_imm_ptr(r, imm) \
755739
emith_log_imm(OP_EOR, 1, r, r, imm)
756-
#define emith_eor_r_imm_ptr_c(cond, r, imm) \
757-
emith_eor_r_imm_ptr(r, imm)
758740

759741
#define emith_eor_r_imm(r, imm) \
760742
emith_log_imm(OP_EOR, 0, r, r, imm)
761-
#define emith_eor_r_imm_c(cond, r, imm) \
762-
emith_eor_r_imm(r, imm)
763743

764744
/* NB: BIC #imm not available in A64; use AND #~imm instead */
765745
#define emith_bic_r_imm(r, imm) \
766746
emith_log_imm(OP_AND, 0, r, r, ~(imm))
767-
#define emith_bic_r_imm_c(cond, r, imm) \
768-
emith_bic_r_imm(r, imm)
769747

770748
#define emith_tst_r_imm(r, imm) \
771749
emith_log_imm(OP_ANDS, 0, Z0, r, imm)
772-
#define emith_tst_r_imm_c(cond, r, imm) \
773-
emith_tst_r_imm(r, imm)
774750

775751
#define emith_and_r_r_imm(d, s, imm) \
776752
emith_log_imm(OP_AND, 0, d, s, imm)
@@ -794,8 +770,6 @@ static void emith_log_imm(int op, int wx, int rd, int rn, u32 imm)
794770

795771
#define emith_ror(d, s, cnt) \
796772
EMIT(A64_ROR_IMM(d, s, cnt))
797-
#define emith_ror_c(cond, d, s, cnt) \
798-
emith_ror(d, s, cnt)
799773

800774
#define emith_rol(d, s, cnt) \
801775
EMIT(A64_ROR_IMM(d, s, 32-(cnt)))
@@ -867,8 +841,6 @@ static void emith_log_imm(int op, int wx, int rd, int rn, u32 imm)
867841
// signed/unsigned extend
868842
#define emith_clear_msb(d, s, count) /* bits to clear */ \
869843
EMIT(A64_UXT_IMM(d, s, 32-(count)))
870-
#define emith_clear_msb_c(cond, d, s, count) \
871-
emith_clear_msb(d, s, count)
872844

873845
#define emith_sext(d, s, count) /* bits to keep */ \
874846
EMIT(A64_SXT_IMM(d, s, count))
@@ -901,8 +873,6 @@ static void emith_log_imm(int op, int wx, int rd, int rn, u32 imm)
901873
EMIT(A64_SMADDL(dlo, s1, s2, dlo)); \
902874
emith_split64(dlo, dhi); \
903875
} while (0)
904-
#define emith_mula_s64_c(cond, dlo, dhi, s1, s2) \
905-
emith_mula_s64(dlo, dhi, s1, s2)
906876

907877
// load/store. offs has 9 bits signed, hence larger offs may use a temp
908878
static void emith_ldst_offs(int sz, int rd, int rn, int o9, int ld, int mode)
@@ -925,90 +895,58 @@ static void emith_ldst_offs(int sz, int rd, int rn, int o9, int ld, int mode)
925895

926896
#define emith_read_r_r_offs_ptr(r, rs, offs) \
927897
emith_ldst_offs(AM_X, r, rs, offs, LT_LD, AM_IDX)
928-
#define emith_read_r_r_offs_ptr_c(cond, r, rs, offs) \
929-
emith_read_r_r_offs_ptr(r, rs, offs)
930898

931899
#define emith_read_r_r_offs(r, rs, offs) \
932900
emith_ldst_offs(AM_W, r, rs, offs, LT_LD, AM_IDX)
933-
#define emith_read_r_r_offs_c(cond, r, rs, offs) \
934-
emith_read_r_r_offs(r, rs, offs)
935901

936902
#define emith_read_r_r_r_ptr(r, rs, rm) \
937903
EMIT(A64_LDSTX_REG(r, rs, rm, LT_LD, XT_SXTW))
938904

939905
#define emith_read_r_r_r(r, rs, rm) \
940906
EMIT(A64_LDST_REG(r, rs, rm, LT_LD, XT_SXTW))
941-
#define emith_read_r_r_r_c(cond, r, rs, rm) \
942-
emith_read_r_r_r(r, rs, rm)
943907

944908
#define emith_read8_r_r_offs(r, rs, offs) \
945909
emith_ldst_offs(AM_B, r, rs, offs, LT_LD, AM_IDX)
946-
#define emith_read8_r_r_offs_c(cond, r, rs, offs) \
947-
emith_read8_r_r_offs(r, rs, offs)
948910

949911
#define emith_read8_r_r_r(r, rs, rm) \
950912
EMIT(A64_LDSTB_REG(r, rs, rm, LT_LD, XT_SXTW))
951-
#define emith_read8_r_r_r_c(cond, r, rs, rm) \
952-
emith_read8_r_r_r(r, rs, rm)
953913

954914
#define emith_read16_r_r_offs(r, rs, offs) \
955915
emith_ldst_offs(AM_H, r, rs, offs, LT_LD, AM_IDX)
956-
#define emith_read16_r_r_offs_c(cond, r, rs, offs) \
957-
emith_read16_r_r_offs(r, rs, offs)
958916

959917
#define emith_read16_r_r_r(r, rs, rm) \
960918
EMIT(A64_LDSTH_REG(r, rs, rm, LT_LD, XT_SXTW))
961-
#define emith_read16_r_r_r_c(cond, r, rs, rm) \
962-
emith_read16_r_r_r(r, rs, rm)
963919

964920
#define emith_read8s_r_r_offs(r, rs, offs) \
965921
emith_ldst_offs(AM_B, r, rs, offs, LT_LDS, AM_IDX)
966-
#define emith_read8s_r_r_offs_c(cond, r, rs, offs) \
967-
emith_read8s_r_r_offs(r, rs, offs)
968922

969923
#define emith_read8s_r_r_r(r, rs, rm) \
970924
EMIT(A64_LDSTB_REG(r, rs, rm, LT_LDS, XT_SXTW))
971-
#define emith_read8s_r_r_r_c(cond, r, rs, rm) \
972-
emith_read8s_r_r_r(r, rs, rm)
973925

974926
#define emith_read16s_r_r_offs(r, rs, offs) \
975927
emith_ldst_offs(AM_H, r, rs, offs, LT_LDS, AM_IDX)
976-
#define emith_read16s_r_r_offs_c(cond, r, rs, offs) \
977-
emith_read16s_r_r_offs(r, rs, offs)
978928

979929
#define emith_read16s_r_r_r(r, rs, rm) \
980930
EMIT(A64_LDSTH_REG(r, rs, rm, LT_LDS, XT_SXTW))
981-
#define emith_read16s_r_r_r_c(cond, r, rs, rm) \
982-
emith_read16s_r_r_r(r, rs, rm)
983931

984932

985933
#define emith_write_r_r_offs_ptr(r, rs, offs) \
986934
emith_ldst_offs(AM_X, r, rs, offs, LT_ST, AM_IDX)
987-
#define emith_write_r_r_offs_ptr_c(cond, r, rs, offs) \
988-
emith_write_r_r_offs_ptr(r, rs, offs)
989935

990936
#define emith_write_r_r_r_ptr(r, rs, rm) \
991937
EMIT(A64_LDSTX_REG(r, rs, rm, LT_ST, XT_SXTW))
992-
#define emith_write_r_r_r_ptr_c(cond, r, rs, rm) \
993-
emith_write_r_r_r_ptr(r, rs, rm)
994938

995939
#define emith_write_r_r_offs(r, rs, offs) \
996940
emith_ldst_offs(AM_W, r, rs, offs, LT_ST, AM_IDX)
997-
#define emith_write_r_r_offs_c(cond, r, rs, offs) \
998-
emith_write_r_r_offs(r, rs, offs)
999941

1000942
#define emith_write_r_r_r(r, rs, rm) \
1001943
EMIT(A64_LDST_REG(r, rs, rm, LT_ST, XT_SXTW))
1002-
#define emith_write_r_r_r_c(cond, r, rs, rm) \
1003-
emith_write_r_r_r(r, rs, rm)
1004944

1005945
#define emith_ctx_read_ptr(r, offs) \
1006946
emith_read_r_r_offs_ptr(r, CONTEXT_REG, offs)
1007947

1008948
#define emith_ctx_read(r, offs) \
1009949
emith_read_r_r_offs(r, CONTEXT_REG, offs)
1010-
#define emith_ctx_read_c(cond, r, offs) \
1011-
emith_ctx_read(r, offs)
1012950

1013951
#define emith_ctx_write_ptr(r, offs) \
1014952
emith_write_r_r_offs_ptr(r, CONTEXT_REG, offs)
@@ -1117,17 +1055,13 @@ static void emith_ldst_offs(int sz, int rd, int rn, int o9, int ld, int mode)
11171055

11181056
#define emith_jump_reg(r) \
11191057
EMIT(A64_BR(r))
1120-
#define emith_jump_reg_c(cond, r) \
1121-
emith_jump_reg(r)
11221058

11231059
#define emith_jump_ctx(offs) do { \
11241060
int _t = rcache_get_tmp(); \
11251061
emith_ctx_read_ptr(_t, offs); \
11261062
emith_jump_reg(_t); \
11271063
rcache_free_tmp(_t); \
11281064
} while (0)
1129-
#define emith_jump_ctx_c(cond, offs) \
1130-
emith_jump_ctx(offs)
11311065

11321066
#define emith_call(target) do { \
11331067
u32 disp_ = (u8 *)target - (u8 *)tcache_ptr; \
@@ -1148,8 +1082,6 @@ static void emith_ldst_offs(int sz, int rd, int rn, int o9, int ld, int mode)
11481082

11491083
#define emith_abijump_reg(r) \
11501084
emith_jump_reg(r)
1151-
#define emith_abijump_reg_c(cond, r) \
1152-
emith_abijump_reg(r)
11531085
#define emith_abicall(target) \
11541086
emith_call(target)
11551087
#define emith_abicall_cond(cond, target) \
@@ -1161,8 +1093,6 @@ static void emith_ldst_offs(int sz, int rd, int rn, int o9, int ld, int mode)
11611093

11621094
#define emith_ret() \
11631095
EMIT(A64_RET(LR))
1164-
#define emith_ret_c(cond) \
1165-
emith_ret()
11661096

11671097
#define emith_ret_to_ctx(offs) \
11681098
emith_ctx_write_ptr(LR, offs)
@@ -1250,12 +1180,12 @@ static void emith_ldst_offs(int sz, int rd, int rn, int o9, int ld, int mode)
12501180
t3 = rcache_get_reg(reg, RC_GR_RMW, NULL); \
12511181
emith_cmp_r_r(t3, t2); \
12521182
EMITH_SJMP_START(DCOND_HI); \
1253-
emith_sub_r_r_imm_c(DCOND_LS, t2, t3, 1); \
1183+
emith_sub_r_r_imm(t2, t3, 1); \
12541184
EMITH_SJMP_END(DCOND_HI); \
12551185
/* if (reg <= 1) turns = 0 */ \
12561186
emith_cmp_r_imm(t3, 1); \
12571187
EMITH_SJMP_START(DCOND_HI); \
1258-
emith_move_r_imm_c(DCOND_LS, t2, 0); \
1188+
emith_move_r_imm(t2, 0); \
12591189
EMITH_SJMP_END(DCOND_HI); \
12601190
/* reg -= turns */ \
12611191
emith_sub_r_r(t3, t2); \
@@ -1310,11 +1240,11 @@ static void emith_ldst_offs(int sz, int rd, int rn, int o9, int ld, int mode)
13101240
emith_asr(rn, mh, 15); \
13111241
emith_addf_r_r_r_lsr(rn, rn, mh, 31); \
13121242
EMITH_SJMP_START(DCOND_EQ); /* sum != 0 -> -ovl */ \
1313-
emith_move_r_imm_c(DCOND_NE, ml, 0x00000000); \
1314-
emith_move_r_imm_c(DCOND_NE, mh, 0x00008000); \
1243+
emith_move_r_imm(ml, 0x00000000); \
1244+
emith_move_r_imm(mh, 0x00008000); \
13151245
EMITH_SJMP_START(DCOND_MI); /* sum > 0 -> +ovl */ \
1316-
emith_sub_r_imm_c(DCOND_PL, ml, 1); /* 0xffffffff */ \
1317-
emith_sub_r_imm_c(DCOND_PL, mh, 1); /* 0x00007fff */ \
1246+
emith_sub_r_imm(ml, 1); /* 0xffffffff */ \
1247+
emith_sub_r_imm(mh, 1); /* 0x00007fff */ \
13181248
EMITH_SJMP_END(DCOND_MI); \
13191249
EMITH_SJMP_END(DCOND_EQ); \
13201250
EMITH_SJMP_END(DCOND_EQ); \
@@ -1335,10 +1265,10 @@ static void emith_ldst_offs(int sz, int rd, int rn, int o9, int ld, int mode)
13351265
emith_addf_r_r_r_lsr(rn, mh, ml, 31); /* sum = MACH + (MACL>>31) */ \
13361266
EMITH_SJMP_START(DCOND_EQ); /* sum != 0 -> overflow */ \
13371267
/* XXX: LSB signalling only in SH1, or in SH2 too? */ \
1338-
emith_move_r_imm_c(DCOND_NE, mh, 0x00000001); /* LSB of MACH */ \
1339-
emith_move_r_imm_c(DCOND_NE, ml, 0x80000000); /* -ovrfl */ \
1268+
emith_move_r_imm(mh, 0x00000001); /* LSB of MACH */ \
1269+
emith_move_r_imm(ml, 0x80000000); /* -ovrfl */ \
13401270
EMITH_SJMP_START(DCOND_MI); /* sum > 0 -> +ovrfl */ \
1341-
emith_sub_r_imm_c(DCOND_PL, ml, 1); /* 0x7fffffff */ \
1271+
emith_sub_r_imm(ml, 1); /* 0x7fffffff */ \
13421272
EMITH_SJMP_END(DCOND_MI); \
13431273
EMITH_SJMP_END(DCOND_EQ); \
13441274
EMITH_SJMP_END(DCOND_EQ); \

0 commit comments

Comments
 (0)