bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug gas/32390] New: [x86] GAS generates inconsistent instruction encodi


From: skpgkp2 at gmail dot com
Subject: [Bug gas/32390] New: [x86] GAS generates inconsistent instruction encoding for and.
Date: Mon, 25 Nov 2024 20:07:22 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=32390

            Bug ID: 32390
           Summary: [x86] GAS generates inconsistent instruction encoding
                    for and.
           Product: binutils
           Version: unspecified
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: gas
          Assignee: unassigned at sourceware dot org
          Reporter: skpgkp2 at gmail dot com
  Target Milestone: ---

gas generate bigger encoding depending on how immidiate parameter specified.

8 Byte encoding for and.
========================

$ cat y.s
__s:
  and 63, %rdi
  ret

$ gcc -c y.s && objdump -d y.o

y.o:     file format elf64-x86-64


Disassembly of section .text:

0000000000000000 <__s>:
   0:   48 23 3c 25 3f 00 00    and    0x3f,%rdi
   7:   00 
   8:   c3                      ret


4 byte encoding for and.
========================

$ cat y.s
__s:
  and $63, %rdi
  ret

$ gcc -c y.s && objdump -d y.o

y.o:     file format elf64-x86-64


Disassembly of section .text:

0000000000000000 <__s>:
   0:   48 83 e7 3f             and    $0x3f,%rdi
   4:   c3                      ret


Only difference is $ specifier in immediate operand.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]