Browse Source

LoongArch64 assembly pack: Really implement OPENSSL_rdtsc

LoongArch [rdtimel.w][1] instruction reads the low 32 bits of the
64-bit stable counter, implement OPENSSL_rdtsc with it instead of always
returning 0.

[1]:https://loongson.github.io/LoongArch-Documentation/LoongArch-Vol1-EN.html#_rdtimelh_w_rdtime_d

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22823)
Xi Ruoyao 5 months ago
parent
commit
a607546e6e
1 changed files with 2 additions and 2 deletions
  1. 2 2
      crypto/loongarch64cpuid.pl

+ 2 - 2
crypto/loongarch64cpuid.pl

@@ -101,8 +101,8 @@ $code.=<<___;
 .globl OPENSSL_rdtsc
 .type   OPENSSL_rdtsc,\@function
 OPENSSL_rdtsc:
-    move    $a0,$zero
-    jr      $ra
+    rdtimel.w $a0,$zero
+    jr        $ra
 ___
 }