Skip to content

Commit 7fc3491

Browse files
authored
[compiler-rt][RISCV] Use u64 data type for marchid and mimpid (#112163)
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 <[email protected]>
1 parent d4ea086 commit 7fc3491

File tree

1 file changed

+2
-2
lines changed
  • compiler-rt/lib/builtins/cpu_model

1 file changed

+2
-2
lines changed

compiler-rt/lib/builtins/cpu_model/riscv.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ struct {
2222

2323
struct {
2424
unsigned mvendorid;
25-
unsigned marchid;
26-
unsigned mimpid;
25+
unsigned long long marchid;
26+
unsigned long long mimpid;
2727
} __riscv_cpu_model __attribute__((visibility("hidden"), nocommon));
2828

2929
// NOTE: Should sync-up with RISCVFeatures.td

0 commit comments

Comments
 (0)