Skip to content

Commit 590fc15

Browse files
authored
andn: use the new instruction schema (#854)
In (#686), a new instruction schema was created for types/subtypes. This commit change B/andn instruction to use the new schema. It is also part of effort in (#655). --------- Signed-off-by: Usman Akinyemi <usmanakinyemi202@gmail.com>
1 parent ac8ca0d commit 590fc15

File tree

3 files changed

+29
-15
lines changed

3 files changed

+29
-15
lines changed

backends/instructions_appendix/all_instructions.golden.adoc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
= Instruction Appendix
22
:doctype: book
3-
:wavedrom: /workspace/riscv-unified-db/node_modules/.bin/wavedrom-cli
3+
:wavedrom: /home/uniqueusman/riscv-unified-db/node_modules/.bin/wavedrom-cli
44
// Now the document header is complete and the wavedrom attribute is active.
55

66

@@ -2396,7 +2396,7 @@ AND with inverted operand
23962396
Encoding::
23972397
[wavedrom, ,svg,subs='attributes',width="100%"]
23982398
....
2399-
{"reg":[{"bits":7,"name": 0x33,"type":2},{"bits":5,"name": "rd","type":4},{"bits":3,"name": 0x7,"type":2},{"bits":5,"name": "rs1","type":4},{"bits":5,"name": "rs2","type":4},{"bits":7,"name": 0x20,"type":2}]}
2399+
{"reg":[{"bits":7,"name": 0x33,"type":2},{"bits":5,"name": "xd","type":4},{"bits":3,"name": 0x7,"type":2},{"bits":5,"name": "xs1","type":4},{"bits":5,"name": "xs2","type":4},{"bits":7,"name": 0x20,"type":2}]}
24002400
....
24012401

24022402
Description::
@@ -2408,9 +2408,9 @@ Decode Variables::
24082408
[width="100%", cols="1,2", options="header"]
24092409
|===
24102410
|Variable Name |Location
2411-
|rs2 |$encoding[24:20]
2412-
|rs1 |$encoding[19:15]
2413-
|rd |$encoding[11:7]
2411+
|xs2 |$encoding[24:20]
2412+
|xs1 |$encoding[19:15]
2413+
|xd |$encoding[11:7]
24142414
|===
24152415

24162416
Included in::

spec/std/isa/inst/B/andn.yaml

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,17 @@ description: |
1313
definedBy:
1414
anyOf: [Zbb, Zbkb]
1515
assembly: xd, xs1, xs2
16-
encoding:
17-
match: 0100000----------111-----0110011
18-
variables:
19-
- name: rs2
20-
location: 24-20
21-
- name: rs1
22-
location: 19-15
23-
- name: rd
24-
location: 11-7
16+
format:
17+
$inherits:
18+
- inst_subtype/R/R-x.yaml#/data
19+
opcodes:
20+
funct7:
21+
display_name: ANDN
22+
value: 0b0100000
23+
funct3:
24+
display_name: ANDN
25+
value: 0b111
26+
opcode: { $inherits: inst_opcode/OP.yaml#/data }
2527
access:
2628
s: always
2729
u: always
@@ -33,7 +35,7 @@ operation(): |
3335
raise (ExceptionCode::IllegalInstruction, mode(), $encoding);
3436
}
3537
36-
X[rd] = X[rs2] & ~X[rs1];
38+
X[xd] = X[xs2] & ~X[xs1];
3739
3840
# SPDX-SnippetBegin
3941
# SPDX-FileCopyrightText: 2017-2025 Contributors to the RISCV Sail Model <https://github.com/riscv/sail-riscv/blob/master/LICENCE>

spec/std/isa/inst_opcode/OP.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
2+
# SPDX-License-Identifier: BSD-3-Clause-Clear
3+
4+
# yaml-language-server: $schema=../../schemas/inst_opcode_schema.json#
5+
6+
$schema: inst_opcode_schema.json#
7+
kind: instruction_opcode
8+
name: OP
9+
10+
data:
11+
display_name: OP
12+
value: 0b0110011

0 commit comments

Comments
 (0)