mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 08:18:11 +00:00
Add clang-format file
Also run it across the whole tree to get everything using the One True Style. We don't yet run this in an automated fashion as it's a little slow, but there is a snippet to do so in makeall.sh.
This commit is contained in:
parent
c11351ac50
commit
0dc9af5f7e
286 changed files with 3244 additions and 2424 deletions
|
@ -1,5 +1,5 @@
|
|||
#include <AK/StdLibExtras.h>
|
||||
#include <AK/Assertions.h>
|
||||
#include <AK/StdLibExtras.h>
|
||||
#include <AK/Types.h>
|
||||
#include <AK/kstdio.h>
|
||||
|
||||
|
@ -20,32 +20,33 @@ void* mmx_memcpy(void* dest, const void* src, size_t len)
|
|||
"rep movsb\n"
|
||||
: "=S"(src_ptr), "=D"(dest_ptr), "=c"(prologue)
|
||||
: "0"(src_ptr), "1"(dest_ptr), "2"(prologue)
|
||||
: "memory"
|
||||
);
|
||||
: "memory");
|
||||
}
|
||||
for (dword i = len / 64; i; --i) {
|
||||
asm volatile(
|
||||
"movq (%0), %%mm0\n"
|
||||
"movq 8(%0), %%mm1\n"
|
||||
"movq 16(%0), %%mm2\n"
|
||||
"movq 24(%0), %%mm3\n"
|
||||
"movq 32(%0), %%mm4\n"
|
||||
"movq 40(%0), %%mm5\n"
|
||||
"movq 48(%0), %%mm6\n"
|
||||
"movq 56(%0), %%mm7\n"
|
||||
"movq %%mm0, (%1)\n"
|
||||
"movq %%mm1, 8(%1)\n"
|
||||
"movq %%mm2, 16(%1)\n"
|
||||
"movq %%mm3, 24(%1)\n"
|
||||
"movq %%mm4, 32(%1)\n"
|
||||
"movq %%mm5, 40(%1)\n"
|
||||
"movq %%mm6, 48(%1)\n"
|
||||
"movq %%mm7, 56(%1)\n"
|
||||
:: "r" (src_ptr), "r" (dest_ptr) : "memory");
|
||||
"movq (%0), %%mm0\n"
|
||||
"movq 8(%0), %%mm1\n"
|
||||
"movq 16(%0), %%mm2\n"
|
||||
"movq 24(%0), %%mm3\n"
|
||||
"movq 32(%0), %%mm4\n"
|
||||
"movq 40(%0), %%mm5\n"
|
||||
"movq 48(%0), %%mm6\n"
|
||||
"movq 56(%0), %%mm7\n"
|
||||
"movq %%mm0, (%1)\n"
|
||||
"movq %%mm1, 8(%1)\n"
|
||||
"movq %%mm2, 16(%1)\n"
|
||||
"movq %%mm3, 24(%1)\n"
|
||||
"movq %%mm4, 32(%1)\n"
|
||||
"movq %%mm5, 40(%1)\n"
|
||||
"movq %%mm6, 48(%1)\n"
|
||||
"movq %%mm7, 56(%1)\n" ::"r"(src_ptr),
|
||||
"r"(dest_ptr)
|
||||
: "memory");
|
||||
src_ptr += 64;
|
||||
dest_ptr += 64;
|
||||
}
|
||||
asm volatile("emms":::"memory");
|
||||
asm volatile("emms" ::
|
||||
: "memory");
|
||||
// Whatever remains we'll have to memcpy.
|
||||
len %= 64;
|
||||
if (len)
|
||||
|
@ -62,13 +63,15 @@ static inline uint32_t divq(uint64_t n, uint32_t d)
|
|||
uint32_t n0 = n;
|
||||
uint32_t q;
|
||||
uint32_t r;
|
||||
asm volatile("divl %4" : "=d"(r), "=a"(q) : "0"(n1), "1"(n0), "rm"(d));
|
||||
asm volatile("divl %4"
|
||||
: "=d"(r), "=a"(q)
|
||||
: "0"(n1), "1"(n0), "rm"(d));
|
||||
return q;
|
||||
}
|
||||
|
||||
static uint64_t unsigned_divide64(uint64_t n, uint64_t d)
|
||||
{
|
||||
if ((d >> 32) == 0) {
|
||||
if ((d >> 32) == 0) {
|
||||
uint64_t b = 1ULL << 32;
|
||||
uint32_t n1 = n >> 32;
|
||||
uint32_t n0 = n;
|
||||
|
@ -149,5 +152,4 @@ uint64_t __udivmoddi4(uint64_t n, uint64_t d, uint64_t* r)
|
|||
return q;
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue