From 02c8e69a07c5ed6d1398021e8c2aa8c103b59218 Mon Sep 17 00:00:00 2001 From: Michael Matz Date: Sun, 14 Jul 2019 01:37:02 +0200 Subject: [PATCH] riscv: fp parameters makes 23_type_coercion work. (clean up to 31_args) --- riscv64-gen.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/riscv64-gen.c b/riscv64-gen.c index c75b4516..467a9043 100644 --- a/riscv64-gen.c +++ b/riscv64-gen.c @@ -432,14 +432,16 @@ ST_FUNC void gfunc_prolog(CType *func_type) } else { int regcount = 1; if (size > XLEN) - regcount++; + regcount++, tcc_error("unimp: scalars > 64bit"); if (regcount + (is_float(type->t) ? afreg : aireg) >= 8) goto from_stack; - loc -= regcount * 8; + loc -= regcount * 8; // XXX could reserve only 'size' bytes param_addr = loc; for (i = 0; i < regcount; i++) { if (is_float(type->t)) { - tcc_error("unimp: float args"); + assert(type->t == VT_FLOAT || type->t == VT_DOUBLE); + ES(0x27, size == 4 ? 2 : 3, 8, 10 + afreg, loc + i*8); // fs[wd] FAi, loc(s0) + afreg++; } else { ES(0x23, 3, 8, 10 + aireg, loc + i*8); // sd aX, loc(s0) // XXX aireg++;