Skip to content

Commit

Permalink
[compiler-rt][RISCV] Use u64 data type for marchid and mimpid (llvm#1…
Browse files Browse the repository at this point in the history
…12163)

Base on riscv-non-isa/riscv-c-api-doc#91 , the
marchid and mimpid are MXLEN bits wide, and kernel returned them as u64
data type. So we should use u64 data type for marchid and mimpid in
__riscv_cpu_model struct here.

Signed-off-by: Yangyu Chen <cyy@cyyself.name>
  • Loading branch information
cyyself authored Oct 14, 2024
1 parent d4ea086 commit 7fc3491
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions compiler-rt/lib/builtins/cpu_model/riscv.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ struct {

struct {
unsigned mvendorid;
unsigned marchid;
unsigned mimpid;
unsigned long long marchid;
unsigned long long mimpid;
} __riscv_cpu_model __attribute__((visibility("hidden"), nocommon));

// NOTE: Should sync-up with RISCVFeatures.td
Expand Down

0 comments on commit 7fc3491

Please sign in to comment.