Remove _putchar, _puts and _puthex. These functions are unused.
Approved by: re (blanket)
This commit is contained in:
parent
696058c3c5
commit
aa56e74e06
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=107720
@ -298,107 +298,8 @@ STATIC_ENTRY(_reloc, 2)
|
||||
br.ret.sptk.few rp
|
||||
END(_reloc)
|
||||
|
||||
// in0: system table
|
||||
// in1: character
|
||||
ENTRY(_putchar, 2)
|
||||
alloc loc0=ar.pfs,2,3,2,0
|
||||
mov loc1=rp
|
||||
mov loc2=gp
|
||||
add sp=-32,sp
|
||||
;;
|
||||
add r14=64,in0 // r14 = &in1->ConOut
|
||||
;;
|
||||
ld8 r14=[r14] // r14 = in1->ConOut
|
||||
;;
|
||||
add r15=8,r14 // r15 = &r14->OutputString
|
||||
mov out0=r14
|
||||
mov out1=sp
|
||||
mov r16=sp
|
||||
;;
|
||||
ld8 r15=[r15] // r15 = r14->OutputString
|
||||
st2 [r16]=in1,2 // write character
|
||||
;;
|
||||
st2 [r16]=r0 // terminate
|
||||
ld8 r17=[r15],8 // function address
|
||||
;;
|
||||
ld8 gp=[r15] // function gp
|
||||
mov b6=r17 // transfer to branch register
|
||||
;;
|
||||
br.call.sptk.few rp=b6 // call function
|
||||
;;
|
||||
mov gp=loc2 // restore gp
|
||||
mov ar.pfs=loc0
|
||||
mov rp=loc1
|
||||
add sp=32,sp
|
||||
;;
|
||||
br.ret.sptk.few rp
|
||||
|
||||
END(_putchar)
|
||||
|
||||
// in0: system table
|
||||
// in1: string
|
||||
ENTRY(_puts, 2)
|
||||
alloc loc0=ar.pfs,3,2,2,0
|
||||
mov loc1=rp
|
||||
;;
|
||||
mov out0=in0
|
||||
;;
|
||||
1: ld1 out1=[in1],1
|
||||
;;
|
||||
cmp.eq p6,p0=r0,out1
|
||||
(p6) br.cond.dpnt.few 9f
|
||||
;;
|
||||
br.call.sptk.few rp=_putchar
|
||||
;;
|
||||
br.cond.sptk.few 1b
|
||||
9:
|
||||
mov ar.pfs=loc0
|
||||
mov rp=loc1
|
||||
;;
|
||||
br.ret.sptk.few rp
|
||||
END(_puts)
|
||||
|
||||
// in0: system table
|
||||
// in1: number
|
||||
ENTRY(_puthex, 2)
|
||||
alloc loc0=ar.pfs,2,3,2,0
|
||||
mov loc1=rp
|
||||
mov loc2=ar.lc
|
||||
;;
|
||||
mov out0=in0
|
||||
mov ar.lc=15
|
||||
;;
|
||||
1: extr.u out1=in1,60,4
|
||||
;;
|
||||
cmp.leu p6,p7=10,out1
|
||||
;;
|
||||
(p6) add out1='a'-10,out1
|
||||
(p7) add out1='0',out1
|
||||
dep.z in1=in1,4,60
|
||||
;;
|
||||
br.call.sptk.few rp=_putchar
|
||||
;;
|
||||
br.cloop.sptk.few 1b
|
||||
;;
|
||||
mov out1='\r'
|
||||
;;
|
||||
br.call.sptk.few rp=_putchar
|
||||
;;
|
||||
mov out1='\n'
|
||||
;;
|
||||
br.call.sptk.few rp=_putchar
|
||||
;;
|
||||
9:
|
||||
mov ar.pfs=loc0
|
||||
mov rp=loc1
|
||||
mov ar.lc=loc2
|
||||
;;
|
||||
br.ret.sptk.few rp
|
||||
END(_puthex)
|
||||
|
||||
.data
|
||||
.align 16
|
||||
|
||||
fptr_storage:
|
||||
fptr_storage:
|
||||
.space 1024*16 // XXX
|
||||
fptr_storage_end:
|
||||
fptr_storage_end:
|
||||
|
@ -298,107 +298,8 @@ STATIC_ENTRY(_reloc, 2)
|
||||
br.ret.sptk.few rp
|
||||
END(_reloc)
|
||||
|
||||
// in0: system table
|
||||
// in1: character
|
||||
ENTRY(_putchar, 2)
|
||||
alloc loc0=ar.pfs,2,3,2,0
|
||||
mov loc1=rp
|
||||
mov loc2=gp
|
||||
add sp=-32,sp
|
||||
;;
|
||||
add r14=64,in0 // r14 = &in1->ConOut
|
||||
;;
|
||||
ld8 r14=[r14] // r14 = in1->ConOut
|
||||
;;
|
||||
add r15=8,r14 // r15 = &r14->OutputString
|
||||
mov out0=r14
|
||||
mov out1=sp
|
||||
mov r16=sp
|
||||
;;
|
||||
ld8 r15=[r15] // r15 = r14->OutputString
|
||||
st2 [r16]=in1,2 // write character
|
||||
;;
|
||||
st2 [r16]=r0 // terminate
|
||||
ld8 r17=[r15],8 // function address
|
||||
;;
|
||||
ld8 gp=[r15] // function gp
|
||||
mov b6=r17 // transfer to branch register
|
||||
;;
|
||||
br.call.sptk.few rp=b6 // call function
|
||||
;;
|
||||
mov gp=loc2 // restore gp
|
||||
mov ar.pfs=loc0
|
||||
mov rp=loc1
|
||||
add sp=32,sp
|
||||
;;
|
||||
br.ret.sptk.few rp
|
||||
|
||||
END(_putchar)
|
||||
|
||||
// in0: system table
|
||||
// in1: string
|
||||
ENTRY(_puts, 2)
|
||||
alloc loc0=ar.pfs,3,2,2,0
|
||||
mov loc1=rp
|
||||
;;
|
||||
mov out0=in0
|
||||
;;
|
||||
1: ld1 out1=[in1],1
|
||||
;;
|
||||
cmp.eq p6,p0=r0,out1
|
||||
(p6) br.cond.dpnt.few 9f
|
||||
;;
|
||||
br.call.sptk.few rp=_putchar
|
||||
;;
|
||||
br.cond.sptk.few 1b
|
||||
9:
|
||||
mov ar.pfs=loc0
|
||||
mov rp=loc1
|
||||
;;
|
||||
br.ret.sptk.few rp
|
||||
END(_puts)
|
||||
|
||||
// in0: system table
|
||||
// in1: number
|
||||
ENTRY(_puthex, 2)
|
||||
alloc loc0=ar.pfs,2,3,2,0
|
||||
mov loc1=rp
|
||||
mov loc2=ar.lc
|
||||
;;
|
||||
mov out0=in0
|
||||
mov ar.lc=15
|
||||
;;
|
||||
1: extr.u out1=in1,60,4
|
||||
;;
|
||||
cmp.leu p6,p7=10,out1
|
||||
;;
|
||||
(p6) add out1='a'-10,out1
|
||||
(p7) add out1='0',out1
|
||||
dep.z in1=in1,4,60
|
||||
;;
|
||||
br.call.sptk.few rp=_putchar
|
||||
;;
|
||||
br.cloop.sptk.few 1b
|
||||
;;
|
||||
mov out1='\r'
|
||||
;;
|
||||
br.call.sptk.few rp=_putchar
|
||||
;;
|
||||
mov out1='\n'
|
||||
;;
|
||||
br.call.sptk.few rp=_putchar
|
||||
;;
|
||||
9:
|
||||
mov ar.pfs=loc0
|
||||
mov rp=loc1
|
||||
mov ar.lc=loc2
|
||||
;;
|
||||
br.ret.sptk.few rp
|
||||
END(_puthex)
|
||||
|
||||
.data
|
||||
.align 16
|
||||
|
||||
fptr_storage:
|
||||
fptr_storage:
|
||||
.space 1024*16 // XXX
|
||||
fptr_storage_end:
|
||||
fptr_storage_end:
|
||||
|
Loading…
Reference in New Issue
Block a user