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

inline asm issue #1036

Closed
salcideon opened this issue Jul 4, 2019 · 3 comments
Closed

inline asm issue #1036

salcideon opened this issue Jul 4, 2019 · 3 comments
Assignees
Labels

Comments

@salcideon
Copy link

salcideon commented Jul 4, 2019

using the toolchain:

static inline float32x4_t
test(float32x4_t _acc_, float32x4_t _op1_, float32x4_t _op2_, int _lane_)
{
    __asm__ __volatile__("fmla %0.4s, %1.4s, %2.s[%3]" : "+w"(_acc_) : "w"(_op1_), "w"(_op2_), "I"(_lane_));
    return _acc_;
}

generates fmla q21.4s, q19.4s, q27.s[#1] instead of fmla q21.4s, q19.4s, q27.s[1] as it should.

Then compilation fails with error: unexpected token in argument list

@pirama-arumuga-nainar
Copy link
Collaborator

Below is a simpler repro. The original fails because lane is a variable instead of a constant (presumably it was a constant once inlined).


void test() {
  __asm__ ("fmla v2.4s, v0.4s, v1.s[%0]" :: "I"(0x1));
}

Fix under review: https://reviews.llvm.org/D65550

@pirama-arumuga-nainar
Copy link
Collaborator

From the LLVM review linked above, another option is to use the 'c' modifier for the lane specifier, which is supported by gcc as well. So if we change the above repro to

void test() {
  __asm__ ("fmla v2.4s, v0.4s, v1.s[%c0]" :: "I"(0x1));
}

it works.

dtzWill pushed a commit to llvm-mirror/llvm that referenced this issue Aug 8, 2019
Summary:
The A64 assembly language does not require the '#' character to
introduce constant immediate operands.  Avoid the '#' since the AArch64
asm parser does not accept '#' before the lane specifier and rejects the
following:
  __asm__ ("fmla v2.4s, v0.4s, v1.s[%0]" :: "I"(0x1))

Fix a test to not expect the '#' and add a new test case with the above
asm.

Fixes: android/ndk#1036

Reviewers: peter.smith, kristof.beyls

Subscribers: javed.absar, hiraditya, llvm-commits, srhines

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D65550

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368320 91177308-0d34-0410-b5e6-96231b3b80d8
llvm-git-migration pushed a commit to llvm/llvm-project that referenced this issue Aug 8, 2019
Summary:
The A64 assembly language does not require the '#' character to
introduce constant immediate operands.  Avoid the '#' since the AArch64
asm parser does not accept '#' before the lane specifier and rejects the
following:
  __asm__ ("fmla v2.4s, v0.4s, v1.s[%0]" :: "I"(0x1))

Fix a test to not expect the '#' and add a new test case with the above
asm.

Fixes: android/ndk#1036

Reviewers: peter.smith, kristof.beyls

Subscribers: javed.absar, hiraditya, llvm-commits, srhines

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D65550

llvm-svn: 368320
@pirama-arumuga-nainar
Copy link
Collaborator

The upstream change was merged and will be part of r21.

earl pushed a commit to earl/llvm-mirror that referenced this issue Aug 17, 2019
Summary:
The A64 assembly language does not require the '#' character to
introduce constant immediate operands.  Avoid the '#' since the AArch64
asm parser does not accept '#' before the lane specifier and rejects the
following:
  __asm__ ("fmla v2.4s, v0.4s, v1.s[%0]" :: "I"(0x1))

Fix a test to not expect the '#' and add a new test case with the above
asm.

Fixes: android/ndk#1036

Reviewers: peter.smith, kristof.beyls

Subscribers: javed.absar, hiraditya, llvm-commits, srhines

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D65550

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368320 91177308-0d34-0410-b5e6-96231b3b80d8
da-x pushed a commit to da-x/llvm-project that referenced this issue Nov 19, 2019
Summary:
The A64 assembly language does not require the '#' character to
introduce constant immediate operands.  Avoid the '#' since the AArch64
asm parser does not accept '#' before the lane specifier and rejects the
following:
  __asm__ ("fmla v2.4s, v0.4s, v1.s[%0]" :: "I"(0x1))

Fix a test to not expect the '#' and add a new test case with the above
asm.

Fixes: android/ndk#1036

Reviewers: peter.smith, kristof.beyls

Subscribers: javed.absar, hiraditya, llvm-commits, srhines

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D65550

Change-Id: I329d38e0e38f1c06aac6ff84c5fd3b48e6ccf080
llvm-svn: 368320
UtsavBalar1231 pushed a commit to RevengeOS/android_art that referenced this issue Dec 25, 2019
Bug: http://b/117842681
Bug: android/ndk#1036

After change https://reviews.llvm.org/D65550, Clang stopped emitting '#'
before constants in inline assembly.  To accommodate this change, mark
the $/# before constants as optional in make_header.py

Test: Build with old and new compilers
Change-Id: Idb056c99a2bfc4d14e4e30d7dc1d0740ca4f9b60
Signed-off-by: mydongistiny <jaysonedson@gmail.com>
DennySPB pushed a commit to syberia-project/platform_art that referenced this issue Dec 26, 2019
Bug: http://b/117842681
Bug: android/ndk#1036

After change https://reviews.llvm.org/D65550, Clang stopped emitting '#'
before constants in inline assembly.  To accommodate this change, mark
the $/# before constants as optional in make_header.py

Test: Build with old and new compilers
Change-Id: Idb056c99a2bfc4d14e4e30d7dc1d0740ca4f9b60
Signed-off-by: mydongistiny <jaysonedson@gmail.com>
Signed-off-by: DennySPB <dennyspb@gmail.com>
maldini03 pushed a commit to Corvus-Q/android_art that referenced this issue Dec 26, 2019
Bug: http://b/117842681
Bug: android/ndk#1036

After change https://reviews.llvm.org/D65550, Clang stopped emitting '#'
before constants in inline assembly.  To accommodate this change, mark
the $/# before constants as optional in make_header.py

Test: Build with old and new compilers
Change-Id: Idb056c99a2bfc4d14e4e30d7dc1d0740ca4f9b60
Signed-off-by: mydongistiny <jaysonedson@gmail.com>
Signed-off-by: DennySPB <dennyspb@gmail.com>
BoredOutOfMyGit pushed a commit to codeaurora-unofficial/platform-art that referenced this issue Dec 29, 2019
Bug: http://b/117842681
Bug: android/ndk#1036

After change https://reviews.llvm.org/D65550, Clang stopped emitting '#'
before constants in inline assembly.  To accommodate this change, mark
the $/# before constants as optional in make_header.py

Test: Build with old and new compilers
Change-Id: Idb056c99a2bfc4d14e4e30d7dc1d0740ca4f9b60
maldini03 pushed a commit to Corvus-Q/android_art that referenced this issue Jan 10, 2020
Bug: http://b/117842681
Bug: android/ndk#1036

After change https://reviews.llvm.org/D65550, Clang stopped emitting '#'
before constants in inline assembly.  To accommodate this change, mark
the $/# before constants as optional in make_header.py

Test: Build with old and new compilers
Change-Id: Idb056c99a2bfc4d14e4e30d7dc1d0740ca4f9b60
Signed-off-by: mydongistiny <jaysonedson@gmail.com>
Signed-off-by: DennySPB <dennyspb@gmail.com>
maldini03 pushed a commit to Corvus-Q/android_art that referenced this issue Jan 29, 2020
Bug: http://b/117842681
Bug: android/ndk#1036

After change https://reviews.llvm.org/D65550, Clang stopped emitting '#'
before constants in inline assembly.  To accommodate this change, mark
the $/# before constants as optional in make_header.py

Test: Build with old and new compilers
Change-Id: Idb056c99a2bfc4d14e4e30d7dc1d0740ca4f9b60
Signed-off-by: mydongistiny <jaysonedson@gmail.com>
Signed-off-by: DennySPB <dennyspb@gmail.com>
blissgerrit pushed a commit to BlissRoms/platform_art that referenced this issue Mar 15, 2020
Bug: http://b/117842681
Bug: android/ndk#1036

After change https://reviews.llvm.org/D65550, Clang stopped emitting '#'
before constants in inline assembly.  To accommodate this change, mark
the $/# before constants as optional in make_header.py

Test: Build with old and new compilers
Change-Id: Idb056c99a2bfc4d14e4e30d7dc1d0740ca4f9b60
Signed-off-by: mydongistiny <jaysonedson@gmail.com>
Signed-off-by: DennySPB <dennyspb@gmail.com>
markakash pushed a commit to LucidProject/platform_art that referenced this issue Apr 20, 2020
Bug: http://b/117842681
Bug: android/ndk#1036

After change https://reviews.llvm.org/D65550, Clang stopped emitting '#'
before constants in inline assembly.  To accommodate this change, mark
the $/# before constants as optional in make_header.py

Test: Build with old and new compilers
Change-Id: Idb056c99a2bfc4d14e4e30d7dc1d0740ca4f9b60
sujitroy pushed a commit to Lineage-X/android_art that referenced this issue Apr 21, 2020
Bug: http://b/117842681
Bug: android/ndk#1036

After change https://reviews.llvm.org/D65550, Clang stopped emitting '#'
before constants in inline assembly.  To accommodate this change, mark
the $/# before constants as optional in make_header.py

Test: Build with old and new compilers
Change-Id: Idb056c99a2bfc4d14e4e30d7dc1d0740ca4f9b60
pa-gerrit pushed a commit to AOSPA/android_art that referenced this issue May 3, 2020
Bug: http://b/117842681
Bug: android/ndk#1036

After change https://reviews.llvm.org/D65550, Clang stopped emitting '#'
before constants in inline assembly.  To accommodate this change, mark
the $/# before constants as optional in make_header.py

Test: Build with old and new compilers
Change-Id: Idb056c99a2bfc4d14e4e30d7dc1d0740ca4f9b60
Signed-off-by: Park Ju Hyung <qkrwngud825@gmail.com>
neobuddy89 pushed a commit to crdroidandroid/android_art that referenced this issue May 3, 2020
Bug: http://b/117842681
Bug: android/ndk#1036

After change https://reviews.llvm.org/D65550, Clang stopped emitting '#'
before constants in inline assembly.  To accommodate this change, mark
the $/# before constants as optional in make_header.py

Test: Build with old and new compilers
Change-Id: Idb056c99a2bfc4d14e4e30d7dc1d0740ca4f9b60
Signed-off-by: Park Ju Hyung <qkrwngud825@gmail.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
neobuddy89 pushed a commit to crdroidandroid/android_art that referenced this issue Jun 6, 2020
Bug: http://b/117842681
Bug: android/ndk#1036

After change https://reviews.llvm.org/D65550, Clang stopped emitting '#'
before constants in inline assembly.  To accommodate this change, mark
the $/# before constants as optional in make_header.py

Test: Build with old and new compilers
Change-Id: Idb056c99a2bfc4d14e4e30d7dc1d0740ca4f9b60
Signed-off-by: Park Ju Hyung <qkrwngud825@gmail.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
DennySPB pushed a commit to syberia-project/platform_art that referenced this issue Jun 17, 2020
Bug: http://b/117842681
Bug: android/ndk#1036

After change https://reviews.llvm.org/D65550, Clang stopped emitting '#'
before constants in inline assembly.  To accommodate this change, mark
the $/# before constants as optional in make_header.py

Test: Build with old and new compilers
Change-Id: Idb056c99a2bfc4d14e4e30d7dc1d0740ca4f9b60
Signed-off-by: Park Ju Hyung <qkrwngud825@gmail.com>
Signed-off-by: DennySPb <dennyspb@gmail.com>
spezi77 pushed a commit to pixeldust-project-caf/android_art that referenced this issue Jun 27, 2020
Bug: http://b/117842681
Bug: android/ndk#1036

After change https://reviews.llvm.org/D65550, Clang stopped emitting '#'
before constants in inline assembly.  To accommodate this change, mark
the $/# before constants as optional in make_header.py

Test: Build with old and new compilers
Change-Id: Idb056c99a2bfc4d14e4e30d7dc1d0740ca4f9b60
Signed-off-by: Park Ju Hyung <qkrwngud825@gmail.com>
Signed-off-by: spezi77 <spezi7713@gmx.net>
blissgerrit pushed a commit to BlissRoms/platform_art that referenced this issue Jun 28, 2020
Bug: http://b/117842681
Bug: android/ndk#1036

After change https://reviews.llvm.org/D65550, Clang stopped emitting '#'
before constants in inline assembly.  To accommodate this change, mark
the $/# before constants as optional in make_header.py

Test: Build with old and new compilers
Change-Id: Idb056c99a2bfc4d14e4e30d7dc1d0740ca4f9b60
Signed-off-by: Park Ju Hyung <qkrwngud825@gmail.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
XtendedGerrit pushed a commit to Project-Xtended/art that referenced this issue Jul 7, 2020
Bug: http://b/117842681
Bug: android/ndk#1036

After change https://reviews.llvm.org/D65550, Clang stopped emitting '#'
before constants in inline assembly.  To accommodate this change, mark
the $/# before constants as optional in make_header.py

Test: Build with old and new compilers
Change-Id: Idb056c99a2bfc4d14e4e30d7dc1d0740ca4f9b60
Signed-off-by: Park Ju Hyung <qkrwngud825@gmail.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
hungphan2001 pushed a commit to CherishOS/android_art that referenced this issue Jul 11, 2020
Bug: http://b/117842681
Bug: android/ndk#1036

After change https://reviews.llvm.org/D65550, Clang stopped emitting '#'
before constants in inline assembly.  To accommodate this change, mark
the $/# before constants as optional in make_header.py

Test: Build with old and new compilers
Change-Id: Idb056c99a2bfc4d14e4e30d7dc1d0740ca4f9b60
Signed-off-by: Park Ju Hyung <qkrwngud825@gmail.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Klozz pushed a commit to TheXPerienceProject/android_art that referenced this issue Aug 4, 2020
Bug: http://b/117842681
Bug: android/ndk#1036

After change https://reviews.llvm.org/D65550, Clang stopped emitting '#'
before constants in inline assembly.  To accommodate this change, mark
the $/# before constants as optional in make_header.py

Test: Build with old and new compilers
Change-Id: Idb056c99a2bfc4d14e4e30d7dc1d0740ca4f9b60
Signed-off-by: Park Ju Hyung <qkrwngud825@gmail.com>
HSgod pushed a commit to ProjectStreak/platform_art that referenced this issue Aug 17, 2020
Bug: http://b/117842681
Bug: android/ndk#1036

After change https://reviews.llvm.org/D65550, Clang stopped emitting '#'
before constants in inline assembly.  To accommodate this change, mark
the $/# before constants as optional in make_header.py

Test: Build with old and new compilers
Change-Id: Idb056c99a2bfc4d14e4e30d7dc1d0740ca4f9b60
Signed-off-by: Park Ju Hyung <qkrwngud825@gmail.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
HSgod pushed a commit to ProjectStreak/platform_art that referenced this issue Aug 18, 2020
Bug: http://b/117842681
Bug: android/ndk#1036

After change https://reviews.llvm.org/D65550, Clang stopped emitting '#'
before constants in inline assembly.  To accommodate this change, mark
the $/# before constants as optional in make_header.py

Test: Build with old and new compilers
Change-Id: Idb056c99a2bfc4d14e4e30d7dc1d0740ca4f9b60
Signed-off-by: Park Ju Hyung <qkrwngud825@gmail.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
HSgod pushed a commit to ProjectStreak/platform_art that referenced this issue Aug 18, 2020
Bug: http://b/117842681
Bug: android/ndk#1036

After change https://reviews.llvm.org/D65550, Clang stopped emitting '#'
before constants in inline assembly.  To accommodate this change, mark
the $/# before constants as optional in make_header.py

Test: Build with old and new compilers
Change-Id: Idb056c99a2bfc4d14e4e30d7dc1d0740ca4f9b60
Signed-off-by: Park Ju Hyung <qkrwngud825@gmail.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
maldini03 pushed a commit to bananadroid/android_art that referenced this issue Aug 24, 2020
Bug: http://b/117842681
Bug: android/ndk#1036

After change https://reviews.llvm.org/D65550, Clang stopped emitting '#'
before constants in inline assembly.  To accommodate this change, mark
the $/# before constants as optional in make_header.py

Test: Build with old and new compilers
Change-Id: Idb056c99a2bfc4d14e4e30d7dc1d0740ca4f9b60
Signed-off-by: Park Ju Hyung <qkrwngud825@gmail.com>
Tomoms pushed a commit to Tomoms/android_art that referenced this issue Oct 4, 2020
Bug: http://b/117842681
Bug: android/ndk#1036

After change https://reviews.llvm.org/D65550, Clang stopped emitting '#'
before constants in inline assembly.  To accommodate this change, mark
the $/# before constants as optional in make_header.py

Test: Build with old and new compilers
Change-Id: Idb056c99a2bfc4d14e4e30d7dc1d0740ca4f9b60
Signed-off-by: Park Ju Hyung <qkrwngud825@gmail.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
TheHardGamer pushed a commit to HavocQ/android_art that referenced this issue May 10, 2021
Bug: http://b/117842681
Bug: android/ndk#1036

After change https://reviews.llvm.org/D65550, Clang stopped emitting '#'
before constants in inline assembly.  To accommodate this change, mark
the $/# before constants as optional in make_header.py

Test: Build with old and new compilers
Change-Id: Idb056c99a2bfc4d14e4e30d7dc1d0740ca4f9b60
Signed-off-by: Park Ju Hyung <qkrwngud825@gmail.com>
SirRGB pushed a commit to crDroid-Revived/android_art that referenced this issue May 8, 2022
Bug: http://b/117842681
Bug: android/ndk#1036

After change https://reviews.llvm.org/D65550, Clang stopped emitting '#'
before constants in inline assembly.  To accommodate this change, mark
the $/# before constants as optional in make_header.py

Test: Build with old and new compilers
Change-Id: Idb056c99a2bfc4d14e4e30d7dc1d0740ca4f9b60
Signed-off-by: Park Ju Hyung <qkrwngud825@gmail.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
ghosasilo pushed a commit to SuperiorOS-Q/android_art that referenced this issue Jun 24, 2022
Bug: http://b/117842681
Bug: android/ndk#1036

After change https://reviews.llvm.org/D65550, Clang stopped emitting '#'
before constants in inline assembly.  To accommodate this change, mark
the $/# before constants as optional in make_header.py

Test: Build with old and new compilers
Change-Id: Idb056c99a2bfc4d14e4e30d7dc1d0740ca4f9b60
Signed-off-by: Park Ju Hyung <qkrwngud825@gmail.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Signed-off-by: โฆสสิโล <ghosasilo@pm.me>
SirRGB pushed a commit to LineageOS-Revived/android_art that referenced this issue Mar 26, 2023
Bug: http://b/117842681
Bug: android/ndk#1036

After change https://reviews.llvm.org/D65550, Clang stopped emitting '#'
before constants in inline assembly.  To accommodate this change, mark
the $/# before constants as optional in make_header.py

Test: Build with old and new compilers
Change-Id: Idb056c99a2bfc4d14e4e30d7dc1d0740ca4f9b60
Signed-off-by: Park Ju Hyung <qkrwngud825@gmail.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
SirRGB pushed a commit to LineageOS-Revived/android_art that referenced this issue Jun 3, 2023
Bug: http://b/117842681
Bug: android/ndk#1036

After change https://reviews.llvm.org/D65550, Clang stopped emitting '#'
before constants in inline assembly.  To accommodate this change, mark
the $/# before constants as optional in make_header.py

Test: Build with old and new compilers
Change-Id: Idb056c99a2bfc4d14e4e30d7dc1d0740ca4f9b60
Signed-off-by: Park Ju Hyung <qkrwngud825@gmail.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants