Skip to content

Commit 12882dc

Browse files
committed
milestone: test failures 0
1 parent cd921b4 commit 12882dc

File tree

3 files changed

+21
-24
lines changed

3 files changed

+21
-24
lines changed

CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -622,8 +622,6 @@ if(CAPSTONE_RISCV_SUPPORT)
622622
arch/RISCV/RISCVGenRegisterInfo.inc
623623
arch/RISCV/RISCVGenSubtargetInfo.inc
624624
arch/RISCV/RISCVGenSystemOperands.inc
625-
arch/RISCV/RISCVMappingInsn.inc
626-
arch/RISCV/RISCVMappingInsnOp.inc
627625
)
628626
endif()
629627

arch/RISCV/RISCVMapping.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,19 +142,18 @@ void RISCV_compact_operands(MCInst *MI) {
142142
// and therefore the read-write operand is wrongly classified as only-read
143143
// this logic tries to correct that
144144
void RISCV_add_missing_write_access(MCInst* MI) {
145-
printf("REACHABLE %d\n\n", !isCompressed(MI));
145+
if (!detail_is_set(MI))
146+
return;
146147
if (!isCompressed(MI))
147148
return;
148149

149150
cs_riscv *riscv_details = &(MI->flat_insn->detail->riscv);
150151
cs_riscv_op* ops = riscv_details->operands;
151152
// make the detection condition as specific as possible
152153
// so it doesn't accidentally trigger for other cases
153-
printf("\n---------------- %d @ %d @ %d @ %d", riscv_details->op_count, ops[0].type,ops[1].type,ops[1].access);
154154
if (riscv_details->op_count == 2
155155
&& ops[0].type == RISCV_OP_INVALID && ops[1].type == RISCV_OP_REG
156156
&& ops[1].access == CS_AC_READ) {
157-
printf("\n\n&&&&&&&&&&&&& MISSING WRITE ACCESS DETECTED FOR OPCODE %d !!!!!!!!!!!!!!!!!!!!!!! \n\n", MI->Opcode);
158157
ops[1].access |= CS_AC_WRITE;
159158
}
160159
}

tests/details/riscv.yaml

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ test_cases:
315315
reg: ra
316316
access: CS_AC_WRITE
317317
- type: RISCV_OP_IMM
318-
imm: 0xffc
318+
imm: -0x10
319319
access: CS_AC_READ
320320
groups: [RISCV_GRP_CALL, RISCV_GRP_BRANCH_RELATIVE]
321321
- asm_text: "jalr ra, 4(a0)"
@@ -346,7 +346,7 @@ test_cases:
346346
imm: -4
347347
access: CS_AC_READ
348348
groups: [RISCV_GRP_CALL]
349-
- asm_text: "beq sp, tp, 0xa"
349+
- asm_text: "beq sp, tp, 4130"
350350
details:
351351
riscv:
352352
operands:
@@ -360,7 +360,7 @@ test_cases:
360360
imm: 0xa
361361
access: CS_AC_READ
362362
groups: [RISCV_GRP_JUMP, RISCV_GRP_BRANCH_RELATIVE]
363-
- asm_text: "bne gp, t1, -6"
363+
- asm_text: "bne gp, t1, 4118"
364364
details:
365365
riscv:
366366
operands:
@@ -374,7 +374,7 @@ test_cases:
374374
imm: -6
375375
access: CS_AC_READ
376376
groups: [RISCV_GRP_JUMP, RISCV_GRP_BRANCH_RELATIVE]
377-
- asm_text: "blt t2, s1, 0x14"
377+
- asm_text: "blt t2, s1, 4148"
378378
details:
379379
riscv:
380380
operands:
@@ -388,7 +388,7 @@ test_cases:
388388
imm: 0x14
389389
access: CS_AC_READ
390390
groups: [RISCV_GRP_JUMP, RISCV_GRP_BRANCH_RELATIVE]
391-
- asm_text: "bge a0, a1, 6"
391+
- asm_text: "bge a0, a1, 4138"
392392
details:
393393
riscv:
394394
operands:
@@ -402,7 +402,7 @@ test_cases:
402402
imm: 0x6
403403
access: CS_AC_READ
404404
groups: [RISCV_GRP_JUMP, RISCV_GRP_BRANCH_RELATIVE]
405-
- asm_text: "bltu a2, a3, 0xa"
405+
- asm_text: "bltu a2, a3, 4146"
406406
details:
407407
riscv:
408408
operands:
@@ -416,7 +416,7 @@ test_cases:
416416
imm: 0xa
417417
access: CS_AC_READ
418418
groups: [RISCV_GRP_JUMP, RISCV_GRP_BRANCH_RELATIVE]
419-
- asm_text: "bgeu a4, a5, 0xc"
419+
- asm_text: "bgeu a4, a5, 4152"
420420
details:
421421
riscv:
422422
operands:
@@ -887,7 +887,7 @@ test_cases:
887887
access: CS_AC_READ
888888

889889
groups: [RISCV_FEATURE_HasStdExtA]
890-
- asm_text: "fmadd.s ft0, ft1, ft2, ft3"
890+
- asm_text: "fmadd.s ft0, ft1, ft2, ft3, dyn"
891891
details:
892892
riscv:
893893
operands:
@@ -904,7 +904,7 @@ test_cases:
904904
reg: ft3
905905
access: CS_AC_READ
906906
groups: [RISCV_FEATURE_HasStdExtF]
907-
- asm_text: "fadd.s ft5, ft6, ft7"
907+
- asm_text: "fadd.s ft5, ft6, ft7, dyn"
908908
details:
909909
riscv:
910910
operands:
@@ -918,7 +918,7 @@ test_cases:
918918
reg: ft7
919919
access: CS_AC_READ
920920
groups: [RISCV_FEATURE_HasStdExtF]
921-
- asm_text: "fsqrt.s fs0, fs1"
921+
- asm_text: "fsqrt.s fs0, fs1, dyn"
922922
details:
923923
riscv:
924924
operands:
@@ -979,7 +979,7 @@ test_cases:
979979
reg: fa0
980980
access: CS_AC_READ
981981
groups: [RISCV_FEATURE_HasStdExtF]
982-
- asm_text: "fcvt.w.s a0, ft0"
982+
- asm_text: "fcvt.w.s a0, ft0, dyn"
983983
details:
984984
riscv:
985985
operands:
@@ -990,7 +990,7 @@ test_cases:
990990
reg: ft0
991991
access: CS_AC_READ
992992
groups: [RISCV_FEATURE_HasStdExtF]
993-
- asm_text: "fcvt.s.w ft1, a1"
993+
- asm_text: "fcvt.s.w ft1, a1, dyn"
994994
details:
995995
riscv:
996996
operands:
@@ -1036,7 +1036,7 @@ test_cases:
10361036
mem_disp: 0xe
10371037
access: CS_AC_WRITE
10381038
groups: [RISCV_FEATURE_HasStdExtF]
1039-
- asm_text: "fmadd.d ft0, ft1, ft2, ft3"
1039+
- asm_text: "fmadd.d ft0, ft1, ft2, ft3, dyn"
10401040
details:
10411041
riscv:
10421042
operands:
@@ -1053,7 +1053,7 @@ test_cases:
10531053
reg: ft3
10541054
access: CS_AC_READ
10551055
groups: [RISCV_FEATURE_HasStdExtD]
1056-
- asm_text: "fadd.d ft5, ft6, ft7"
1056+
- asm_text: "fadd.d ft5, ft6, ft7, dyn"
10571057
details:
10581058
riscv:
10591059
operands:
@@ -1067,7 +1067,7 @@ test_cases:
10671067
reg: ft7
10681068
access: CS_AC_READ
10691069
groups: [RISCV_FEATURE_HasStdExtD]
1070-
- asm_text: "fsqrt.d fs0, fs1"
1070+
- asm_text: "fsqrt.d fs0, fs1, dyn"
10711071
details:
10721072
riscv:
10731073
operands:
@@ -1626,7 +1626,7 @@ test_cases:
16261626
reg: t4
16271627
access: CS_AC_READ
16281628
groups: [RISCV_FEATURE_HasStdExtCOrZca]
1629-
- asm_text: "c.beqz a0, -8"
1629+
- asm_text: "c.beqz a0, 4120"
16301630
details:
16311631
riscv:
16321632
operands:
@@ -1645,7 +1645,7 @@ test_cases:
16451645
- asm_text: "c.nop"
16461646
details:
16471647
groups: [RISCV_FEATURE_HasStdExtCOrZca]
1648-
- asm_text: "c.j 0x7fe"
1648+
- asm_text: "c.j 6178"
16491649
details:
16501650
riscv:
16511651
operands:
@@ -1665,8 +1665,8 @@ test_cases:
16651665
- type: RISCV_OP_REG
16661666
reg: t0
16671667
access: CS_AC_READ
1668-
groups: [RISCV_FEATURE_HasStdExtCOrZca, RISCV_GRP_JUMP]
1669-
- asm_text: "c.jal 4"
1668+
groups: [RISCV_GRP_JUMP, RISCV_FEATURE_HasStdExtCOrZca]
1669+
- asm_text: "c.jal 4140"
16701670
details:
16711671
riscv:
16721672
operands:

0 commit comments

Comments
 (0)