Small cleanup of arm sources.
This commit is contained in:
parent
0d4254f319
commit
011cd37cfb
@ -46,14 +46,17 @@
|
|||||||
#define jnextb0 GETBIT; bcc
|
#define jnextb0 GETBIT; bcc
|
||||||
#define jnextb1 GETBIT; bcs
|
#define jnextb1 GETBIT; bcs
|
||||||
|
|
||||||
|
#ifndef PURE_THUMB
|
||||||
ucl_nrv2b_decompress_32: .globl ucl_nrv2b_decompress_32 @ ARM mode
|
ucl_nrv2b_decompress_32: .globl ucl_nrv2b_decompress_32 @ ARM mode
|
||||||
.type ucl_nrv2b_decompress_32, %function
|
.type ucl_nrv2b_decompress_32, %function
|
||||||
/* error = (*)(char const *src, int len_src, char *dst, int *plen_dst) */
|
/* error = (*)(char const *src, int len_src, char *dst, int *plen_dst) */
|
||||||
adr r12,1+go_thumb_n2b @ load pc-relative address
|
adr r12,1+.thumb_nrv2b_d32 @ load pc-relative address
|
||||||
bx r12 @ enter THUMB mode
|
bx r12 @ enter THUMB mode
|
||||||
|
|
||||||
.code 16 @ THUMB mode
|
.code 16 @ THUMB mode
|
||||||
go_thumb_n2b:
|
.thumb_func
|
||||||
|
#endif
|
||||||
|
|
||||||
|
.thumb_nrv2b_d32:
|
||||||
add r1,len,src @ r1= eof_src;
|
add r1,len,src @ r1= eof_src;
|
||||||
push {r1,r2,r3, r4,r5,r6,r7, lr}
|
push {r1,r2,r3, r4,r5,r6,r7, lr}
|
||||||
mov bits,#1; neg off,bits @ off= -1 initial condition
|
mov bits,#1; neg off,bits @ off= -1 initial condition
|
||||||
@ -121,8 +124,12 @@ get1b: @ Out: Carry= next_bit
|
|||||||
ldrb tmp, [src],#1; orr bits,bits,tmp,lsl #3*8
|
ldrb tmp, [src],#1; orr bits,bits,tmp,lsl #3*8
|
||||||
adcs bits,bits,bits @ Carry= next_bit; set bit0 flag from CarryIn
|
adcs bits,bits,bits @ Carry= next_bit; set bit0 flag from CarryIn
|
||||||
bx lr
|
bx lr
|
||||||
|
.code 16 @ THUMB mode
|
||||||
|
|
||||||
|
#ifndef PURE_THUMB
|
||||||
.size ucl_nrv2b_decompress_32, .-ucl_nrv2b_decompress_32
|
.size ucl_nrv2b_decompress_32, .-ucl_nrv2b_decompress_32
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
vi:ts=8:et:nowrap
|
vi:ts=8:et:nowrap
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -50,12 +50,13 @@
|
|||||||
ucl_nrv2b_decompress_8: .globl ucl_nrv2b_decompress_8 @ ARM mode
|
ucl_nrv2b_decompress_8: .globl ucl_nrv2b_decompress_8 @ ARM mode
|
||||||
.type ucl_nrv2b_decompress_8, %function
|
.type ucl_nrv2b_decompress_8, %function
|
||||||
/* error = (*)(char const *src, int len_src, char *dst, int *plen_dst) */
|
/* error = (*)(char const *src, int len_src, char *dst, int *plen_dst) */
|
||||||
adr r12,1+.go_thumb_n2b @ load pc-relative address
|
adr r12,1+.thumb_nrv2b_d8 @ load pc-relative address
|
||||||
bx r12 @ enter THUMB mode
|
bx r12 @ enter THUMB mode
|
||||||
.code 16 @ THUMB mode
|
.code 16 @ THUMB mode
|
||||||
.thumb_func
|
.thumb_func
|
||||||
#endif
|
#endif
|
||||||
.go_thumb_n2b:
|
|
||||||
|
.thumb_nrv2b_d8:
|
||||||
add r1,len,src @ r1= eof_src;
|
add r1,len,src @ r1= eof_src;
|
||||||
push {r1,r2,r3, r4,r5,r6,r7, lr}
|
push {r1,r2,r3, r4,r5,r6,r7, lr}
|
||||||
mov bits,#1; neg off,bits @ off= -1 initial condition
|
mov bits,#1; neg off,bits @ off= -1 initial condition
|
||||||
@ -118,7 +119,10 @@ copy_n2b:
|
|||||||
sub len,#1; bne copy_n2b
|
sub len,#1; bne copy_n2b
|
||||||
b top_n2b
|
b top_n2b
|
||||||
|
|
||||||
|
#ifndef PURE_THUMB
|
||||||
.size ucl_nrv2b_decompress_8, .-ucl_nrv2b_decompress_8
|
.size ucl_nrv2b_decompress_8, .-ucl_nrv2b_decompress_8
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
vi:ts=8:et:nowrap
|
vi:ts=8:et:nowrap
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -50,12 +50,16 @@
|
|||||||
#define jnextb0 GETBIT; bcc
|
#define jnextb0 GETBIT; bcc
|
||||||
#define jnextb1 GETBIT; bcs
|
#define jnextb1 GETBIT; bcs
|
||||||
|
|
||||||
|
#ifndef PURE_THUMB
|
||||||
ucl_nrv2e_decompress_32: .globl ucl_nrv2e_decompress_32 @ ARM mode
|
ucl_nrv2e_decompress_32: .globl ucl_nrv2e_decompress_32 @ ARM mode
|
||||||
.type ucl_nrv2e_decompress_32, %function
|
.type ucl_nrv2e_decompress_32, %function
|
||||||
/* error = (*)(char const *src, int len_src, char *dst, int *plen_dst) */
|
/* error = (*)(char const *src, int len_src, char *dst, int *plen_dst) */
|
||||||
adr r12,1+thumb_nrv2e_d32; bx r12 @ enter THUMB mode
|
adr r12,1+.thumb_nrv2e_d32; bx r12 @ enter THUMB mode
|
||||||
.code 16 @ THUMB mode
|
.code 16 @ THUMB mode
|
||||||
thumb_nrv2e_d32:
|
.thumb_func
|
||||||
|
#endif
|
||||||
|
|
||||||
|
.thumb_nrv2e_d32:
|
||||||
add r1,len,src @ r1= eof_src;
|
add r1,len,src @ r1= eof_src;
|
||||||
push {r1,r2,r3, r4,r5,r6,r7, lr}
|
push {r1,r2,r3, r4,r5,r6,r7, lr}
|
||||||
mov bits,#1; neg off,bits @ off= -1 initial condition
|
mov bits,#1; neg off,bits @ off= -1 initial condition
|
||||||
@ -129,8 +133,11 @@ get32: @ In: Carry set (unchanged until final adcs)
|
|||||||
ldrb tmp, [src],#1; orr bits,bits,tmp,lsl #3*8
|
ldrb tmp, [src],#1; orr bits,bits,tmp,lsl #3*8
|
||||||
adcs bits,bits,bits @ Set Carry out
|
adcs bits,bits,bits @ Set Carry out
|
||||||
bx lr
|
bx lr
|
||||||
|
.code 16 @ THUMB mode
|
||||||
|
|
||||||
|
#ifndef PURE_THUMB
|
||||||
.size ucl_nrv2e_decompress_32, .-ucl_nrv2e_decompress_32
|
.size ucl_nrv2e_decompress_32, .-ucl_nrv2e_decompress_32
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
vi:ts=8:et:nowrap
|
vi:ts=8:et:nowrap
|
||||||
|
|||||||
@ -80,6 +80,7 @@ ucl_nrv2e_decompress_8: .globl ucl_nrv2e_decompress_8 @ ARM mode
|
|||||||
.code 16 @ THUMB mode
|
.code 16 @ THUMB mode
|
||||||
.thumb_func
|
.thumb_func
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
.thumb_nrv2e_d8:
|
.thumb_nrv2e_d8:
|
||||||
push {r2,r3, r4,r5,r6,r7, lr}
|
push {r2,r3, r4,r5,r6,r7, lr}
|
||||||
#define sp_DST0 0 /* stack offset of original dst */
|
#define sp_DST0 0 /* stack offset of original dst */
|
||||||
@ -90,7 +91,7 @@ ucl_nrv2e_decompress_8: .globl ucl_nrv2e_decompress_8 @ ARM mode
|
|||||||
mov dstlim,tmp
|
mov dstlim,tmp
|
||||||
#endif /*}*/
|
#endif /*}*/
|
||||||
mov bits,#1; neg off,bits @ off= -1 initial condition
|
mov bits,#1; neg off,bits @ off= -1 initial condition
|
||||||
lsl bits,#31 @ 1<<31; refill next time
|
lsl bits,#31 @ 1<<31: refill next time
|
||||||
mov wrnk,#5
|
mov wrnk,#5
|
||||||
lsl wrnk,#8 @ 0x500 @ nrv2e M2_MAX_OFFSET
|
lsl wrnk,#8 @ 0x500 @ nrv2e M2_MAX_OFFSET
|
||||||
b top_n2e
|
b top_n2e
|
||||||
@ -175,7 +176,10 @@ copy_n2e:
|
|||||||
strb tmp,[dst]; add dst,#1
|
strb tmp,[dst]; add dst,#1
|
||||||
sub len,#1; bne copy_n2e
|
sub len,#1; bne copy_n2e
|
||||||
b top_n2e
|
b top_n2e
|
||||||
|
|
||||||
|
#ifndef PURE_THUMB
|
||||||
.size ucl_nrv2e_decompress_8, .-ucl_nrv2e_decompress_8
|
.size ucl_nrv2e_decompress_8, .-ucl_nrv2e_decompress_8
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
vi:ts=8:et:nowrap
|
vi:ts=8:et:nowrap
|
||||||
|
|||||||
@ -296,19 +296,37 @@ section ProcessEnd
|
|||||||
|
|
||||||
section .ucl_nrv2b_decompress_8
|
section .ucl_nrv2b_decompress_8
|
||||||
#include "arch/arm/v4t/nrv2b_d8.S"
|
#include "arch/arm/v4t/nrv2b_d8.S"
|
||||||
|
#undef GETBIT
|
||||||
|
#undef wrnk
|
||||||
|
|
||||||
section Call2B
|
section Call2B
|
||||||
bl .go_thumb_n2b
|
bl .thumb_nrv2b_d8
|
||||||
|
|
||||||
#undef wrnk
|
|
||||||
#undef GETBIT
|
|
||||||
|
|
||||||
section .ucl_nrv2e_decompress_8
|
section .ucl_nrv2e_decompress_8
|
||||||
#include "arch/arm/v4t/nrv2e_d8.S"
|
#include "arch/arm/v4t/nrv2e_d8.S"
|
||||||
|
#undef GETBIT
|
||||||
|
#undef wrnk
|
||||||
|
|
||||||
section Call2E
|
section Call2E
|
||||||
bl .thumb_nrv2e_d8
|
bl .thumb_nrv2e_d8
|
||||||
|
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
section .ucl_nrv2b_decompress_32
|
||||||
|
#include "arch/arm/v4t/nrv2b_d32.S"
|
||||||
|
#undef GETBIT
|
||||||
|
#undef wrnk
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
section .ucl_nrv2e_decompress_32
|
||||||
|
#include "arch/arm/v4t/nrv2e_d32.S"
|
||||||
|
#undef GETBIT
|
||||||
|
#undef wrnk
|
||||||
|
#endif
|
||||||
|
|
||||||
////////////////////////////////////////
|
////////////////////////////////////////
|
||||||
|
|
||||||
section CallLZMA
|
section CallLZMA
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user