Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 28 Feb 2019 12:07:36 +1100 (AEDT)
From: Damian McGuckin <>
Subject: Re: FE Exception triggered by comparison

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 

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"
 	.section	.rodata.str1.1,"aMS",@progbits,1
 	.string	"yes"
 	.string	"no!"
 	.string	"what %s\n"
 	.section	.text.startup,"ax",@progbits
 	.p2align 4,,15
 	.globl	main
 	.type	main, @function
 	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
 	.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

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.