Skip to content

Commit 885b006

Browse files
committed
bugfixes
1 parent 97b68fe commit 885b006

File tree

14 files changed

+27
-27
lines changed

14 files changed

+27
-27
lines changed

src/sem/FarRet.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ A normal return from a **far** call. Will pop up current callframe, return
5353
unspent ergs to the caller, and continue execution from the saved return
5454
address (from where the call had taken place). The register `args`
5555
describes a span of memory passed to the external caller. """,
56-
56+
legacy = RET_LEGACY,
5757
semantic = r"""
5858
1. Fetch the value from register `args` and decode the value of type [%fwd_memory]:
5959

src/sem/FarRevert.v

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Section FarRevertDefinition.
4242

4343
Inductive step_farrevert: instruction -> smallstep :=
4444
(** {{{
45-
ins = Instruction("OpRevert", "revert", in1 = In.Reg)
45+
ins = Instruction("OpRevert", "rev", in1 = In.Reg)
4646
descr = InstructionDoc(
4747
ins=ins,
4848
add_to_title = "(case of far revert)",
@@ -53,7 +53,7 @@ An abnormal return from a far call. Will pop up current callframe, give back
5353
unspent ergs and execute a currently active exception handler. The input register
5454
describes a slice of memory passed to the external caller.
5555
""",
56-
legacy="`ret.revert in1`",
56+
legacy = REVERT_LEGACY,
5757
semantic = r"""
5858
Restores storage to the state before external call.
5959
1. Let $E$ be the address of the [%active_exception_handler].

src/sem/Load.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Section LoadDefinition.
99
Generalizable Variables cs flags regs mem.
1010
Inductive step_load: instruction -> tsmallstep :=
1111
(** {{{
12-
ins = Instruction("OpLoad", "ldvl", in1 = In.RegImm, out1=Out.Reg, modifiers = [Modifier.DataPageType])
12+
ins = Instruction("OpLoad", "ldm", in1 = In.RegImm, out1=Out.Reg, modifiers = [Modifier.DataPageType])
1313
descr = InstructionDoc(
1414
ins=ins,
1515
legacy = """

src/sem/LoadInc.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Section LoadIncDefinition.
88
Generalizable Variables cs flags regs mem.
99
Inductive step_load_inc : instruction -> tsmallstep :=
1010
(** {{{
11-
ins=Instruction("OpLoadInc", "ldvli", in1 = In.RegImm, out1=Out.Reg, out2=Out.Reg, modifiers = [Modifier.DataPageType])
11+
ins=Instruction("OpLoadInc", "ldmi", in1 = In.RegImm, out1=Out.Reg, out2=Out.Reg, modifiers = [Modifier.DataPageType])
1212
descr = InstructionDoc(ins=ins,
1313
legacy = """
1414
- `uma.inc.heap_read in1, out1, out2` aliased as `ld.1.inc in1, out1, out2`

src/sem/LoadPtr.v

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Section LoadPtrDefinition.
1010
(** {{{!
1111
describe(InstructionDoc(
1212
13-
ins=Instruction("OpLoadPtr", "ldp", in1 = In.RegImm, out1=Out.Reg),
13+
ins=Instruction("OpLoadPtr", "ldp", in1 = In.Reg, out1=Out.Reg),
1414
legacy = """
1515
- `uma.fat_ptr_read in1, out` aliased as `ld in1, out`
1616
""",
@@ -44,7 +44,7 @@ semantic = r"""
4444
4. Store the word to `res`.
4545
""",
4646
47-
usage = """
47+
usage = f"""
4848
- Read data from a read-only slice returned from a far call, or passed to a far call.
4949
- One of few instructions that accept only reg or imm operand but do not have
5050
full addressing mode, therefore can't e.g. address stack. The full list is: {INSNS_USE_REGIMM}.

src/sem/NearCall.v

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ Section NearCallDefinition.
88
(** {{{!
99
describe(InstructionDoc(
1010
11-
ins=Instruction("OpNearCall", "call", in1 = In.Reg, in2 = In.Reg, imm1 = "dest",imm2="handler"),
11+
ins=Instruction("OpNearCall", "call", in1 = In.Reg, in2 = None, imm1 = "dest",imm2="handler"),
1212
1313
syntax_override = [
14-
r"- `call abi_reg, callee_address, exception_handler` as a fully expanded form.",
14+
r"`call abi_reg, callee_address, exception_handler` as a fully expanded form.",
1515
1616
r"""`call abi_reg, callee_address`
1717
+ The assembler expands this variation to

src/sem/NearRet.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ in1 = In.Reg,
1515
kernelOnly = False,
1616
notStatic = False),
1717
18-
legacy = "`ret.ok` aliased as `ret`",
18+
legacy = RET_LEGACY,
1919
2020
preamble = NEAR_FAR_RET_LIKE_PREAMBLE('near return', 'NearRetDefinition', 'far return', 'FarRetDefinition'),
2121
summary = """

src/sem/NearRetTo.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Section NearRetToDefinition.
99
describe(InstructionDoc(
1010
1111
ins = Instruction("OpNearRetTo", "retl", imm1="label"),
12-
legacy = "`ret.ok.to_label label` ",
12+
legacy = "`ret.ok.to_label label`",
1313
summary = """
1414
A normal return from a **near** call. Will pop up current callframe, give back
1515
unspent ergs and continue execution from an explicitly provided label.

src/sem/NearRevert.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Section NearRevertDefinition.
1010
describe(InstructionDoc(
1111
ins=Instruction("OpRevert", "rev", in1 = In.Reg),
1212
add_to_title = "(case of near revert)",
13-
legacy = "`ret.revert` aliased as `revert`",
13+
legacy = REVERT_LEGACY,
1414
preamble = NEAR_FAR_RET_LIKE_PREAMBLE('near revert', 'NearRevertDefinition', 'far revert', 'FarRevertDefinition'),
1515
1616
summary = """

src/sem/PrecompileCall.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Section PrecompileCallDefinition.
1212
describe(InstructionDoc(
1313
1414
ins=Instruction(
15-
"OpPrecompile",
15+
"OpPrecompileCall",
1616
"callp",
1717
in1 = In.Reg,
1818
in2 = In.Reg,

src/sem/SLoad.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ semantic = r"""
2222
2. Store the value to `dest`.
2323
""",
2424
usage = """
25-
- Only [%OpSLoad] is capable of reading data from transient storage.
25+
- Only [%OpSLoad] is capable of reading data from storage.
2626
"""
2727
))
2828
}}}

src/sem/SStore.v

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Section SStoreDefinition.
1414
(** {{{!
1515
describe(InstructionDoc(
1616
17-
ins=Instruction(abstract_name = "OpTransientStore", mnemonic = "stt", in1= In.Reg, in2 = In.Reg),
17+
ins=Instruction(abstract_name = "OpSStore", mnemonic = "sts", in1= In.Reg, in2 = In.Reg),
1818
1919
legacy=" `log.swrite in1, in2` aliased as `sstore in1, in2` ",
2020
@@ -28,9 +28,8 @@ semantic = r"""
2828
""",
2929
3030
usage = """
31-
- Only [%OpTransientStore] is capable to write data to storage.
32-
- [%OpTransientStore] is rolled back if the current frame ended by [%OpPanic] or [%OpRevert].
33-
- Transient storage is reset after the transaction ends.
31+
- Only [%OpSStore] is capable to write data to storage.
32+
- [%OpSStore] is rolled back if the current frame ended by [%OpPanic] or [%OpRevert].
3433
""",
3534
affectedState = """
3635
- Depot of the current shard.

src/sem/SpAdd.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ ins=Instruction(abstract_name = "OpSpAdd", mnemonic = "incsp", in1 = In.Reg, in2
1313
1414
syntax_override = ["`incsp reg+imm`", "`incsp reg`", "`incsp imm`"],
1515
16-
legacy = r"`nop r0, r0, stack+=[reg+imm]`",
16+
legacy = r"`nop stack+=[reg+imm]`",
1717
summary = " Add `(reg + imm)` to SP.",
1818
1919
semantic = r"""

src/sem/_preprocess_header.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,22 @@
99
INSNS_USE_REGIMM = "[%OpLoad], [%OpLoadInc], [%OpStore], [%OpStoreInc], [%OpLoadPointer], [%OpLoadPointerInc], [%OpStaticReadInc], [%OpStaticRead], [%OpStaticWrite], [%OpStaticWriteInc]"
1010

1111

12-
USES_REGIMM = r"""
12+
USES_REGIMM = f"""
1313
- One of few instructions that accept only reg or imm operand but do not have
1414
full addressing mode, therefore can't e.g. address stack. The full list is:
1515
{INSNS_USE_REGIMM}.
1616
"""
1717

18-
INSNS_USE_REGIMM = "[%OpLoad], [%OpLoadInc], [%OpStore], [%OpStoreInc], [%OpLoadPointer], [%OpLoadPointerInc], [%OpStaticReadInc], [%OpStaticRead], [%OpStaticWrite], [%OpStaticWriteInc]"
19-
18+
RET_LEGACY= ["`ret in1`",
19+
"`ret` is an alias for `ret r1`",
20+
"`ret.ok in1` aliased as `ret in1`"
21+
]
2022

21-
USES_REGIMM = r"""
22-
- One of few instructions that accept only reg or imm operand but do not have
23-
full addressing mode, therefore can't e.g. address stack. The full list is:
24-
{INSNS_USE_REGIMM}.
25-
"""
2623

24+
REVERT_LEGACY= [
25+
"`revert` is an alias for `revert r1`",
26+
"`ret.revert in1`"
27+
]
2728

2829
def heap_var_op_syntax(ins):
2930
return syntax(ins) + [

0 commit comments

Comments
 (0)