From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 06BD23857711; Wed, 13 Dec 2023 15:01:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 06BD23857711 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1702479689; bh=8MlZVNMvL0nNhU8IgkVKIVzVCu8QAJmaCzb6w5w27Zw=; h=From:To:Subject:Date:In-Reply-To:References:From; b=kCtGTwwP9INJY+0xtEJOrAoFQ15vzXo1HMuz4KvmLSlczxgAg5LUMQoGLXZftKhBZ cmdJrRjJ/87qxiKj357PAjeeOCEUxysL4BeB+a8tQO4Y9yVJdiVYdakouggyHFVwi0 F5EsONmY/ZZ7k2IFUWZCqbWVi1QI+JFW1ed6C+1E= From: "mark at klomp dot org" To: elfutils-devel@sourceware.org Subject: [Bug backends/31142] riscv pass_by_flattened_arg not implemented Date: Wed, 13 Dec 2023 15:01:28 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: elfutils X-Bugzilla-Component: backends X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: mark at klomp dot org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D31142 --- Comment #3 from Mark Wielaard --- (In reply to Robbin Ehn from comment #1) > I'm no expert in RV ABI, but from 18.2 RVG Calling Convention: >=20 > "Values are returned from functions in integer registers a0 and a1 and > floating-point registers fa0 and fa1. Floating-point values are returned = in > floating-point registers only if they are primitives or members of a stru= ct > consisting of only one or two floating-point values. Other return values > that fit into two pointer-words are returned in a0 and a1. Larger return > values are passed entirely > in memory; the caller allocates this memory region and passes a pointer to > it as an implicit first parameter to the callee." >=20 > AFAICT they should be packed into a0+a1 seen as 8/16 byte field. >=20 > rv32 a0 would be quot and a1 would be rem > rv64 a0 low 32-bit would be quot and a0 high 32-bit would be rem >=20 > This seems to be inline with what clang do, removes sign extension, shift > and or the values in. >=20 > Did this help ? Yes, thanks. I believe I know now which DWARF location description to use f= or a function returning a (small) struct containing just integers or just floats. The code is already there, it is just detecting the struct member types (and total struct size). I am not sure what this exactly means for a mix of an integers and floats i= n a small struct. Does the calling convention actually handle that? If you have= a struct { int a; float f; } would that be returned with the first piece in a0 and the second piece in fa0? Or would such a return struct be returned enti= rely in memory? --=20 You are receiving this mail because: You are on the CC list for the bug.=