mailing list of musl libc
 help / color / mirror / code / Atom feed
95781f4b49037a8779c56e315955db5147e83be8 blob 1071 bytes (raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
 
#include <math.h>
#include <stdint.h>

double ceil(double x)
{
    int32_t old;                                                  
    int32_t new;                                                  
    int32_t tmp1;
    int32_t tmp2;

    __asm__ __volatile__(                    
    "movfcsr2gr %[orig_old],  $r0               \n\t"
    "li.d       %[tmp1], 0x200                  \n\t"
    "or         %[new],  %[orig_old], %[tmp1]   \n\t"
    "li.d       %[tmp2], 0xfffffeff             \n\t"
    "and        %[new],  %[new], %[tmp2]        \n\t"
    "movgr2fcsr $r0,     %[new]                 \n\t"
    "frint.d    %[result],       %[orig_x]      \n\t"
    "movgr2fcsr $r0,     %[orig_old]            \n\t"                                                                                                                                     
    : [result] "+f"(x), [old]"+r"(old), [new]"+r"(new), [tmp1] "+r"(tmp1), [tmp2] "+r"(tmp2)
    : [orig_x] "f"(x), [orig_old]"r"(old), [orig_new]"r"(new), [orig_tmp1] "r"(tmp1), [orig_tmp2] "r"(tmp2)
    :);

    return x;
}
debug log:

solving 95781f4b ...
found 95781f4b in https://inbox.vuxu.org/musl/20240423022619.1253464-1-fanpeng@loongson.cn/

applying [1/1] https://inbox.vuxu.org/musl/20240423022619.1253464-1-fanpeng@loongson.cn/
diff --git a/src/math/loongarch64/ceil.c b/src/math/loongarch64/ceil.c
new file mode 100644
index 00000000..95781f4b

1:12: trailing whitespace.
    int32_t old;                                                  
1:13: trailing whitespace.
    int32_t new;                                                  
1:17: trailing whitespace.
    __asm__ __volatile__(                    
1:25: trailing whitespace.
    "movgr2fcsr $r0,     %[orig_old]            \n\t"                                                                                                                                     
Checking patch src/math/loongarch64/ceil.c...
Applied patch src/math/loongarch64/ceil.c cleanly.
warning: 4 lines add whitespace errors.

index at:
100644 95781f4b49037a8779c56e315955db5147e83be8	src/math/loongarch64/ceil.c

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).