On 4/21/22 02:15, yangxiaojuan wrote:
On 2022/4/20 上午1:05, Richard Henderson wrote:
You'd use a store, just like you were already doing in trans_csrwr.
But here's how I'd improve this. For avoidance of doubt, all of this would go in
trans_priviledged.c.inc -- there's no use of csr_offsets[]
On 2022/4/20 上午1:05, Richard Henderson wrote:
You'd use a store, just like you were already doing in trans_csrwr.
But here's how I'd improve this. For avoidance of doubt, all of this
would go in trans_priviledged.c.inc -- there's no use of csr_offsets[]
outside of that file.
Thanks you
On 4/19/22 00:33, yangxiaojuan wrote:
On 2022/4/16 上午9:04, Richard Henderson wrote:
On 4/15/22 02:40, Xiaojuan Yang wrote:
...
+void helper_csr_update(CPULoongArchState *env, target_ulong new_val,
+ target_ulong csr_offset)
+{
+ uint64_t *csr = (void *)env +
On 2022/4/16 上午9:04, Richard Henderson wrote:
On 4/15/22 02:40, Xiaojuan Yang wrote:
...
+void helper_csr_update(CPULoongArchState *env, target_ulong new_val,
+ target_ulong csr_offset)
+{
+ uint64_t *csr = (void *)env + csr_offset;
+
+ *csr = new_val;
+}
This
On 4/18/22 05:38, yangxiaojuan wrote:
On 2022/4/16 上午9:04, Richard Henderson wrote:
+int cpu_csr_offset(unsigned csr_num);
...
+static const uint64_t csr_offsets[] = {
There's no reason for this array to be uint64_t.
It really should match the function.
Yes, we shoud do this.
If we use
On 2022/4/16 上午9:04, Richard Henderson wrote:
+int cpu_csr_offset(unsigned csr_num);
...
+static const uint64_t csr_offsets[] = {
There's no reason for this array to be uint64_t.
It really should match the function.
Yes, we shoud do this.
If we use 'int', we may get a warning:
On 4/15/22 02:40, Xiaojuan Yang wrote:
+int cpu_csr_offset(unsigned csr_num);
...
+static const uint64_t csr_offsets[] = {
There's no reason for this array to be uint64_t.
It really should match the function.
+target_ulong helper_csrwr_estat(CPULoongArchState *env, target_ulong val)
+{
+
This includes:
- CSRRD
- CSRWR
- CSRXCHG
Signed-off-by: Xiaojuan Yang
Signed-off-by: Song Gao
---
target/loongarch/cpu-csr.h| 2 +
target/loongarch/csr_helper.c | 186 ++
target/loongarch/disas.c | 15 ++