From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 5EEE6385DC32 for ; Mon, 25 May 2020 21:02:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 5EEE6385DC32 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark@simark.ca Received: from [10.0.0.11] (173-246-6-90.qc.cable.ebox.net [173.246.6.90]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 0D8DA1E5F9; Mon, 25 May 2020 17:02:36 -0400 (EDT) Subject: Re: [PATCH 1/7] Fix function argument and return value locations To: Hannes Domani , gdb-patches@sourceware.org References: <20200525185659.59346-1-ssbssa@yahoo.de> <20200525185659.59346-2-ssbssa@yahoo.de> From: Simon Marchi Message-ID: <7c09d137-6938-6a01-3f8d-ff8ae26c87b5@simark.ca> Date: Mon, 25 May 2020 17:02:35 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <20200525185659.59346-2-ssbssa@yahoo.de> Content-Type: text/plain; charset=utf-8 Content-Language: fr Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-9.2 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, SPF_HELO_PASS, 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 21:02:37 -0000 On 2020-05-25 2:56 p.m., Hannes Domani via Gdb-patches wrote: > diff --git a/gdb/amd64-windows-tdep.c b/gdb/amd64-windows-tdep.c > index 487dfd45fc..db9845203f 100644 > --- a/gdb/amd64-windows-tdep.c > +++ b/gdb/amd64-windows-tdep.c > @@ -77,7 +77,8 @@ static int > amd64_windows_passed_by_xmm_register (struct type *type) > { > return ((type->code () == TYPE_CODE_FLT > - || type->code () == TYPE_CODE_DECFLOAT) > + || type->code () == TYPE_CODE_DECFLOAT > + || type->code () == TYPE_CODE_COMPLEX) > && (TYPE_LENGTH (type) == 4 || TYPE_LENGTH (type) == 8)); > } I don't know much about ABIs, so I tried: $ cat hello.c #include void other(int real, int imag); void func (complex int n) { other(creal(n), cimag(n)); } $ x86_64-w64-mingw32-gcc hello.c -g3 -O0 -c $ x86_64-w64-mingw32-objdump -d allo.o allo.o: file format elf64-x86-64 Disassembly of section .text: 0000000000000000 : 0: 55 push %rbp 1: 48 89 e5 mov %rsp,%rbp 4: 48 83 ec 10 sub $0x10,%rsp 8: 48 89 7d f8 mov %rdi,-0x8(%rbp) c: 8b 45 fc mov -0x4(%rbp),%eax f: 66 0f ef c0 pxor %xmm0,%xmm0 13: f2 0f 2a c0 cvtsi2sd %eax,%xmm0 17: f2 0f 2c d0 cvttsd2si %xmm0,%edx 1b: 8b 45 f8 mov -0x8(%rbp),%eax 1e: 66 0f ef c0 pxor %xmm0,%xmm0 22: f2 0f 2a c0 cvtsi2sd %eax,%xmm0 26: f2 0f 2c c0 cvttsd2si %xmm0,%eax 2a: 89 d6 mov %edx,%esi 2c: 89 c7 mov %eax,%edi 2e: e8 00 00 00 00 callq 33 33: 90 nop 34: c9 leaveq 35: c3 retq Doesn't this show that a `complex int` argument is passed through the rdi register? Am I missing something here? Simon