https://llvm.org/bugs/show_bug.cgi?id=27573
Bug ID: 27573 Summary: Avoid partial SSE register stall Product: new-bugs Version: trunk Hardware: PC OS: Linux Status: NEW Severity: normal Priority: P Component: new bugs Assignee: unassignedb...@nondot.org Reporter: hjl.to...@gmail.com CC: david.l.kreit...@intel.com, llvm-bugs@lists.llvm.org, zia.ans...@intel.com Classification: Unclassified [hjl@gnu-6 pr57954]$ cat x.c float foo1 (int x) { return x; } double foo2 (int x) { return x; } float foo3 (long long int x) { return x; } double foo4 (long long int x) { return x; } [hjl@gnu-6 pr57954]$ gcc -S -O2 -mtune=haswell x.c [hjl@gnu-6 pr57954]$ cat x.s .file "x.c" .section .text.unlikely,"ax",@progbits .LCOLDB0: .text .LHOTB0: .p2align 4,,15 .globl foo1 .type foo1, @function foo1: .LFB0: .cfi_startproc pxor %xmm0, %xmm0 cvtsi2ss %edi, %xmm0 ret .cfi_endproc .LFE0: .size foo1, .-foo1 .section .text.unlikely .LCOLDE0: .text .LHOTE0: .section .text.unlikely .LCOLDB1: .text .LHOTB1: .p2align 4,,15 .globl foo2 .type foo2, @function foo2: .LFB1: .cfi_startproc pxor %xmm0, %xmm0 cvtsi2sd %edi, %xmm0 ret .cfi_endproc .LFE1: .size foo2, .-foo2 .section .text.unlikely .LCOLDE1: .text .LHOTE1: .section .text.unlikely .LCOLDB2: .text .LHOTB2: .p2align 4,,15 .globl foo3 .type foo3, @function foo3: .LFB2: .cfi_startproc pxor %xmm0, %xmm0 cvtsi2ssq %rdi, %xmm0 ret .cfi_endproc .LFE2: .size foo3, .-foo3 .section .text.unlikely .LCOLDE2: .text .LHOTE2: .section .text.unlikely .LCOLDB3: .text .LHOTB3: .p2align 4,,15 .globl foo4 .type foo4, @function foo4: .LFB3: .cfi_startproc pxor %xmm0, %xmm0 cvtsi2sdq %rdi, %xmm0 ret .cfi_endproc .LFE3: .size foo4, .-foo4 .section .text.unlikely .LCOLDE3: .text .LHOTE3: .ident "GCC: (GNU) 5.3.1 20160406 (Red Hat 5.3.1-6)" .section .note.GNU-stack,"",@progbits [hjl@gnu-6 pr57954]$ /export/build/gnu/llvm-clang-x32-bootstrap/stage1/build-x86_64-linux-gnux32/bin/clang -S -O2 -mtune=haswell x.c [hjl@gnu-6 pr57954]$ cat x.s .text .file "x.c" .globl foo1 .p2align 4, 0x90 .type foo1,@function foo1: # @foo1 .cfi_startproc # BB#0: cvtsi2ssl %edi, %xmm0 retq .Lfunc_end0: .size foo1, .Lfunc_end0-foo1 .cfi_endproc .globl foo2 .p2align 4, 0x90 .type foo2,@function foo2: # @foo2 .cfi_startproc # BB#0: cvtsi2sdl %edi, %xmm0 retq .Lfunc_end1: .size foo2, .Lfunc_end1-foo2 .cfi_endproc .globl foo3 .p2align 4, 0x90 .type foo3,@function foo3: # @foo3 .cfi_startproc # BB#0: cvtsi2ssq %rdi, %xmm0 retq .Lfunc_end2: .size foo3, .Lfunc_end2-foo3 .cfi_endproc .globl foo4 .p2align 4, 0x90 .type foo4,@function foo4: # @foo4 .cfi_startproc # BB#0: cvtsi2sdq %rdi, %xmm0 retq .Lfunc_end3: .size foo4, .Lfunc_end3-foo4 .cfi_endproc .ident "clang version 3.9.0 (http://llvm.org/git/clang.git 3e732e176f38a3cd18520fea2dcda89572736d9d) (http://llvm.org/git/llvm.git 9c55c367aecce3a03ecf8dde49b2d38508ff2640)" .section ".note.GNU-stack","",@progbits [hjl@gnu-6 pr57954]$ Clang should also generate "pxor %xmm0, %xmm0" to avoid partial SSE register stall. -- You are receiving this mail because: You are on the CC list for the bug.
_______________________________________________ llvm-bugs mailing list llvm-bugs@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs