[llvm-dev] [ppc64le] mfspr gpr, ABCD

Jinsong Ji via llvm-dev llvm-dev at lists.llvm.org
Mon Nov 2 07:53:40 PST 2020


Hi Amol:

Thanks for reporting this issue.

I believe you are using *release* build of clang.
If you use assert enabled clang, you should get an assert similar to this:
clang-12: .../llvm/lib/Target/PowerPC/AsmParser/PPCAsmParser.cpp:252:
int64_t (anonymous namespace)::PPCOperand::getImm() const: Assertion `Kind
== Immediate && "Invalid access!"' failed.

I would say this is somehow a *known limitation* of current asmparser --
the error detection/reporting mechanism is not that user friendly..

I would recommend you open a bugzilla for future enhancement
https://bugs.llvm.org/. Thanks.



Best,

Jinsong Ji (纪金松), PhD.

XL/LLVM on Power Compiler Development
E-mail: jji at us.ibm.com



From:	Amol via llvm-dev <llvm-dev at lists.llvm.org>
To:	llvm-dev at lists.llvm.org
Date:	11/01/2020 09:20 AM
Subject:	[EXTERNAL] [llvm-dev] [ppc64le] mfspr gpr, ABCD
Sent by:	"llvm-dev" <llvm-dev-bounces at lists.llvm.org>



Hello,

// 1.s
.abiversion 2
mfspr 8, ABCD
// clang -c -mcpu=power9 -target ppc64le 1.s

The command successfully assembles the source into an object file.

The disassembly shows the instruction emitted:
a6 1a 10 7d: mfspr 8, 112

112 is 0x70.

GNU as throws unsupported relocation error, and doesn't assemble.

This causes problems when a .S is passed to clang for preprocessing
and if the usage of a #define has a typo - clang doesn't catch it.


Thanks,
amol
_______________________________________________
LLVM Developers mailing list
llvm-dev at lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20201102/8a09b217/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: graycol.gif
Type: image/gif
Size: 105 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20201102/8a09b217/attachment.gif>


More information about the llvm-dev mailing list