public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/57623] New: BEXTR intrinsic has memory operands switched around (fails to compile code)
@ 2013-06-15 14:29 sgunderson at bigfoot dot com
  2013-06-15 16:33 ` [Bug target/57623] " jakub at gcc dot gnu.org
                   ` (14 more replies)
  0 siblings, 15 replies; 16+ messages in thread
From: sgunderson at bigfoot dot com @ 2013-06-15 14:29 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57623

            Bug ID: 57623
           Summary: BEXTR intrinsic has memory operands switched around
                    (fails to compile code)
           Product: gcc
           Version: 4.8.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: sgunderson at bigfoot dot com

Hi,

Given I'm on gcc 4.8.1 (Debian 4.8.1-2). Given the following test program:

sesse@gruessi:~$ cat bextr-test.c 
#include <stdint.h>

uint64_t func(uint64_t x, uint64_t *y)
{
    return __builtin_ia32_bextr_u64(x, *y);
}

trying to compile it fails:

sesse@gruessi:~$ gcc-4.8 -O2 -mbmi -c bextr-test.c --save-temps
bextr-test.s: Assembler messages:
bextr-test.s:9: Error: operand size mismatch for `bextr'

seemingly because GCC's idea of r/m is broken for this instruction:


sesse@gruessi:~$ cat bextr-test.s
    .file    "bextr-test.c"
    .text
    .p2align 4,,15
    .globl    func
    .type    func, @function
func:
.LFB0:
    .cfi_startproc
    bextr    (%rsi), %rdi, %rax
    ret
    .cfi_endproc
.LFE0:
    .size    func, .-func
    .ident    "GCC: (Debian 4.8.1-2) 4.8.1"
    .section    .note.GNU-stack,"",@progbits

As far as I understand, the second operand can be r/m64, but the first can only
be r64.


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2014-05-07 16:17 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-15 14:29 [Bug target/57623] New: BEXTR intrinsic has memory operands switched around (fails to compile code) sgunderson at bigfoot dot com
2013-06-15 16:33 ` [Bug target/57623] " jakub at gcc dot gnu.org
2013-06-15 17:01 ` sgunderson at bigfoot dot com
2013-06-15 17:13 ` sgunderson at bigfoot dot com
2013-06-17  7:56 ` jakub at gcc dot gnu.org
2013-06-27 11:19 ` sgunderson at bigfoot dot com
2013-06-27 12:13 ` jakub at gcc dot gnu.org
2013-06-27 12:25 ` sgunderson at bigfoot dot com
2013-06-27 12:27 ` jakub at gcc dot gnu.org
2013-06-27 12:42 ` sgunderson at bigfoot dot com
2013-06-27 12:43 ` sgunderson at bigfoot dot com
2013-06-27 12:49 ` jakub at gcc dot gnu.org
2013-06-27 16:50 ` jakub at gcc dot gnu.org
2014-05-07 15:55 ` jakub at gcc dot gnu.org
2014-05-07 15:58 ` jakub at gcc dot gnu.org
2014-05-07 16:17 ` jakub at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).