[libc-commits] [PATCH] D95999: [libc] Add aarch64 flavors of floor, round, sqrt and trunc.
Sander de Smalen via Phabricator via libc-commits
libc-commits at lists.llvm.org
Thu Feb 4 00:16:17 PST 2021
sdesmalen added inline comments.
================
Comment at: libc/src/math/aarch64/floor.cpp:16
+ double y;
+ __asm__ __volatile__("ldr d0, %1\n"
+ "frintm d0, d0\n"
----------------
Hi @sivachandra sorry for the drive-by comment on your patch, I just happened notice the use of ldr/str here. Is there a specific reason for that? I think this can simply use the register values instead, e.g:
``` double result;
__asm__ __volatile__("frintm %d0, %d1\n"
: "=w"(result) : "w"(x) : );
return result;
```
That way, it will just create a `frintm d0, d0` instruction directly.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D95999/new/
https://reviews.llvm.org/D95999
More information about the libc-commits
mailing list