Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clang doesn't support Y-prefixed asm constraints #13571

Open
llvmbot opened this issue Jun 25, 2012 · 4 comments
Open

clang doesn't support Y-prefixed asm constraints #13571

llvmbot opened this issue Jun 25, 2012 · 4 comments
Labels
bugzilla Issues migrated from bugzilla clang:frontend Language frontend issues, e.g. anything involving "Sema"

Comments

@llvmbot
Copy link
Collaborator

llvmbot commented Jun 25, 2012

Bugzilla Link 13199
Version 3.1
OS All
Blocks #11360
Reporter LLVM Bugzilla Contributor
CC @tkremenek,@RKSimon,@noloader

Extended Description

$ cat 1.c
#include <inttypes.h>

static uint64_t y = 0x123456789ABCDEF0ULL;

int
main()
{
register uint64_t x;
asm volatile ( "movq %1, %0" : "=Yz"(x) : "m"(y) );

return 0;

}

$ cc -O0 -ggdb -Wall -W -mssse3 -m64 1.c -o 1

$ objdump -d 1
...
0000000000400530

:
400530: 55 push %rbp
400531: 48 89 e5 mov %rsp,%rbp
400534: f3 0f 7e 05 a4 00 10 movq 1048740(%rip),%xmm0 # 5005e0
40053b: 00
40053c: b8 00 00 00 00 mov $0x0,%eax
400541: c9 leaveq
400542: c3 retq
...

$ clang -O0 -ggdb -Wall -W -mssse3 -m64 1.c -o 1
1.c:9:33: error: invalid output constraint '=Yz' in asm
asm volatile ( "movq %1, %0" : "=Yz"(x) : "m"(y) );
^
1 error generated.

$ cc --version
cc (GCC) 4.2.2 20070831 prerelease [FreeBSD]
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ clang --version
clang version 3.1 (trunk)
Target: amd64-portbld-freebsd8.2
Thread model: posix

@llvmbot
Copy link
Collaborator Author

llvmbot commented Jun 25, 2012

From http://gcc.gnu.org/svn/gcc/trunk/gcc/config/i386/constraints.md :

;; We use the Y prefix to denote any number of conditional register sets:
;; z First SSE register.
;; i SSE2 inter-unit moves enabled
;; m MMX inter-unit moves enabled
;; a Integer register when zero extensions with AND are disabled
;; p Integer register when TARGET_PARTIAL_REG_STALL is disabled
;; d Integer register when integer DFmode moves are enabled
;; x Integer register when integer XFmode moves are enabled

Looks like clang doesn't support any of Y-prefixed constraints.

@tkremenek
Copy link
Contributor

cloned to rdar://problem/11741367

@RKSimon
Copy link
Collaborator

RKSimon commented Apr 21, 2017

*** Bug llvm/llvm-bugzilla-archive#32727 has been marked as a duplicate of this bug. ***

@RKSimon
Copy link
Collaborator

RKSimon commented Nov 26, 2021

mentioned in issue llvm/llvm-bugzilla-archive#32727

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla clang:frontend Language frontend issues, e.g. anything involving "Sema"
Projects
None yet
Development

No branches or pull requests

3 participants