From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from sonic308-19.consmr.mail.ir2.yahoo.com (sonic308-19.consmr.mail.ir2.yahoo.com [77.238.178.147]) by sourceware.org (Postfix) with ESMTPS id E004C385DC32 for ; Mon, 25 May 2020 23:03:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org E004C385DC32 X-YMail-OSG: HYuwjrYVM1ksY5npHbf4V6LdbIlyC8_qhvwWS77VBfwxGnCBAz1cilzzTv8oPTY dPC4sKb.kBdVvFB0usV9R.FMbP2.2KXqQr7YEHiAcsU6ReeahH2fq6Bnc.fxECoxdMEtNPJXJ2Dj sWKhtqB8z.AriY4zqAdBWdXcInuaWBoGkOI6U5mbRWNXVT5_Wiil61UADZweB.v3UClpr4qZA1NR vCp2nLK6oSmviMcus5AoPjJdGi6533qwuGPxf37BMmAPdAnB0Ooe7_Y56xvjagfqktv7vbBFPMZF E1sxjsv6oS_hF3fNNdBhGQ4FtAI82LBCnklsybyCLE5kmLOcJ.WTIo15ZO1H1UDBMDYYij4n9U8v Yl5NzUi5FrY_mbW1EamE_y.K8mT8XbhtKXIpx5GeTL9b9kw8Vidh0tvzeS4Hw5naJGGPdFAzaM4N Ann5X_o2Z8k8hDvOBXZC34EbpzmMsUUjU_a9TE_dHXq.8nzBQhB.7xDc6TD4lgc.D89tMcybSW6W l8MtXijcpDCzDbsb6h_c4qjTNitIqw6vYRJcW_7QaNvKwiLveQ4FS1E9t4d72eoGXVt_nrKixZpe QWvEyRH5tjYOOn0Sx1Znv89P6sljhpJaotMl7rE.m_BIcLvSTsYyT1_ek4NOzo.puIERHfZ_0qun xacCTZ.1bATg457HbDP.dpBj.jWL4V6Z2fDeTUPUzis8Bgh35zufqdK0gTYKSfXxlTw9iknpNPFE Ppeh1wdnJB_LxgOfo_vdhsbbae2110r_MipbrvBZdmlLS1n2SQX2MsywGfHTN6Y_HipkNPEGy8Vl PNN_FwB4J9e1_Q5hbbFf4FcwRgBbp16qpO1.C6d95tvqQPVwS7Ci.ldj4GORhBhXPqB0eZMzq7ei wGrBTM6XaSE1Z8dgvXidmAik3nawe.YDW6h40z1fWvwJKSqC5j7wbb_Oiuy3zxzlbQBMOYRbZFsY racQtGlQaqLDTY4OuIm6SZ_E3zT5iABTAGZPaMiSz8SbUZ6VzboNOrIaBdj.NLaIGk04pWBNtMdE outt6U87G8OwzM8UiIrouIH7ush9kd0ZtuzOVDEjddAOHMZRYEDRxlhIocoltKJC7aUuHe0al2Ww jrlcC.mvCNAaCedVmmAUAyAt37W7vjFr7MOR8JAiB6Rpftep2yQpySMDJLeqxuCIP5Mv0ckDpLrJ MCAqkp4PRT00z0LP4JYgf0xPucQKV1jDJ9D6n9a4EtffL_ao_tPbkIi5w3wKJ82PbQhGA4JYDDpp iM9CcGHf6rVOxcGDPjlXfndlZtyx50oakHTKepzKH4a76kd.avO5XSLeFZM2s4LDZ13d3oN4AeZB MAckC318j7N4crbpD Received: from sonic.gate.mail.ne1.yahoo.com by sonic308.consmr.mail.ir2.yahoo.com with HTTP; Mon, 25 May 2020 23:03:07 +0000 Date: Mon, 25 May 2020 23:03:01 +0000 (UTC) From: Hannes Domani To: Gdb-patches Message-ID: <64358647.5760638.1590447781446@mail.yahoo.com> In-Reply-To: <1cc831e4-c36a-d0a3-a500-7f57bc7775e9@simark.ca> References: <20200525185659.59346-1-ssbssa@yahoo.de> <20200525185659.59346-2-ssbssa@yahoo.de> <7c09d137-6938-6a01-3f8d-ff8ae26c87b5@simark.ca> <977050290.5716513.1590442329577@mail.yahoo.com> <1cc831e4-c36a-d0a3-a500-7f57bc7775e9@simark.ca> Subject: Re: [PATCH 1/7] Fix function argument and return value locations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Mailer: WebService/1.1.15960 YMailNorrin Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:76.0) Gecko/20100101 Firefox/76.0 X-Spam-Status: No, score=-3.8 required=5.0 tests=BAYES_00, BODY_8BITS, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 May 2020 23:03:09 -0000 Am Dienstag, 26. Mai 2020, 00:14:36 MESZ hat Simon Marchi Folgendes geschrieben: > On 2020-05-25 5:32 p.m., Hannes Domani via Gdb-patches wrote: > > You're probably right, the thing is, I was only able to test complex fl= oat > > and complex double, because gdb doesn't like complex integral types: > > > > complex int complex_int =3D 5 + 6i; > > > > (gdb) p complex_int > > 'complex_int' has unknown type; cast it to its declared type > > (gdb) pt complex_int > > 'complex_int' has unknown type; cast it to its declared type > > > > So I guess it should check for target-type float as well: > >=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 || (type->code () =3D=3D TYPE= _CODE_COMPLEX > >=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 && TY= PE_TARGET_TYPE (type)->code () =3D=3D TYPE_CODE_FLT)) > > > > Do many people use complex int, because I personally wouldn't have expe= cted > > that this even exists. > > Err right that doesn't make sense, let's use floats instead.=C2=A0 I see: > > > $ cat hello.c > #include > > void other(float real, float imag); > void func (complex float n) > { >=C2=A0=C2=A0 other(creal(n), cimag(n)); > } > $ x86_64-w64-mingw32-gcc hello.c -g3 -O0 -c > $ x86_64-w64-mingw32-objdump -d hello.o > > hello.o:=C2=A0=C2=A0=C2=A0 file format pe-x86-64 > > > Disassembly of section .text: > > 0000000000000000 : >=C2=A0=C2=A0 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(%rbp),%xmm0 >=C2=A0=C2=A0 1e:=C2=A0 f3 0f 5a c0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0 cvtss2sd %xmm0,%xmm0 >=C2=A0=C2=A0 22:=C2=A0 f2 0f 5a c0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0 cvtsd2ss %xmm0,%xmm0 >=C2=A0=C2=A0 26:=C2=A0 e8 00 00 00 00=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 callq=C2=A0 2b >=C2=A0=C2=A0 2b:=C2=A0 90=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 nop >=C2=A0=C2=A0 2c:=C2=A0 48 83 c4 20=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0 add=C2=A0=C2=A0=C2=A0 $0x20,%rsp >=C2=A0=C2=A0 30:=C2=A0 5d=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 pop=C2=A0=C2=A0=C2=A0 %rbp >=C2=A0=C2=A0 31:=C2=A0 c3=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 retq > > Doesn't this suggest that the parameter gets passed through rcx?=C2=A0 I'= m not saying you > are wrong, I'm just trying to understand how things work :). You're absolutely right again. The complex arguments didn't work before, so I just tried it with amd64_windows_passed_by_xmm_register (because that seemed the obvious choic= e for me), and then it worked. But it only worked because in case of XMM register, the argument is also passed via the integer register: =C2=A0=C2=A0 =C2=A0=C2=A0 else if (amd64_windows_passed_by_xmm_register (ty= pe)) =C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0 { =C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 amd64_windows_store_arg_i= n_reg =C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (regcache, ar= gs[i], AMD64_XMM0_REGNUM + reg_idx); =C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /* In case of varargs, th= ese parameters must also be =C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0 passed via the integer registers.=C2= =A0 */ =C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 amd64_windows_store_arg_i= n_reg =C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0(regcache, args[i], =C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0 amd64_windows_dummy_call_integer_reg= s[reg_idx]); =C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 on_stack_p =3D 0; =C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 reg_idx++; =C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0 } So it actually should be added to amd64_windows_passed_by_integer_register, and a quick test just now confirms that this also works. I'm very sorry about that, I should have checked the asm code. Hannes