Now compiles (incorrectly) the entire libc, libpc, libm2 and libbasic!
--HG-- branch : dtrg-videocore
This commit is contained in:
parent
92817a6ad7
commit
1312fe298b
2 changed files with 173 additions and 67 deletions
|
@ -293,7 +293,8 @@ PATTERNS
|
||||||
leaving
|
leaving
|
||||||
dup 4
|
dup 4
|
||||||
ste $1
|
ste $1
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Type conversions */
|
/* Type conversions */
|
||||||
|
|
||||||
|
@ -450,22 +451,30 @@ PATTERNS
|
||||||
loc 0
|
loc 0
|
||||||
ste $1
|
ste $1
|
||||||
|
|
||||||
#if 0
|
|
||||||
pat ine /* Increment external */
|
pat ine /* Increment external */
|
||||||
uses REG={LABEL, $1}, REG
|
leaving
|
||||||
gen
|
lae $1
|
||||||
lwz %b, {GPROFFSET, %a, 0}
|
dup QUAD
|
||||||
addi %b, %b, {CONST, 1}
|
loi QUAD
|
||||||
stw %b, {GPROFFSET, %a, 0}
|
inc
|
||||||
|
sti QUAD
|
||||||
|
|
||||||
pat dee /* Decrement external */
|
pat dee /* Decrement external */
|
||||||
uses REG={LABEL, $1}, REG
|
leaving
|
||||||
gen
|
lae $1
|
||||||
lwz %b, {GPROFFSET, %a, 0}
|
dup QUAD
|
||||||
addi %b, %b, {CONST, 0-1}
|
loi QUAD
|
||||||
stw %b, {GPROFFSET, %a, 0}
|
dec
|
||||||
#endif
|
sti QUAD
|
||||||
|
|
||||||
|
pat lde /* Load external */
|
||||||
|
uses REG, REG
|
||||||
|
gen
|
||||||
|
lea %a, {LABEL, $1}
|
||||||
|
ld %b, {GPROFFSET, %a, 4}
|
||||||
|
ld %a, {GPROFFSET, %a, 0}
|
||||||
|
yields %b %a
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Structures */
|
/* Structures */
|
||||||
|
@ -474,13 +483,30 @@ PATTERNS
|
||||||
leaving
|
leaving
|
||||||
adp $1
|
adp $1
|
||||||
loi QUAD
|
loi QUAD
|
||||||
|
|
||||||
|
pat ldf /* Load double offsetted */
|
||||||
|
with GPRI
|
||||||
|
uses reusing %1, REG=%1, REG
|
||||||
|
gen
|
||||||
|
add %a, GP
|
||||||
|
ld %b, {GPROFFSET, %a, $1+4}
|
||||||
|
ld %a, {GPROFFSET, %a, $1+0}
|
||||||
|
yields %a %b
|
||||||
|
|
||||||
pat stf /* Store word offsetted */
|
pat stf /* Store word offsetted */
|
||||||
leaving
|
leaving
|
||||||
adp $1
|
adp $1
|
||||||
sti QUAD
|
sti QUAD
|
||||||
|
|
||||||
|
pat sdf /* Store double offsetted */
|
||||||
|
with GPRI GPRI GPRI
|
||||||
|
uses reusing %3, REG=%3
|
||||||
|
gen
|
||||||
|
add %a, GP
|
||||||
|
st %1, {GPROFFSET, %a, $1+0}
|
||||||
|
st %2, {GPROFFSET, %a, $1+4}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Loads and stores */
|
/* Loads and stores */
|
||||||
|
@ -659,6 +685,54 @@ PATTERNS
|
||||||
sub %a, %1
|
sub %a, %1
|
||||||
yields %a
|
yields %a
|
||||||
|
|
||||||
|
pat mli $1==QUAD /* Multiply word (second * top) */
|
||||||
|
with GPRI+CONST GPRI
|
||||||
|
uses reusing %2, REG=%2
|
||||||
|
gen
|
||||||
|
mul %a, %1
|
||||||
|
yields %a
|
||||||
|
with GPRI GPRI+CONST
|
||||||
|
uses reusing %1, REG=%1
|
||||||
|
gen
|
||||||
|
mul %a, %2
|
||||||
|
yields %a
|
||||||
|
|
||||||
|
pat mlu
|
||||||
|
leaving
|
||||||
|
mli $1
|
||||||
|
|
||||||
|
pat dvi $1==QUAD /* Divide word (second / top) */
|
||||||
|
with GPRI GPRI
|
||||||
|
uses reusing %2, REG
|
||||||
|
gen
|
||||||
|
divs %a, %2, %1
|
||||||
|
yields %a
|
||||||
|
|
||||||
|
pat dvu $1==QUAD /* Divide unsigned word (second / top) */
|
||||||
|
with GPRI GPRI
|
||||||
|
uses reusing %2, REG
|
||||||
|
gen
|
||||||
|
divu %a, %2, %1
|
||||||
|
yields %a
|
||||||
|
|
||||||
|
pat rmu $1==QUAD /* Remainder unsigned word (second % top) */
|
||||||
|
with GPRI GPRI
|
||||||
|
uses REG
|
||||||
|
gen
|
||||||
|
divu %a, %2, %1
|
||||||
|
mul %a, %1
|
||||||
|
sub %a, %2
|
||||||
|
yields %a
|
||||||
|
|
||||||
|
pat rmi $1==QUAD /* Remainder signed word (second % top) */
|
||||||
|
with GPRI GPRI
|
||||||
|
uses REG
|
||||||
|
gen
|
||||||
|
divs %a, %2, %1
|
||||||
|
mul %a, %1
|
||||||
|
sub %a, %2
|
||||||
|
yields %a
|
||||||
|
|
||||||
pat ngi $1==QUAD /* Negate word */
|
pat ngi $1==QUAD /* Negate word */
|
||||||
with GPRI
|
with GPRI
|
||||||
uses reusing %1, REG=%1
|
uses reusing %1, REG=%1
|
||||||
|
@ -725,6 +799,15 @@ PATTERNS
|
||||||
sub %a, %2
|
sub %a, %2
|
||||||
yields %a
|
yields %a
|
||||||
|
|
||||||
|
pat rmi $1==QUAD /* Remainder signed word (second % top) */
|
||||||
|
with GPRI GPRI
|
||||||
|
uses REG
|
||||||
|
gen
|
||||||
|
divs %a, %2, %1
|
||||||
|
mul %a, %1
|
||||||
|
sub %a, %2
|
||||||
|
yields %a
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
pat mli $1==4 /* Multiply word (second * top) */
|
pat mli $1==4 /* Multiply word (second * top) */
|
||||||
with REG REG
|
with REG REG
|
||||||
|
@ -733,15 +816,7 @@ PATTERNS
|
||||||
mullw %a, %2, %1
|
mullw %a, %2, %1
|
||||||
yields %a
|
yields %a
|
||||||
|
|
||||||
pat rmi $1==4 /* Remainder word (second % top) */
|
|
||||||
with REG REG
|
|
||||||
uses REG
|
|
||||||
gen
|
|
||||||
divw %a, %2, %1
|
|
||||||
mullw %a, %a, %1
|
|
||||||
subf %a, %a, %2
|
|
||||||
yields %a
|
|
||||||
|
|
||||||
pat and !defined($1) /* AND set */
|
pat and !defined($1) /* AND set */
|
||||||
with STACK
|
with STACK
|
||||||
gen
|
gen
|
||||||
|
@ -810,30 +885,41 @@ PATTERNS
|
||||||
gen
|
gen
|
||||||
lsr %2, %1
|
lsr %2, %1
|
||||||
yields %a
|
yields %a
|
||||||
#if 0
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Arrays */
|
/* Arrays */
|
||||||
|
|
||||||
pat aar $1==QUAD /* Index array */
|
pat aar $1==QUAD /* Index array */
|
||||||
with GPR3 GPR4 GPR5
|
with STACK
|
||||||
|
uses GPR0
|
||||||
|
gen
|
||||||
|
bl {LABEL, ".aar4stack"}
|
||||||
|
yields R0
|
||||||
|
with GPR0 GPR1 GPR2
|
||||||
|
uses GPR0
|
||||||
gen
|
gen
|
||||||
bl {LABEL, ".aar4"}
|
bl {LABEL, ".aar4"}
|
||||||
yields R3
|
yields R0
|
||||||
|
|
||||||
pat lae lar $2==QUAD && nicesize(rom($1, 3)) /* Load array */
|
pat lae lar $2==QUAD && nicesize(rom($1, 3)) /* Load array */
|
||||||
leaving
|
leaving
|
||||||
lae $1
|
lae $1
|
||||||
aar QUAD
|
aar QUAD
|
||||||
loi rom($1, 3)
|
loi rom($1, 3)
|
||||||
|
|
||||||
pat lar $1==QUAD /* Load array */
|
pat lar $1==QUAD /* Load array */
|
||||||
with GPR3 GPR4 GPR5 STACK
|
with STACK
|
||||||
kills ALL
|
uses GPR0
|
||||||
|
gen
|
||||||
|
bl {LABEL, ".lar4stack"}
|
||||||
|
yields R0
|
||||||
|
with GPR0 GPR1 GPR2
|
||||||
|
uses GPR0
|
||||||
gen
|
gen
|
||||||
bl {LABEL, ".lar4"}
|
bl {LABEL, ".lar4"}
|
||||||
|
yields R0
|
||||||
|
|
||||||
pat lae sar $2==QUAD && nicesize(rom($1, 3)) /* Store array */
|
pat lae sar $2==QUAD && nicesize(rom($1, 3)) /* Store array */
|
||||||
leaving
|
leaving
|
||||||
lae $1
|
lae $1
|
||||||
|
@ -841,11 +927,15 @@ PATTERNS
|
||||||
sti rom($1, 3)
|
sti rom($1, 3)
|
||||||
|
|
||||||
pat sar $1==QUAD /* Store array */
|
pat sar $1==QUAD /* Store array */
|
||||||
with GPR3 GPR4 GPR5 STACK
|
with STACK
|
||||||
kills ALL
|
uses GPR0
|
||||||
|
gen
|
||||||
|
bl {LABEL, ".sar4stack"}
|
||||||
|
yields R0
|
||||||
|
with GPR0 GPR1 GPR2
|
||||||
|
uses GPR0
|
||||||
gen
|
gen
|
||||||
bl {LABEL, ".sar4"}
|
bl {LABEL, ".sar4"}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -854,25 +944,30 @@ PATTERNS
|
||||||
pat set defined($1) /* Create word with set bit */
|
pat set defined($1) /* Create word with set bit */
|
||||||
leaving
|
leaving
|
||||||
loc 1
|
loc 1
|
||||||
exg QUAD
|
exg $1
|
||||||
sli QUAD
|
sli $1
|
||||||
|
|
||||||
pat set !defined($1) /* Create structure with set bit (variable) */
|
pat set !defined($1) /* Create structure with set bit (variable) */
|
||||||
with GPR3 GPR4 STACK
|
with STACK
|
||||||
gen
|
gen
|
||||||
bl {LABEL, ".set"}
|
bl {LABEL, ".set"}
|
||||||
|
|
||||||
pat inn defined($1) /* Test for set bit */
|
pat inn defined($1) /* Test for set bit */
|
||||||
leaving
|
leaving
|
||||||
set QUAD
|
set QUAD
|
||||||
and QUAD
|
and QUAD
|
||||||
|
|
||||||
pat inn !defined($1) /* Test for set bit (variable) */
|
pat inn !defined($1) /* Test for set bit (variable) */
|
||||||
with GPR3 STACK
|
with GPR0 STACK
|
||||||
gen
|
gen
|
||||||
bl {LABEL, ".inn"}
|
bl {LABEL, ".inn"}
|
||||||
#endif
|
yields R0
|
||||||
|
|
||||||
|
pat ior !defined($1) /* Or two sets */
|
||||||
|
with STACK
|
||||||
|
gen
|
||||||
|
bl {LABEL, ".ior"}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Boolean resolutions */
|
/* Boolean resolutions */
|
||||||
|
@ -1095,28 +1190,16 @@ PATTERNS
|
||||||
pop FP, PC
|
pop FP, PC
|
||||||
|
|
||||||
pat blm /* Block move constant length */
|
pat blm /* Block move constant length */
|
||||||
with GPRI GPRI STACK
|
leaving
|
||||||
uses REG
|
loc $1
|
||||||
gen
|
bls
|
||||||
sub SP, {CONST, 12}
|
|
||||||
mov %a, {CONST, $1}
|
|
||||||
st %1, {GPROFFSET, SP, 0}
|
|
||||||
st %2, {GPROFFSET, SP, 4}
|
|
||||||
st %a, {GPROFFSET, SP, 8}
|
|
||||||
bl {LABEL, "_memmove"}
|
|
||||||
add SP, {CONST, 12}
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
pat bls /* Block move variable length */
|
pat bls /* Block move variable length */
|
||||||
with GPR GPR GPR STACK
|
with STACK
|
||||||
|
kills ALL
|
||||||
gen
|
gen
|
||||||
stwu %1, {GPROFFSET, SP, 0-4}
|
|
||||||
stwu %3, {GPROFFSET, SP, 0-4}
|
|
||||||
stwu %2, {GPROFFSET, SP, 0-4}
|
|
||||||
bl {LABEL, "_memmove"}
|
bl {LABEL, "_memmove"}
|
||||||
addi SP, SP, {CONST, 12}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
pat csa /* Array-lookup switch */
|
pat csa /* Array-lookup switch */
|
||||||
with STACK
|
with STACK
|
||||||
gen
|
gen
|
||||||
|
@ -1328,3 +1411,6 @@ PATTERNS
|
||||||
bl {LABEL, ".fef"}
|
bl {LABEL, ".fef"}
|
||||||
yields R0 R1
|
yields R0 R1
|
||||||
|
|
||||||
|
pat zrf /* Load a floating zero */
|
||||||
|
leaving
|
||||||
|
loc 0
|
||||||
|
|
|
@ -9,12 +9,32 @@
|
||||||
#define _UNISTD_H
|
#define _UNISTD_H
|
||||||
|
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
#include <time.h>
|
||||||
|
|
||||||
/* Types */
|
/* Types */
|
||||||
|
|
||||||
typedef int pid_t;
|
typedef int pid_t;
|
||||||
typedef int mode_t;
|
typedef int mode_t;
|
||||||
|
|
||||||
|
typedef long suseconds_t;
|
||||||
|
|
||||||
|
/* Time handling. */
|
||||||
|
|
||||||
|
struct timeval
|
||||||
|
{
|
||||||
|
time_t tv_sec;
|
||||||
|
suseconds_t tv_usec;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct timezone
|
||||||
|
{
|
||||||
|
int tz_minuteswest;
|
||||||
|
int tz_dsttime;
|
||||||
|
}; /* obsolete, unused */
|
||||||
|
|
||||||
|
extern int gettimeofday(struct timeval* tv, struct timezone* tz);
|
||||||
|
extern int settimeofday(const struct timeval* tv, const struct timezone* tz);
|
||||||
|
|
||||||
/* Constants for file access (open and friends) */
|
/* Constants for file access (open and friends) */
|
||||||
|
|
||||||
enum
|
enum
|
||||||
|
|
Loading…
Reference in a new issue