From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/13898 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Damian McGuckin Newsgroups: gmane.linux.lib.musl.general Subject: Re: FE Exception triggered by comparison Date: Thu, 28 Feb 2019 12:07:36 +1100 (AEDT) Message-ID: References: <20190224192511.GZ21289@port70.net> <20190224210438.6980bd87@inria.fr> <20190225155109.GB28106@voyager> <20190227161437.GC28106@voyager> Reply-To: musl@lists.openwall.com Mime-Version: 1.0 Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="117787"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Alpine 2.02 (LRH 1266 2009-07-14) To: musl@lists.openwall.com Original-X-From: musl-return-13914-gllmg-musl=m.gmane.org@lists.openwall.com Thu Feb 28 02:07:53 2019 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.89) (envelope-from ) id 1gzAAy-000UX7-Tl for gllmg-musl@m.gmane.org; Thu, 28 Feb 2019 02:07:53 +0100 Original-Received: (qmail 30029 invoked by uid 550); 28 Feb 2019 01:07:50 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 30011 invoked from network); 28 Feb 2019 01:07:49 -0000 X-Authentication-Warning: key0.esi.com.au: damianm owned process doing -bs In-Reply-To: <20190227161437.GC28106@voyager> Xref: news.gmane.org gmane.linux.lib.musl.general:13898 Archived-At: On Wed, 27 Feb 2019, Markus Wichmann wrote: > On Thu, Feb 28, 2019 at 03:09:54AM +1100, Damian McGuckin wrote: >> .ident "GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-36)" > > You might want to consider upgrading: Done. But the subroutine call is still hanging around. What am I doing wrong. Yours is: > .globl main > .type main, @function > main: > .LFB17: > .cfi_startproc > pxor %xmm0, %xmm0 > subq $8, %rsp > .cfi_def_cfa_offset 16 > movabsq $9218868437227405312, %rdx > divsd %xmm0, %xmm0 > leaq .LC0(%rip), %rsi > leaq .LC3(%rip), %rdi > movq %xmm0, %rax > btrq $63, %rax > cmpq %rdx, %rax > leaq .LC1(%rip), %rax > cmovbe %rax, %rsi > xorl %eax, %eax > call printf@PLT > xorl %eax, %eax > addq $8, %rsp > .cfi_def_cfa_offset 8 > ret > .cfi_endproc > .LFE17: > .size main, .-main > .ident "GCC: (Debian 8.2.0-14) 8.2.0" > .section .note.GNU-stack,"",@progbits > > That sufficiently efficient for you? It would be if I could achieve it. What options do I need? I use gcc -S -O3 -msse4.2 -mfma mynan.c See below: .file "mynan.c" .text .section .rodata.str1.1,"aMS",@progbits,1 .LC0: .string "yes" .LC1: .string "no!" .LC3: .string "what %s\n" .section .text.startup,"ax",@progbits .p2align 4,,15 .globl main .type main, @function main: .LFB14: .cfi_startproc vxorpd %xmm0, %xmm0, %xmm0 subq $8, %rsp .cfi_def_cfa_offset 16 vdivsd %xmm0, %xmm0, %xmm0 call __isnan movl $.LC0, %esi movl $.LC3, %edi testl %eax, %eax movl $.LC1, %eax cmove %rax, %rsi xorl %eax, %eax call printf xorl %eax, %eax addq $8, %rsp .cfi_def_cfa_offset 8 ret .cfi_endproc .LFE14: .size main, .-main .ident "GCC: (GNU) 8.2.1 20180905 (Red Hat 8.2.1-3)" .section .note.GNU-stack,"",@progbits It is the standard package with devtools-8 under CentOS. Thanks - Damian Pacific Engineering Systems International, 277-279 Broadway, Glebe NSW 2037 Ph:+61-2-8571-0847 .. Fx:+61-2-9692-9623 | unsolicited email not wanted here Views & opinions here are mine and not those of any past or present employer