[PATCH] D55192: [PowerPC] VSX register support for inline assembly
Zhang Kang via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 5 20:40:51 PST 2018
ZhangKang added a comment.
@jsji I have updated a new patch for fix the error VSX register index mapping of the old patch.
================
Comment at: clang/lib/Basic/Targets/PPC.cpp:416
+const TargetInfo::AddlRegName GCCAddlRegNames[] = {
+ {{"vs0"}, 0}, {{"vs1"}, 1}, {{"vs2"}, 2}, {{"vs3"}, 3},
+ {{"vs4"}, 4}, {{"vs5"}, 5}, {{"vs6"}, 6}, {{"vs7"}, 7},
----------------
jsji wrote:
> RegNum is wrong here!
> "vs0" should be mapped to RegNum of "f0", which is 33.
> "vs32" should be mapped to RegNum of "v0", which is 78.
I will learn it and check it, thanks for your point out my error.
================
Comment at: clang/lib/Basic/Targets/PPC.cpp:416
+const TargetInfo::AddlRegName GCCAddlRegNames[] = {
+ {{"vs0"}, 0}, {{"vs1"}, 1}, {{"vs2"}, 2}, {{"vs3"}, 3},
+ {{"vs4"}, 4}, {{"vs5"}, 5}, {{"vs6"}, 6}, {{"vs7"}, 7},
----------------
ZhangKang wrote:
> jsji wrote:
> > RegNum is wrong here!
> > "vs0" should be mapped to RegNum of "f0", which is 33.
> > "vs32" should be mapped to RegNum of "v0", which is 78.
> I will learn it and check it, thanks for your point out my error.
Here, the value of `AddlRegName` is responding to the gcc macro `ADDITIONAL_REGISTER_NAMES`. In the array `ADDITIONAL_REGISTER_NAMES`, `vs0~vs31` should be mapped to RegNum of `f0~f31`, which is `32~63`. And `vs32~vs63` should be mapped to RegNum of `v0~v31`, which is `77~108`.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D55192/new/
https://reviews.llvm.org/D55192
More information about the llvm-commits
mailing list