Skip to content
Snippets Groups Projects
Commit 4db3e3b1 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: c74b57b3d9404c4cb168120c1840150c
Operating System: Ubuntu 22.04.2 LTS
          Kernel: Linux 5.19.0-45-generic
    Architecture: x86-64
 Hardware Vendor: HONOR
  Hardware Model: HYM-WXX
 21:24:15 up  4:16,  1 user,  load average: 2.23, 2.27, 2.30
parent dce2c34a
No related branches found
No related tags found
No related merge requests found
...@@ -12,7 +12,7 @@ int64_t asm_add(int64_t a, int64_t b) { ...@@ -12,7 +12,7 @@ int64_t asm_add(int64_t a, int64_t b) {
int asm_popcnt(uint64_t x) { int asm_popcnt(uint64_t x) {
int s = 0; int s = 0;
uint64_t i = 0; int i = 0;
uint32_t temp = 0; uint32_t temp = 0;
asm( asm(
".Loop: \n" ".Loop: \n"
...@@ -22,8 +22,8 @@ int asm_popcnt(uint64_t x) { ...@@ -22,8 +22,8 @@ int asm_popcnt(uint64_t x) {
"addl %[temp], %[s] \t\n" //s+=?1 "addl %[temp], %[s] \t\n" //s+=?1
"shlq %[i], %[x] \t\n" "shlq %[i], %[x] \t\n"
"addq $1, %[i] \t\n" //循环末尾部分 "addl $1, %[i] \t\n" //循环末尾部分
"cmpq $64, %[i] \t\n" "cmpl $64, %[i] \t\n"
"jnge .Loop \n" "jnge .Loop \n"
:[s] "+r" (s), [i] "+r" (i), [x] "+r" (x), [temp]"+r"(temp) :[s] "+r" (s), [i] "+r" (i), [x] "+r" (x), [temp]"+r"(temp)
); );
......
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