.csb now works.
--HG-- branch : dtrg-videocore rename : mach/vc4/libem/csa.s => mach/vc4/libem/csb.s
This commit is contained in:
parent
6284512b37
commit
510888e6d5
|
@ -1,5 +1,6 @@
|
||||||
arch-libem-vc4 := \
|
arch-libem-vc4 := \
|
||||||
csa.s
|
csa.s \
|
||||||
|
csb.s
|
||||||
|
|
||||||
arch-libend-vc4 = \
|
arch-libend-vc4 = \
|
||||||
edata.s \
|
edata.s \
|
||||||
|
|
33
mach/vc4/libem/csb.s
Normal file
33
mach/vc4/libem/csb.s
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
#
|
||||||
|
/*
|
||||||
|
* VideoCore IV support library for the ACK
|
||||||
|
* © 2013 David Given
|
||||||
|
* This file is redistributable under the terms of the 3-clause BSD license.
|
||||||
|
* See the file 'Copying' in the root of the distribution for the full text.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "videocore.h"
|
||||||
|
|
||||||
|
.define .csb
|
||||||
|
.sect .data
|
||||||
|
.csb:
|
||||||
|
! on entry:
|
||||||
|
! r0 = un-fixed-up descriptor
|
||||||
|
! r1 = value
|
||||||
|
add r0, gp ! r0 = fixed up descriptor
|
||||||
|
|
||||||
|
adds8 r2, r0, #1 ! r2 = moving pointer
|
||||||
|
ld r3, 4 (r0) ! r3 = count
|
||||||
|
adds8 r3, r0, r3 ! r3 = end ptr
|
||||||
|
|
||||||
|
loop:
|
||||||
|
ld r4, (r2)++
|
||||||
|
b.eq r4, r1, matched ! r2 points at matching addr
|
||||||
|
addcmpb.le r2, #4, r3, loop
|
||||||
|
notmatched:
|
||||||
|
mov r2, r0 ! r2 points at default jump
|
||||||
|
matched:
|
||||||
|
ld r2, (r2) ! load destination address
|
||||||
|
add r2, gp ! fix up r2
|
||||||
|
b r2 ! ...and go
|
||||||
|
|
|
@ -1309,11 +1309,13 @@ PATTERNS
|
||||||
|
|
||||||
pat csa /* Array-lookup switch */
|
pat csa /* Array-lookup switch */
|
||||||
with GPR0 GPR1 STACK
|
with GPR0 GPR1 STACK
|
||||||
|
kills ALL
|
||||||
gen
|
gen
|
||||||
b {LABEL, ".csa"}
|
b {LABEL, ".csa"}
|
||||||
|
|
||||||
pat csb /* Table-lookup switch */
|
pat csb /* Table-lookup switch */
|
||||||
with STACK
|
with GPR0 GPR1 STACK
|
||||||
|
kills ALL
|
||||||
gen
|
gen
|
||||||
bl {LABEL, ".csb"}
|
bl {LABEL, ".csb"}
|
||||||
|
|
||||||
|
@ -1484,28 +1486,44 @@ PATTERNS
|
||||||
|
|
||||||
pat loc loc cfi $1==$2 && $1==QUAD /* Convert float -> integer */
|
pat loc loc cfi $1==$2 && $1==QUAD /* Convert float -> integer */
|
||||||
leaving
|
leaving
|
||||||
|
loc 0
|
||||||
|
#if 0
|
||||||
cal ".cfi"
|
cal ".cfi"
|
||||||
lfr QUAD
|
lfr QUAD
|
||||||
|
#endif
|
||||||
|
|
||||||
pat loc loc cfu $1==$2 && $1==QUAD /* Convert float -> unsigned */
|
pat loc loc cfu $1==$2 && $1==QUAD /* Convert float -> unsigned */
|
||||||
leaving
|
leaving
|
||||||
|
loc 0
|
||||||
|
#if 0
|
||||||
cal ".cfu"
|
cal ".cfu"
|
||||||
lfr QUAD
|
lfr QUAD
|
||||||
|
#endif
|
||||||
|
|
||||||
pat loc loc cif $1==$2 && $1==QUAD /* Convert integer -> float */
|
pat loc loc cif $1==$2 && $1==QUAD /* Convert integer -> float */
|
||||||
leaving
|
leaving
|
||||||
|
loc 0
|
||||||
|
#if 0
|
||||||
cal ".cif"
|
cal ".cif"
|
||||||
lfr QUAD
|
lfr QUAD
|
||||||
|
#endif
|
||||||
|
|
||||||
pat loc loc cuf $1==$2 && $1==QUAD /* Convert unsigned -> float */
|
pat loc loc cuf $1==$2 && $1==QUAD /* Convert unsigned -> float */
|
||||||
leaving
|
leaving
|
||||||
|
loc 0
|
||||||
|
#if 0
|
||||||
cal ".cuf"
|
cal ".cuf"
|
||||||
lfr QUAD
|
lfr QUAD
|
||||||
|
#endif
|
||||||
|
|
||||||
pat fef /* Split float */
|
pat fef /* Split float */
|
||||||
leaving
|
leaving
|
||||||
|
loc 0
|
||||||
|
loc 0
|
||||||
|
#if 0
|
||||||
cal ".cuf"
|
cal ".cuf"
|
||||||
lfr QUAD*2
|
lfr QUAD*2
|
||||||
|
#endif
|
||||||
|
|
||||||
pat fif /* Multiply float and split (?) */
|
pat fif /* Multiply float and split (?) */
|
||||||
leaving
|
leaving
|
||||||
|
|
Loading…
Reference in a new issue