From 4e22ddf62665ffbd8644ec379dcc8a5601f1fd5c Mon Sep 17 00:00:00 2001 From: Lauri Kasanen Date: Mon, 24 May 2021 11:30:07 +0300 Subject: [PATCH] Save initial mp3 C baseline asm --- media/.gitignore | 4 + media/Makefile | 18 +- media/audio/mp3/mp3_0_apply_window_float.s | 491 +++++++++++++++++++++ media/audio/mp3/mp3_1_imdct36_float.s | 445 +++++++++++++++++++ media/memmap | 11 + media/misc/memcpy.c | 13 + media/misc/memcpy.s | 44 ++ 7 files changed, 1025 insertions(+), 1 deletion(-) create mode 100644 media/audio/mp3/mp3_0_apply_window_float.s create mode 100644 media/audio/mp3/mp3_1_imdct36_float.s create mode 100644 media/memmap create mode 100644 media/misc/memcpy.c create mode 100644 media/misc/memcpy.s diff --git a/media/.gitignore b/media/.gitignore index 1269488f..0a974c6d 100644 --- a/media/.gitignore +++ b/media/.gitignore @@ -1 +1,5 @@ data +*.o +*.sv +*.elf +*.bin diff --git a/media/Makefile b/media/Makefile index a2f9cf98..cfa7e3dc 100644 --- a/media/Makefile +++ b/media/Makefile @@ -1,8 +1,18 @@ .PHONY: all wget tests +CROSS ?= powerpc64-linux-gnu- +AS = $(CROSS)as +LD = $(CROSS)ld +OBJCOPY = $(CROSS)objcopy + +AFLAGS ?= -mpwr9 + EXPECTED_VER = 1 VER = $(shell cat data/VERSION) +SRC = $(wildcard audio/*/*.s video/*/*.s) +OBJ = $(SRC:.s=.bin) + all: ifneq ($(VER), $(EXPECTED_VER)) $(error Data not found, or version mismatch. Please run "make wget") @@ -15,5 +25,11 @@ wget: wget https://ftp.libre-soc.org/media-test-data.txz tar -C data -xvf media-test-data.txz -tests: +%.bin: %.s + pysvp64asm $< $<.sv + $(AS) $(AFLAGS) -c $<.sv -le -o $<.o + $(LD) $<.o -EL -o $<.elf -T memmap + $(OBJCOPY) $<.elf -I elf64-little -O binary $@ + +tests: $(OBJ) echo juuh diff --git a/media/audio/mp3/mp3_0_apply_window_float.s b/media/audio/mp3/mp3_0_apply_window_float.s new file mode 100644 index 00000000..89b3cfa7 --- /dev/null +++ b/media/audio/mp3/mp3_0_apply_window_float.s @@ -0,0 +1,491 @@ +# ffmpeg lgpl 2.1 or later + + .file "mpegaudiodsp_float.c" + .machine power9 + .abiversion 2 + .section ".text" + .align 2 + .p2align 4,,15 + .globl ff_mpadsp_apply_window_float + .type ff_mpadsp_apply_window_float, @function +ff_mpadsp_apply_window_float: +.LCF0: +0: addis 2,12,.TOC.-.LCF0@ha + addi 2,2,.TOC.-.LCF0@l + .localentry ff_mpadsp_apply_window_float,.-ff_mpadsp_apply_window_float + mflr 0 + stfd 29,-24(1) + stfd 30,-16(1) + stfd 31,-8(1) + std 27,-184(1) + std 28,-176(1) + std 29,-168(1) + std 30,-160(1) + std 31,-152(1) + mr 30,4 + mr 31,3 + mr 4,3 + mr 27,5 + stfd 14,-144(1) + stfd 15,-136(1) + stfd 16,-128(1) + stfd 17,-120(1) + stfd 18,-112(1) + stfd 19,-104(1) + stfd 20,-96(1) + stfd 21,-88(1) + stfd 22,-80(1) + stfd 23,-72(1) + stfd 24,-64(1) + stfd 25,-56(1) + stfd 26,-48(1) + std 0,16(1) + stfd 27,-40(1) + stfd 28,-32(1) + li 5,128 + stdu 1,-224(1) + addi 3,3,2048 + mr 28,6 + mr 29,7 + bl memcpy + nop + lfs 12,512(30) + lfs 8,576(31) + lfs 3,64(31) + lfiwax 9,0,27 + lfs 11,0(30) + lfs 5,832(31) + lfs 6,1088(31) + lfs 30,768(30) + lfs 31,1024(30) + lfs 2,1792(30) + lfs 4,256(30) + lfs 10,320(31) + fmuls 29,12,8 + lfs 8,1856(31) + mulli 11,29,124 + fcfids 9,9 + lfs 12,960(31) + cmpdi 0,29,1 + addi 6,31,64 + fmuls 11,11,3 + lfs 7,1344(31) + sldi 4,29,2 + fmuls 30,30,5 + lfs 5,640(30) + fmuls 31,31,6 + lfs 6,896(30) + add 7,28,4 + neg 3,4 + fmuls 10,4,10 + lfs 1,1280(30) + add 11,28,11 + fmuls 2,2,8 + lfs 8,704(31) + fadds 11,11,9 + lfs 0,1600(31) + lfs 13,1536(30) + lfs 4,192(31) + lfs 3,128(30) + lfs 9,1216(31) + fmuls 6,6,12 + lfs 12,1472(31) + fmuls 1,1,7 + lfs 7,448(31) + fmuls 5,5,8 + lfs 8,1408(30) + fadds 11,11,10 + lfs 10,1920(30) + fmuls 13,13,0 + lfs 0,384(30) + fmuls 3,3,4 + fmuls 8,8,12 + fadds 12,11,29 + fmuls 4,0,7 + lfs 7,1152(30) + lfs 0,1728(31) + fadds 12,12,30 + fmuls 7,7,9 + lfs 9,1664(30) + fadds 12,12,31 + fmuls 9,9,0 + lfs 0,1984(31) + fadds 12,12,1 + fadds 12,12,13 + fmuls 11,10,0 + fadds 12,12,2 + fsubs 12,12,3 + fsubs 0,12,4 + fsubs 0,0,5 + fsubs 0,0,6 + fsubs 0,0,7 + fsubs 0,0,8 + fsubs 0,0,9 + fsubs 0,0,11 + stfs 0,0(28) + bne 0,.L10 + li 5,15 + mr 9,30 + addi 10,30,128 + addi 8,31,192 + mr 12,7 + mtctr 5 + .p2align 4,,15 +.L5: + lfsu 0,-4(10) + lfsu 15,4(6) + lfsu 9,-4(8) + lfs 26,260(9) + lfs 12,4(9) + addi 9,9,4 + lfs 24,256(10) + lfs 25,512(10) + lfs 14,256(6) + fmuls 0,15,0 + lfs 6,512(6) + lfs 23,1280(8) + lfs 7,768(6) + lfs 8,1024(6) + lfs 16,1280(6) + lfs 17,1536(6) + lfs 18,1792(6) + lfs 19,256(8) + fneg 0,0 + lfs 20,512(8) + fmuls 12,15,12 + fmuls 24,14,24 + lfs 21,768(8) + fmuls 26,14,26 + lfs 22,1024(8) + lfs 10,1536(8) + lfs 11,1792(8) + fmuls 25,6,25 + lfs 27,768(10) + lfs 28,1024(10) + lfs 29,1280(10) + lfs 30,1536(10) + lfs 31,1792(10) + lfs 1,128(10) + lfs 13,384(10) + lfs 2,640(10) + lfs 3,896(10) + lfs 4,1152(10) + lfs 5,1408(10) + fsubs 0,0,24 + fadds 26,26,12 + lfs 24,512(9) + lfs 12,1024(9) + fmuls 27,7,27 + fmuls 28,8,28 + fmuls 29,16,29 + fmuls 30,17,30 + fmuls 31,18,31 + fmuls 1,9,1 + lfs 15,1664(10) + fmuls 13,19,13 + fmuls 2,20,2 + fsubs 0,0,25 + lfs 25,768(9) + fmuls 3,21,3 + fmuls 5,23,5 + fmuls 4,22,4 + fmuls 6,6,24 + fmuls 8,8,12 + lfs 12,1792(9) + lfs 24,1408(9) + fmuls 14,10,15 + lfs 15,1920(10) + fsubs 0,0,27 + lfs 27,1536(9) + fmuls 7,7,25 + lfs 25,1280(9) + fadds 26,26,6 + lfs 6,640(9) + fmuls 18,18,12 + lfs 12,128(9) + fmuls 24,23,24 + fsubs 0,0,28 + lfs 28,384(9) + fmuls 15,11,15 + fmuls 17,17,27 + lfs 27,1920(9) + fadds 26,26,7 + fmuls 16,16,25 + fmuls 20,20,6 + fmuls 9,9,12 + lfs 12,896(9) + fsubs 0,0,29 + fmuls 19,19,28 + fadds 26,26,8 + fmuls 11,11,27 + fsubs 30,0,30 + fmuls 21,21,12 + lfs 12,1152(9) + fadds 16,26,16 + fsubs 31,30,31 + fmuls 22,22,12 + lfs 12,1664(9) + fadds 17,16,17 + fsubs 1,31,1 + fadds 18,17,18 + fmuls 10,10,12 + fsubs 13,1,13 + fsubs 9,18,9 + fsubs 2,13,2 + fsubs 23,9,19 + fsubs 3,2,3 + fsubs 23,23,20 + fsubs 4,3,4 + fsubs 23,23,21 + fsubs 5,4,5 + fsubs 23,23,22 + fsubs 14,5,14 + fsubs 23,23,24 + fsubs 15,14,15 + fsubs 10,23,10 + fsubs 11,10,11 + stfs 11,0(12) + stfs 15,0(11) + add 12,12,4 + add 11,11,3 + bdnz .L5 +.L4: + lfs 31,128(31) + lfs 12,192(30) + lfs 5,384(31) + lfs 0,448(30) + lfs 1,640(31) + lfs 6,704(30) + lfs 13,896(31) + lfs 7,960(30) + lfs 2,1152(31) + lfs 8,1216(30) + lfs 3,1408(31) + lfs 9,1472(30) + fmuls 12,12,31 + lfs 4,1664(31) + addi 1,1,224 + li 9,0 + fmuls 0,0,5 + lfs 10,1728(30) + mulli 29,29,60 + fmuls 6,6,1 + lfs 5,1920(31) + ld 0,16(1) + ld 28,-176(1) + fmuls 7,7,13 + lfs 11,1984(30) + ld 31,-152(1) + ld 30,-160(1) + fmuls 8,8,2 + lfd 14,-144(1) + lfd 15,-136(1) + lfd 16,-128(1) + fneg 12,12 + fmuls 9,9,3 + lfd 17,-120(1) + lfd 18,-112(1) + mtlr 0 + lfd 19,-104(1) + lfd 20,-96(1) + lfd 21,-88(1) + fsubs 0,12,0 + fmuls 10,10,4 + fmuls 11,11,5 + fsubs 0,0,6 + fsubs 0,0,7 + fsubs 0,0,8 + fsubs 0,0,9 + fsubs 0,0,10 + fsubs 0,0,11 + stfsx 0,7,29 + stw 9,0(27) + ld 29,-168(1) + ld 27,-184(1) + lfd 22,-80(1) + lfd 23,-72(1) + lfd 24,-64(1) + lfd 25,-56(1) + lfd 26,-48(1) + lfd 27,-40(1) + lfd 28,-32(1) + lfd 29,-24(1) + lfd 30,-16(1) + lfd 31,-8(1) + blr + .p2align 4,,15 +.L10: + li 5,15 + mr 10,30 + addi 9,30,128 + addi 8,31,192 + mr 12,7 + mtctr 5 + .p2align 4,,15 +.L3: + lfsu 0,-4(9) + lfsu 14,4(6) + lfsu 1,4(10) + lfsu 22,-4(8) + lfs 30,256(9) + lfs 31,512(9) + lfs 15,256(6) + fmuls 0,14,0 + lfs 16,512(6) + lfs 18,1024(6) + lfs 19,1280(6) + lfs 24,512(8) + lfs 29,1792(8) + lfs 17,768(6) + lfs 20,1536(6) + lfs 21,1792(6) + fneg 0,0 + lfs 23,256(8) + fmuls 1,14,1 + fmuls 30,15,30 + lfs 25,768(8) + lfs 26,1024(8) + lfs 27,1280(8) + lfs 28,1536(8) + fmuls 31,16,31 + lfs 13,768(9) + lfs 2,1024(9) + lfs 3,1280(9) + lfs 4,1536(9) + lfs 5,1792(9) + lfs 6,128(9) + lfs 7,384(9) + lfs 8,640(9) + lfs 9,896(9) + lfs 10,1152(9) + lfs 11,1408(9) + lfs 12,1664(9) + fsubs 0,0,30 + lfs 30,256(10) + fmuls 13,17,13 + fmuls 2,18,2 + fmuls 3,19,3 + fmuls 4,20,4 + fmuls 5,21,5 + fmuls 6,22,6 + lfs 14,1920(9) + fmuls 8,24,8 + fmuls 7,23,7 + fmuls 10,26,10 + fmuls 9,25,9 + fsubs 0,0,31 + lfs 31,768(10) + fmuls 11,27,11 + fmuls 15,15,30 + lfs 30,512(10) + fmuls 12,28,12 + fmuls 14,29,14 + fsubs 0,0,13 + lfs 13,1024(10) + fmuls 17,17,31 + lfs 31,1280(10) + fadds 1,1,15 + fmuls 16,16,30 + fsubs 2,0,2 + lfs 0,128(10) + fmuls 13,18,13 + fmuls 18,19,31 + fadds 19,1,16 + lfs 1,1792(10) + lfs 31,1536(10) + fsubs 3,2,3 + lfs 2,896(10) + fmuls 22,22,0 + lfs 0,1152(10) + fadds 19,19,17 + fmuls 21,21,1 + lfs 1,640(10) + fmuls 20,20,31 + lfs 31,384(10) + fsubs 4,3,4 + lfs 3,1664(10) + fmuls 25,25,2 + lfs 2,1408(10) + fadds 19,19,13 + fmuls 26,26,0 + lfs 0,1920(10) + fmuls 1,24,1 + fsubs 5,4,5 + fmuls 23,23,31 + fmuls 28,28,3 + fadds 19,19,18 + fmuls 27,27,2 + fmuls 0,29,0 + fsubs 6,5,6 + fadds 24,19,20 + fsubs 7,6,7 + fadds 24,24,21 + fsubs 8,7,8 + fsubs 24,24,22 + fsubs 9,8,9 + fsubs 24,24,23 + fsubs 10,9,10 + fsubs 24,24,1 + fsubs 11,10,11 + fsubs 29,24,25 + fsubs 12,11,12 + fsubs 29,29,26 + fsubs 14,12,14 + fsubs 29,29,27 + fsubs 29,29,28 + fsubs 29,29,0 + stfs 29,0(12) + stfs 14,0(11) + add 12,12,4 + add 11,11,3 + bdnz .L3 + b .L4 + .long 0 + .byte 0,0,2,1,146,5,0,0 + .size ff_mpadsp_apply_window_float,.-ff_mpadsp_apply_window_float + .ident "GCC: (GNU) 10.3.0" + .section .note.GNU-stack,"",@progbits + .file "memcpy.c" + .machine power9 + .abiversion 2 + .section ".text" + .align 2 + .globl memcpy + .type memcpy, @function +memcpy: + std 31,-8(1) + stdu 1,-96(1) + mr 31,1 + std 3,48(31) + std 4,56(31) + std 5,64(31) + ld 9,48(31) + std 9,32(31) + ld 9,56(31) + std 9,40(31) + b .Lmemcpy_2 +.Lmemcpy_3: + ld 10,40(31) + addi 9,10,1 + std 9,40(31) + ld 9,32(31) + addi 8,9,1 + std 8,32(31) + lbz 10,0(10) + stb 10,0(9) +.Lmemcpy_2: + ld 9,64(31) + addi 10,9,-1 + std 10,64(31) + cmpdi 0,9,0 + bne 0,.Lmemcpy_3 + ld 9,48(31) + mr 3,9 + addi 1,31,96 + ld 31,-8(1) + blr + .long 0 + .byte 0,0,0,0,128,1,0,1 + .size memcpy,.-memcpy + .ident "GCC: (GNU) 10.3.0" + .section .note.GNU-stack,"",@progbits diff --git a/media/audio/mp3/mp3_1_imdct36_float.s b/media/audio/mp3/mp3_1_imdct36_float.s new file mode 100644 index 00000000..bf1dac5c --- /dev/null +++ b/media/audio/mp3/mp3_1_imdct36_float.s @@ -0,0 +1,445 @@ +# ffmpeg lgpl 2.1 or later + + .file "mpegaudiodsp_float.c" + .machine power9 + .abiversion 2 + .section ".text" + .section ".toc","aw" + .align 3 +.LCTOC0: + .tc .LCTOC1[TC],.LCTOC1 + .section ".toc1","aw" + .align 3 +.LCTOC1 = .+32768 +.LC0: + .quad 0x3f000000 +.LC1: + .quad 0x3f708fb2 +.LC2: + .quad 0xbe31d0d4 +.LC3: + .quad 0xbf441b7d +.LC4: + .quad 0xbf5db3d7 +.LC5: + .quad 0x3f7c1c5c +.LC6: + .quad 0xbeaf1d44 +.LC7: + .quad 0x3f5db3d7 +.LC8: + .quad 0xbf248dbb +.LC9: + .quad 0x3f007d2b +.LC10: + .quad 0x40b79454 +.LC11: + .quad 0x3f0483ee +.LC12: + .quad 0x3ff746ea +.LC13: + .quad 0x3f0d3b7d +.LC14: + .quad 0x3f976fd9 +.LC15: + .quad 0x3f1c4257 +.LC16: + .quad 0x3f5f2944 +.LC17: + .quad 0x3f3504f3 + .section ".text" + .align 2 + .p2align 4,,15 + .globl imdct36 + .type imdct36, @function +imdct36: +.LCF0: +0: addis 2,12,.TOC.-.LCF0@ha + addi 2,2,.TOC.-.LCF0@l + .localentry imdct36,.-imdct36 + stfd 15,-136(1) + stfd 16,-128(1) + stfd 17,-120(1) + stfd 18,-112(1) + stfd 19,-104(1) + stfd 20,-96(1) + stfd 21,-88(1) + stfd 22,-80(1) + stfd 23,-72(1) + stfd 24,-64(1) + stfd 25,-56(1) + stfd 26,-48(1) + stfd 27,-40(1) + stfd 28,-32(1) + stfd 29,-24(1) + stfd 30,-16(1) + stfd 31,-8(1) + std 30,-152(1) + lfs 11,60(5) + lfs 12,52(5) + lfs 27,48(5) + lfs 1,40(5) + lfs 13,32(5) + lfs 2,24(5) + lfs 19,64(5) + lfs 30,56(5) + lfs 29,44(5) + lfs 3,36(5) + lfs 6,28(5) + lfs 8,20(5) + lfs 31,16(5) + lfs 10,68(5) + lfs 5,12(5) + lfs 9,4(5) + lfs 4,0(5) + lfs 18,8(5) + fadds 28,12,27 + ld 30,.LCTOC0@toc(2) + fadds 7,11,30 + fadds 0,29,1 + fadds 30,30,12 + fadds 29,27,29 + fadds 12,6,2 + fadds 6,13,6 + fadds 16,8,31 + fadds 8,2,8 + fadds 10,19,10 + fadds 19,19,11 + fadds 11,3,13 + fadds 31,31,5 + fadds 24,4,9 + fadds 3,1,3 + lfs 1,.LC0-.LCTOC1(30) + fadds 17,5,18 + fadds 18,18,9 + lfs 27,.LC5-.LCTOC1(30) + stfs 6,32(5) + lfs 5,.LC6-.LCTOC1(30) + stfs 29,48(5) + lfs 13,.LC1-.LCTOC1(30) + stfs 30,56(5) + stfs 8,24(5) + fadds 10,10,7 + fadds 7,7,28 + fadds 28,28,0 + fadds 0,0,11 + fadds 11,11,12 + fadds 12,12,16 + fadds 2,6,31 + fsubs 23,6,19 + fadds 16,16,17 + fadds 17,24,17 + fadds 6,19,6 + fsubs 26,3,30 + fadds 21,3,18 + stfs 19,64(5) + stfs 31,16(5) + stfs 24,4(5) + stfs 3,40(5) + fadds 3,30,3 + stfs 18,8(5) + fadds 30,30,18 + fsubs 9,0,7 + stfs 28,52(5) + stfs 10,68(5) + stfs 0,44(5) + fsubs 22,11,10 + fmuls 2,2,13 + stfs 11,36(5) + stfs 12,28(5) + fadds 20,17,0 + fadds 25,11,16 + fsubs 6,6,31 + fadds 31,19,31 + fmuls 19,28,1 + fmuls 21,21,27 + fsubs 28,24,28 + fadds 11,10,11 + fsubs 3,3,18 + stfs 16,20(5) + fadds 10,10,16 + fadds 0,7,0 + fmuls 9,9,5 + fmuls 5,26,5 + lfs 26,.LC2-.LCTOC1(30) + lfs 15,.LC9-.LCTOC1(30) + stfs 7,60(5) + stfs 17,12(5) + fmuls 20,20,27 + lfs 27,.LC7-.LCTOC1(30) + fmuls 13,25,13 + fadds 24,19,24 + fmuls 25,29,1 + fsubs 29,4,29 + fsubs 11,11,16 + lfs 16,.LC10-.LCTOC1(30) + fadds 7,17,7 + fsubs 0,0,17 + fadds 18,21,5 + fmuls 22,22,26 + fmuls 23,23,26 + fadds 19,20,9 + fmuls 12,12,27 + fadds 25,25,4 + fadds 4,24,13 + fmuls 8,8,27 + fsubs 13,24,13 + fadds 19,19,12 + fadds 4,4,22 + fadds 26,25,2 + fadds 18,18,8 + fsubs 2,25,2 + fadds 27,4,19 + fsubs 4,4,19 + fmuls 19,11,1 + fmuls 1,6,1 + fadds 26,26,23 + fadds 6,6,29 + fadds 11,11,28 + fsubs 1,29,1 + fmuls 4,4,16 + lfs 29,.LC8-.LCTOC1(30) + lfs 16,.LC4-.LCTOC1(30) + fadds 17,26,18 + fmuls 27,27,15 + fsubs 26,26,18 + fsubs 28,28,19 + lfs 18,.LC3-.LCTOC1(30) + fmuls 30,30,29 + fmuls 7,7,29 + lfs 29,36(6) + fmuls 0,0,16 + fsubs 19,17,27 + fmuls 3,3,16 + fadds 27,27,17 + fmuls 31,31,18 + fmuls 10,10,18 + fsubs 17,26,4 + fadds 4,4,26 + fsubs 18,5,30 + fsubs 5,30,5 + fadds 15,28,0 + fsubs 28,28,0 + lfs 0,144(4) + fmuls 16,19,29 + fadds 26,1,3 + fadds 29,21,30 + fsubs 2,2,31 + fsubs 3,1,3 + fadds 31,25,31 + fsubs 1,9,7 + fsubs 9,7,9 + fsubs 13,13,10 + fadds 24,24,10 + fadds 7,20,7 + fsubs 21,18,8 + fadds 16,16,0 + fsubs 10,29,8 + fadds 0,5,8 + fsubs 8,8,29 + fsubs 23,31,23 + fadds 30,9,12 + fsubs 1,1,12 + fsubs 22,24,22 + fsubs 9,7,12 + fsubs 12,12,7 + fadds 21,21,2 + lfs 5,.LC12-.LCTOC1(30) + stfs 16,1152(3) + fadds 29,0,2 + fadds 1,1,13 + fadds 30,30,13 + fadds 13,10,23 + fadds 8,8,23 + fadds 7,9,22 + fadds 12,12,22 + fmuls 28,28,5 + lfs 10,32(6) + lfs 0,128(4) + fmuls 19,19,10 + fadds 19,19,0 + stfs 19,1024(3) + lfs 0,116(6) + lfs 10,272(4) + fmuls 0,0,27 + stfs 0,144(4) + lfs 0,112(6) + fmuls 27,0,27 + stfs 27,128(4) + lfs 9,68(6) + fmuls 9,17,9 + fadds 9,9,10 + stfs 9,2176(3) + lfs 9,.LC11-.LCTOC1(30) + lfs 10,0(6) + lfs 0,0(4) + fmuls 9,15,9 + fmuls 17,17,10 + fsubs 2,26,9 + fadds 9,9,26 + lfs 10,.LC13-.LCTOC1(30) + fadds 17,17,0 + fmuls 10,1,10 + stfs 17,0(3) + fsubs 1,21,10 + fadds 10,10,21 + lfs 0,148(6) + lfs 27,160(4) + fmuls 0,0,4 + stfs 0,272(4) + lfs 0,80(6) + fmuls 4,0,4 + lfs 0,.LC14-.LCTOC1(30) + stfs 4,0(4) + fsubs 4,3,28 + fadds 3,28,3 + fmuls 30,30,0 + lfs 31,40(6) + fsubs 5,29,30 + fadds 0,30,29 + fmuls 31,2,31 + fadds 31,31,27 + stfs 31,1280(3) + lfs 30,28(6) + lfs 31,112(4) + fmuls 2,2,30 + fadds 2,2,31 + stfs 2,896(3) + lfs 31,120(6) + lfs 30,256(4) + fmuls 31,31,9 + stfs 31,160(4) + lfs 31,108(6) + fmuls 9,31,9 + stfs 9,112(4) + lfs 2,64(6) + fmuls 2,4,2 + fadds 2,2,30 + stfs 2,2048(3) + lfs 2,4(6) + lfs 9,16(4) + fmuls 4,4,2 + fadds 4,4,9 + stfs 4,128(3) + lfs 9,144(6) + lfs 2,176(4) + fmuls 9,9,3 + stfs 9,256(4) + lfs 9,84(6) + fmuls 3,9,3 + stfs 3,16(4) + lfs 4,44(6) + fmuls 4,1,4 + fadds 4,4,2 + lfs 2,.LC15-.LCTOC1(30) + stfs 4,1408(3) + lfs 9,24(6) + lfs 4,96(4) + fmuls 9,1,9 + fadds 9,9,4 + lfs 4,.LC16-.LCTOC1(30) + stfs 9,768(3) + fmuls 12,12,4 + lfs 9,124(6) + lfs 3,240(4) + fsubs 4,8,12 + fadds 8,8,12 + fmuls 9,9,10 + stfs 9,176(4) + lfs 9,104(6) + fmuls 9,9,10 + fmuls 10,7,2 + stfs 9,96(4) + fsubs 9,13,10 + fadds 10,13,10 + lfs 7,60(6) + fmuls 7,5,7 + fadds 7,7,3 + stfs 7,1920(3) + lfs 7,8(6) + lfs 12,32(4) + fmuls 5,5,7 + fadds 5,5,12 + stfs 5,256(3) + lfs 12,140(6) + lfs 5,192(4) + fmuls 12,12,0 + stfs 12,240(4) + lfs 12,88(6) + fmuls 0,12,0 + stfs 0,32(4) + lfs 7,48(6) + fmuls 7,9,7 + fadds 7,7,5 + stfs 7,1536(3) + lfs 12,20(6) + lfs 0,80(4) + fmuls 9,9,12 + fadds 9,9,0 + stfs 9,640(3) + lfs 0,128(6) + lfs 12,224(4) + fmuls 0,0,10 + stfs 0,192(4) + lfs 0,100(6) + fmuls 10,0,10 + stfs 10,80(4) + lfs 10,56(6) + fmuls 10,4,10 + fadds 10,10,12 + stfs 10,1792(3) + lfs 0,12(6) + lfs 12,48(4) + fmuls 0,4,0 + fadds 0,0,12 + lfs 12,.LC17-.LCTOC1(30) + stfs 0,384(3) + fmuls 11,11,12 + lfs 0,136(6) + lfs 10,208(4) + fmuls 0,0,8 + stfs 0,224(4) + lfs 0,92(6) + fmuls 8,0,8 + fsubs 0,6,11 + fadds 6,11,6 + stfs 8,48(4) + lfs 12,52(6) + fmuls 12,0,12 + fadds 12,12,10 + stfs 12,1664(3) + lfs 11,16(6) + lfs 12,64(4) + fmuls 0,0,11 + fadds 0,0,12 + stfs 0,512(3) + lfs 0,132(6) + fmuls 0,0,6 + stfs 0,208(4) + lfs 0,96(6) + fmuls 6,0,6 + stfs 6,64(4) + ld 30,-152(1) + lfd 15,-136(1) + lfd 16,-128(1) + lfd 17,-120(1) + lfd 18,-112(1) + lfd 19,-104(1) + lfd 20,-96(1) + lfd 21,-88(1) + lfd 22,-80(1) + lfd 23,-72(1) + lfd 24,-64(1) + lfd 25,-56(1) + lfd 26,-48(1) + lfd 27,-40(1) + lfd 28,-32(1) + lfd 29,-24(1) + lfd 30,-16(1) + lfd 31,-8(1) + blr + .long 0 + .byte 0,0,2,0,17,2,0,0 + .size imdct36,.-imdct36 + .ident "GCC: (GNU) 10.3.0" + .section .note.GNU-stack,"",@progbits diff --git a/media/memmap b/media/memmap new file mode 100644 index 00000000..8cc1a16e --- /dev/null +++ b/media/memmap @@ -0,0 +1,11 @@ + +MEMORY +{ + ram : ORIGIN = 0x20000000, LENGTH = 128M +} + +SECTIONS +{ + .text : { *(.text*) } > ram + .bss : { *(.text*) } > ram +} diff --git a/media/misc/memcpy.c b/media/misc/memcpy.c new file mode 100644 index 00000000..27dc8ab2 --- /dev/null +++ b/media/misc/memcpy.c @@ -0,0 +1,13 @@ +#include + +void *memcpy(void *dest, const void *src, size_t n) { + + unsigned char *d = dest; + const unsigned char *s = src; + + while (n--) { + *d++ = *s++; + } + + return dest; +} diff --git a/media/misc/memcpy.s b/media/misc/memcpy.s new file mode 100644 index 00000000..87da2826 --- /dev/null +++ b/media/misc/memcpy.s @@ -0,0 +1,44 @@ + .file "memcpy.c" + .machine power9 + .abiversion 2 + .section ".text" + .align 2 + .globl memcpy + .type memcpy, @function +memcpy: + std 31,-8(1) + stdu 1,-96(1) + mr 31,1 + std 3,48(31) + std 4,56(31) + std 5,64(31) + ld 9,48(31) + std 9,32(31) + ld 9,56(31) + std 9,40(31) + b .Lmemcpy_2 +.Lmemcpy_3: + ld 10,40(31) + addi 9,10,1 + std 9,40(31) + ld 9,32(31) + addi 8,9,1 + std 8,32(31) + lbz 10,0(10) + stb 10,0(9) +.Lmemcpy_2: + ld 9,64(31) + addi 10,9,-1 + std 10,64(31) + cmpdi 0,9,0 + bne 0,.Lmemcpy_3 + ld 9,48(31) + mr 3,9 + addi 1,31,96 + ld 31,-8(1) + blr + .long 0 + .byte 0,0,0,0,128,1,0,1 + .size memcpy,.-memcpy + .ident "GCC: (GNU) 10.3.0" + .section .note.GNU-stack,"",@progbits -- 2.30.2