• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021-2022 Huawei Device Co., Ltd.
2# Licensed under the Apache License, Version 2.0 (the "License");
3# you may not use this file except in compliance with the License.
4# You may obtain a copy of the License at
5#
6# http://www.apache.org/licenses/LICENSE-2.0
7#
8# Unless required by applicable law or agreed to in writing, software
9# distributed under the License is distributed on an "AS IS" BASIS,
10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11# See the License for the specific language governing permissions and
12# limitations under the License.
13---
14
15groups:
16  - title: Conversions between integer and floating point types
17    description: Conversion from floating-point types to integer one obeys the following
18      rules
19
20  - title: Load accumulator from string constant pool
21    description: In dynamically-typed language context load string as 'any' value.
22
23  - title: Static call
24    description: In dynamically-typed language context accept 'any' values in source
25      registers.
26
27  - title: Create and initialize new constant array
28    exceptions:
29      - x_oom
30
31  - title: Load accumulator from type constant pool
32    exceptions:
33      - x_link
34
35  - title: Dynamic move register-to-register
36    description: >
37      Move 'any' values between registers
38    verification:
39      - valid_in_dynamic_context
40    exceptions:
41      - x_none
42    instructions:
43      - sig: mov.dyn v1:out:any, v2:in:any
44        acc: none
45        format: [op_v1_8_v2_8, op_v1_16_v2_16]
46        opcode_idx: [0xa0, 0xa1]
47
48  - title: Dynamic load accumulator from register
49    description: >
50      Move 'any' value from register to accumulator
51    verification:
52      - valid_in_dynamic_context
53    exceptions:
54      - x_none
55    instructions:
56      - sig: lda.dyn v:in:any
57        acc: out:any
58        format: [op_v_8]
59        opcode_idx: [0xa2]
60
61  - title: Dynamic store accumulator
62    description: >
63      Move 'any' value from accumulator to register
64    verification:
65      - valid_in_dynamic_context
66    exceptions:
67      - x_none
68    instructions:
69      - sig: sta.dyn v:out:any
70        acc: in:any
71        format: [op_v_8]
72        opcode_idx: [0xa3]
73
74  - title: Dynamic load accumulator from immediate
75    description: >
76      Move immediate as 'any' value to accumulator
77    verification:
78      - valid_in_dynamic_context
79    exceptions:
80      - x_none
81    instructions:
82      - sig: ldai.dyn imm:i32
83        acc: out:any
84        format: [op_imm_32]
85        opcode_idx: [0xa4]
86      - sig: fldai.dyn imm:f64
87        acc: out:any
88        format: [op_imm_64]
89        opcode_idx: [0xa5]
90        properties: [float, dynamic]
91
92  - title: Dynamic return from method
93    description: >
94      Return 'any' value in accumulator from method to its caller
95    verification:
96      - valid_in_dynamic_context
97    exceptions:
98      - x_none
99    instructions:
100      - sig: return.dyn
101        acc: in:any
102        format: [op_none]
103        opcode_idx: [0xa6]
104
105  - title: Dynamic indirect call
106    description: >
107      Call 'any' value that represents a function, i.e. create a new frame, pass values of arguments
108      and continue execution from the first instruction of a method.
109      Callee should treat accumulator value as undefined and cannot use it until accumulator
110      definition in the new frame.
111      The callee must always return the result in the accumulator.
112      First source register contains a function 'any' value, other imm source registers contain
113      arguments of a function.
114      Non-range instructions can be used to pass up to 4 arguments (unused register slot values will
115      be discarded and corresponding registers will not be passed to the callee).
116      For methods with more arguments range kind of instruction is to be used, which takes the needed number
117      of arguments starting from 'v' register.
118    verification:
119      - valid_in_dynamic_context
120    exceptions:
121      - x_call
122    instructions:
123      - sig: calli.dyn.short imm, v1:in:any, v2:in:any, v3:in:any
124        acc: out:any
125        format: [op_imm_4_v1_4_v2_4_v3_4]
126        opcode_idx: [0xa7]
127      - sig: calli.dyn imm, v1:in:any, v2:in:any, v3:in:any, v4:in:any, v5:in:any
128        acc: out:any
129        format: [op_imm_4_v1_4_v2_4_v3_4_v4_4_v5_4]
130        opcode_idx: [0xa8]
131      - sig: calli.dyn.range imm, v:in:any
132        acc: out:any
133        format: [op_imm_16_v_16]
134        opcode_idx: [0xa9]
135