Patrick Boettcher via llvm-dev
2016-Mar-21 14:11 UTC
[llvm-dev] PATCH: clang/LLVM - Sparc - inline ASM with floating pointer registers
Hi lists, Sorry for cross-posting, but these two patches are of concern to clang and llvm. I'm compiling C-code which includes inline assembler which looks like the following using the sparc-target: static inline float fabsf(float a) { float res; __asm __volatile__("fabss %1, %0;" : "=f"(res) : "f"(a)); return res; } This fails with llvm/clang - trunk/master. I patched clang and llvm and, as I'm new to both project, I'm having doubts that it is enough - however it works. What would be necessary to have it included in both projects? Is my code correct for what I want to do? What would have been a more appropriate process to submit? best regards, -- Patrick. -------------- next part -------------- A non-text attachment was scrubbed... Name: 0001-SPARC-Allow-usage-of-floating-point-registers-in-inl.patch Type: text/x-patch Size: 2196 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160321/22e4030b/attachment.bin> -------------- next part -------------- A non-text attachment was scrubbed... Name: 0001-SPARC-allow-usage-of-floating-point-registers-in-inl.patch Type: text/x-patch Size: 1013 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160321/22e4030b/attachment-0001.bin>
Arnaud Allard de Grandmaison via llvm-dev
2016-Mar-21 22:46 UTC
[llvm-dev] [cfe-dev] PATCH: clang/LLVM - Sparc - inline ASM with floating pointer registers
Hi Patrick, I do not see a problem with those patches --- apart from missing tests ;) Cheers, Arnaud On Mon, Mar 21, 2016 at 3:11 PM, Patrick Boettcher via cfe-dev < cfe-dev at lists.llvm.org> wrote:> Hi lists, > > Sorry for cross-posting, but these two patches are of concern to clang > and llvm. > > I'm compiling C-code which includes inline assembler which looks like > the following using the sparc-target: > > static inline float fabsf(float a) > { > float res; > __asm __volatile__("fabss %1, %0;" > : "=f"(res) > : "f"(a)); > return res; > } > > This fails with llvm/clang - trunk/master. > > I patched clang and llvm and, as I'm new to both project, I'm having > doubts that it is enough - however it works. > > What would be necessary to have it included in both projects? > Is my code correct for what I want to do? > What would have been a more appropriate process to submit? > > best regards, > -- > Patrick. > > > > > > > _______________________________________________ > cfe-dev mailing list > cfe-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160321/8e3201e8/attachment.html>
James Y Knight via llvm-dev
2016-Mar-22 15:27 UTC
[llvm-dev] [cfe-dev] PATCH: clang/LLVM - Sparc - inline ASM with floating pointer registers
Your change looks almost correct. You need: - Test cases. - Add the new 'f' type to the documentation in LangRef.rst. - Check the type of the arg (f32, f64, or f128) to choose the right one of FPRegsRegClass, DFPRegsRegClass, QFPRegsRegClass. Then, please submit for review, per http://llvm.org/docs/DeveloperPolicy.html (Typically best to do so via Phabricator, http://llvm.org/docs/Phabricator.html) On Mon, Mar 21, 2016 at 6:46 PM, Arnaud Allard de Grandmaison via llvm-dev < llvm-dev at lists.llvm.org> wrote:> Hi Patrick, > > I do not see a problem with those patches --- apart from missing tests ;) > > Cheers, > Arnaud > > On Mon, Mar 21, 2016 at 3:11 PM, Patrick Boettcher via cfe-dev < > cfe-dev at lists.llvm.org> wrote: > >> Hi lists, >> >> Sorry for cross-posting, but these two patches are of concern to clang >> and llvm. >> >> I'm compiling C-code which includes inline assembler which looks like >> the following using the sparc-target: >> >> static inline float fabsf(float a) >> { >> float res; >> __asm __volatile__("fabss %1, %0;" >> : "=f"(res) >> : "f"(a)); >> return res; >> } >> >> This fails with llvm/clang - trunk/master. >> >> I patched clang and llvm and, as I'm new to both project, I'm having >> doubts that it is enough - however it works. >> >> What would be necessary to have it included in both projects? >> Is my code correct for what I want to do? >> What would have been a more appropriate process to submit? >> >> best regards, >> -- >> Patrick. >> >> >> >> >> >> >> _______________________________________________ >> cfe-dev mailing list >> cfe-dev at lists.llvm.org >> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev >> >> > > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://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/20160322/2c9ad96a/attachment.html>
Reasonably Related Threads
- [cfe-dev] PATCH: clang/LLVM - Sparc - inline ASM with floating pointer registers
- PATCH: clang/LLVM - Sparc - inline ASM with floating pointer registers
- [PATCH 2/3] Use fabsf() instead of fabs() since we have floats, not double
- [PATCH 2/3] Use fabsf() instead of fabs() since we have floats, not double
- [LLVMdev] Sparc: handling unused operands in instruction format F3_3