Skip to content
Snippets Groups Projects
Commit 83e4c7fb authored by tracer-nju's avatar tracer-nju Committed by guo zling
Browse files

Static hostname: starker-HYM-WXX

       Icon name: computer-laptop
         Chassis: laptop
      Machine ID: 9f936e1bf87b4e7cb0e53e5422bcaf22
         Boot ID: 6807ca8cb19d46b2879623d3aaa1c492
Operating System: Ubuntu 22.04.2 LTS
          Kernel: Linux 5.19.0-45-generic
    Architecture: x86-64
 Hardware Vendor: HONOR
  Hardware Model: HYM-WXX
 15:14:42 up 14 min,  1 user,  load average: 0.55, 0.50, 0.35
parent 4b6cad37
No related branches found
No related tags found
No related merge requests found
......@@ -2,17 +2,31 @@
#include <string.h>
int64_t asm_add(int64_t a, int64_t b) {
return a + b;
asm(
"add %[b], %[a] \t"
:[a] "+r" (a)
:[b] "r" (b)
);
return a;
}
int asm_popcnt(uint64_t x) {
int s = 0;
int i = 0;
for (int i = 0; i < 64; i++) {
if ((x >> i) & 1) s++;
}
return s;
}
/*int asm_popcnt(uint64_t x) {
int s = 0;
for (int i = 0; i < 64; i++) {
if ((x >> i) & 1) s++;
}
return s;
}*/
void *asm_memcpy(void *dest, const void *src, size_t n) {
return memcpy(dest, src, n);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment