https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126350

            Bug ID: 126350
           Summary: -mno-sse doesn't disable SSE for _Atomic __int128
           Product: gcc
           Version: 16.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hjl.tools at gmail dot com
                CC: fweimer at redhat dot com
  Target Milestone: ---
            Target: x86-64

When -mno-sse is used on _Atomic __int128, GCC generates function calls to
libatomic:

[hjl@gnu-tgl-3 pr126293]$ cat x.c
_Atomic __int128 load;

__int128
foo (void)
{
  return load;
}
[hjl@gnu-tgl-3 pr126293]$ make CC=gcc
gcc -O2 -mno-sse -S x.c
./pr126293-3b
./pr126293-2b
[hjl@gnu-tgl-3 pr126293]$ cat x.s 
        .file   "x.c"
        .text
        .p2align 4
        .globl  foo
        .type   foo, @function
foo:
.LFB0:
        .cfi_startproc
        movl    $5, %esi
        movl    $load, %edi
        jmp     __atomic_load_16
        .cfi_endproc
.LFE0:
        .size   foo, .-foo
        .globl  load
        .bss
        .align 16
        .type   load, @object
        .size   load, 16
load:
        .zero   16
        .ident  "GCC: (GNU) 16.1.1 20260703 (Red Hat 16.1.1-4)"
        .section        .note.GNU-stack,"",@progbits
[hjl@gnu-tgl-3 pr126293]$ 

Since functions in libatomic is implemented with SSE or AVX instructions,
-mno-sse doesn't disable SSE for _Atomic __int128.

Reply via email to