We attempt to compile the first library function; we fail.

This commit is contained in:
David Given 2018-09-05 00:13:01 +02:00
parent 26fe3f7530
commit 7fbce066f8
2 changed files with 21 additions and 0 deletions

13
mach/mips/libem/trp.s Normal file
View file

@ -0,0 +1,13 @@
.sect .text
.sect .rom
.sect .data
.sect .bss
.define .trap_ecase
.trap_ecase:
li r3, 20 ! ECASE = 20 in h/em_abs.h
! FALLTHROUGH to .trp
.trap:
syscall

View file

@ -667,6 +667,10 @@ PATTERNS
emit "div.d %out, %left, %right"
cost 4;
out:(float)reg = NEGF.D(left:(float)reg)
emit "neg.d %out, %left"
cost 4;
out:(double)reg = FROMSI.D(in:(int)reg)
emit "mtc1 %in, %out" /* mtc1 has reversed parameters */
emit "cvt.d.w %out, %out"
@ -705,6 +709,10 @@ PATTERNS
emit "div.d %out, %left, %right"
cost 4;
out:(float)reg = NEGF.F(left:(float)reg)
emit "neg.f %out, %left"
cost 4;
out:(float)reg = FROMSI.F(in:(int)reg)
emit "mtc1 %in, %out" /* mtc1 has reversed parameters */
emit "cvt.s.w %out, %out"