From 7fbce066f8e0b36ca64674ad436c806a64ddacc5 Mon Sep 17 00:00:00 2001 From: David Given Date: Wed, 5 Sep 2018 00:13:01 +0200 Subject: [PATCH] We attempt to compile the first library function; we fail. --- mach/mips/libem/trp.s | 13 +++++++++++++ mach/mips/mcg/table | 8 ++++++++ 2 files changed, 21 insertions(+) create mode 100644 mach/mips/libem/trp.s diff --git a/mach/mips/libem/trp.s b/mach/mips/libem/trp.s new file mode 100644 index 000000000..7801d471c --- /dev/null +++ b/mach/mips/libem/trp.s @@ -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 + diff --git a/mach/mips/mcg/table b/mach/mips/mcg/table index 24c362d7b..d9ec7a6ac 100644 --- a/mach/mips/mcg/table +++ b/mach/mips/mcg/table @@ -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" -- 2.34.1