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
14definitions:
15  - name: PandaAssembly
16    template: |
17      .language PandaAssembly
18  - name: aoobe_p
19    template: |
20      .record panda.ArrayIndexOutOfBoundsException<external>
21  - name: aoobe_j
22    template: |
23      .record panda.ArrayIndexOutOfBoundsException<external>
24  - name: npe_p
25    template: |
26      .record panda.NullPointerException <external>
27  - name: npe_j
28    template: |
29      .record panda.NullPointerException <external>
30
31tests:
32  - file-name: "fstarr.32"
33    isa:
34      title: Store to array
35      description: >
36        Store accumulator content into array slot pointed by index.
37      instructions:
38        - sig: fstarr.32 v1:in:f32[], v2:in:i32
39          acc: in:f32
40          format: [op_v1_4_v2_4]
41          properties: [acc_read, float]
42    commands:
43
44
45      - file-name: "reg_valid"
46        isa:
47          instructions:
48            - sig: fstarr.32 v1:in:f32[], v2:in:i32
49              acc: in:f32
50              format: [op_v1_4_v2_4]
51              properties: [acc_read, float]
52        check-type: empty
53        runner-options: [compile-only]
54        description: Check 'fstarr.32' instruction with valid register numbers.
55        header-template: []
56        code-template: |
57          #
58          .function i32 main() {
59              fstarr.32 %s, %s
60              ldai 0
61              return
62          }
63        cases:
64          - values: [v0, v15]
65          - values: [v15, v0]
66          - values: [v15, v15]
67          - case-template: |
68              #
69              .function i32 f1(f32[] a0, i32 a1) {
70                  fstarr.32 a0, a1   # valid registers
71                  ldai 0
72                  return
73              }
74
75              .function i32 main() {
76                  call.short f1, v1, v2
77                  return
78              }
79
80
81      - file-name: "reg_v_invalid"
82        isa:
83          instructions:
84            - sig: fstarr.32 v1:in:f32[], v2:in:i32
85              acc: in:f32
86              format: [op_v1_4_v2_4]
87              properties: [acc_read, float]
88        runner-options: [compile-failure]
89        description: Check 'fstarr.32' instruction with invalid register numbers.
90        code-template: |
91            #
92                fstarr.32 %s, *s
93        check-type: exit-positive
94        template-cases:
95          - values: [v0]
96            exclude: [v0, v15]
97          - values: [v15]
98            exclude: [v0, v15]
99          - values: [v255]
100          - values: [v256]
101          - values: [v65536]
102          - values: [a0]
103          - values: ['V1']
104          - values: ['null']
105          - values: [0]
106        cases:
107          - values: [v0]
108            id: v0
109          - values: [v15]
110            id: v15
111          - values: [v255]
112          - values: [v256]
113          - values: [v65536]
114          - values: [a0]
115          - values: ['V1']
116          - values: ['null']
117          - values: [0]
118
119
120      - file-name: "reg_a_invalid"
121        isa:
122          instructions:
123            - sig: fstarr.32 v1:in:f32[], v2:in:i32
124              acc: in:f32
125              format: [op_v1_4_v2_4]
126              properties: [acc_read, float]
127        runner-options: [compile-failure]
128        description: Check 'fstarr.32' instruction with invalid register numbers.
129        header-template: []
130        code-template: |
131              #
132              .function void f1(f32[] a0, i32 a1) {
133                  fstarr.32 %s
134                  return.void
135              }
136
137              .function i32 main() {
138                  call.short f1, v1, v2
139        check-type: exit-positive
140        cases:
141          - values:
142            - 'a0, a2'
143          - values:
144            - 'a2, a1'
145
146
147      - file-name: null_pointer_p
148        isa:
149          exceptions:
150            - x_null
151        description: Check 'fstarr.32' behavior when array is null reference.
152        header-template: [npe_p]
153        tags: ['irtoc_ignore']
154        bugid: ['3060']
155        code-template: |
156          .function f32[] get_null() {
157              lda.null
158              return.obj
159          }
160          .function i32 main() {
161              call.short get_null
162              sta.obj v0
163              movi v1, %s
164              fldai 0
165          begin:
166              fstarr.32 v0, v1
167          end:
168              ldai 1 # Should not reach this line
169              return
170
171          catch_NPE:
172              ldai 0 # Expected panda.NullPointerException
173              return
174
175          catch_all:
176              ldai 2 # Unexpected exception, test failed
177              return
178
179          .catch panda.NullPointerException, begin, end, catch_NPE
180          .catchall begin, end, catch_all
181        check-type: none
182        cases:
183          - values: [0]
184            tags: ['tsan']
185          - values: [1]
186          - values: [10]
187          - values: [128]
188          - values: [255]
189          - values: [65535]
190            tags: ['tsan']
191          - values: [0x7FFFFFFF]
192          - values: [0xFFFFFFFF]
193          - values: [0x80000000]
194
195
196      - file-name: null_pointer_j
197        isa:
198          exceptions:
199            - x_null
200        description: Check 'fstarr.32' behavior when array is null reference.
201        header-template: [PandaAssembly, npe_j]
202        tags: ['irtoc_ignore']
203        runner-options: [use-pa]
204        bugid: ['3047', '3060']
205        code-template: |
206          .function f32[] get_null() {
207              lda.null
208              return.obj
209          }
210          .function i32 main() {
211              call.short get_null
212              sta.obj v0
213              movi v1, %s
214              fldai 0
215          begin:
216              fstarr.32 v0, v1
217          end:
218              ldai 1 # Should not reach this line
219              return
220
221          catch_NPE:
222              ldai 0 # Expected panda.NullPointerException
223              return
224
225          catch_all:
226              ldai 2 # Unexpected exception, test failed
227              return
228
229          .catch panda.NullPointerException, begin, end, catch_NPE
230          .catchall begin, end, catch_all
231        check-type: none
232        cases:
233          - values: [0]
234            tags: ['tsan']
235          - values: [1]
236          - values: [10]
237          - values: [128]
238          - values: [255]
239          - values: [65535]
240            tags: ['tsan']
241          - values: [0x7FFFFFFF]
242          - values: [0xFFFFFFFF]
243          - values: [0x80000000]
244
245
246      - file-name: array_out_of_bounds_exception_p
247        isa:
248          exceptions:
249            - x_bounds
250        description: Check 'fstarr.32' behavior when index is out of array bounds.
251        header-template: [aoobe_p, main]
252        tags: ['irtoc_ignore']
253        bugid: ['3060']
254        code-template: |
255          #
256              movi v0, %s
257              newarr v0, v0, f32[]
258              movi v1, %s
259              fldai 0
260          begin:
261              fstarr.32 v0, v1
262          end:
263              ldai 1 # Should not reach this line
264              return
265
266          catch_AOOBE:
267              ldai 0 # Expected panda.ArrayIndexOutOfBoundsException
268              return
269
270          catch_all:
271              ldai 2 # Unexpected exception, test failed
272              return
273
274          .catch panda.ArrayIndexOutOfBoundsException, begin, end, catch_AOOBE
275          .catchall begin, end, catch_all
276        check-type: none
277        cases:
278          - values: [0, 0]
279            tags: ['tsan']
280          - values: [0, 1]
281          - values: [10, -10]
282          - values: [10, 128]
283          - values: [255, 255]
284          - values: [254, 255]
285          - values: [65535, 65535]
286            tags: ['tsan']
287          - values: [65535, 65536]
288          - values: [10, 0xFFFFFFFF]
289          - values: [256, 0xFFFFFFFE]
290          - values: [65536, 0xFFFFFFFD]
291            tags: ['tsan']
292          - values: [0x100000, 0xFFFFFFFC]
293          - values: [10, 0x80000000]
294          - values: [256, 0x80000001]
295          - values: [65536, 0x80000002]
296            tags: ['tsan']
297          - values: [0x100000, 0x80000003]
298
299
300      - file-name: array_out_of_bounds_exception_j
301        isa:
302          exceptions:
303            - x_bounds
304        description: Check 'fstarr.32' behavior when index is out of array bounds.
305        runner-options: [use-pa]
306        header-template: [PandaAssembly, aoobe_j, main]
307        tags: ['irtoc_ignore']
308        bugid: ['3060']
309        code-template: |
310          #
311              movi v0, %s
312              newarr v0, v0, f32[]
313              movi v1, %s
314              fldai 0
315          begin:
316              fstarr.32 v0, v1
317          end:
318              ldai 1 # Should not reach this line
319              return
320
321          catch_AOOBE:
322              ldai 0 # Expected panda.ArrayIndexOutOfBoundsException
323              return
324
325          catch_all:
326              ldai 2 # Unexpected exception, test failed
327              return
328
329          .catch panda.ArrayIndexOutOfBoundsException, begin, end, catch_AOOBE
330          .catchall begin, end, catch_all
331        check-type: none
332        cases:
333          - values: [0, 0]
334            tags: ['tsan']
335          - values: [0, 1]
336          - values: [10, -10]
337          - values: [10, 128]
338          - values: [255, 255]
339          - values: [254, 255]
340          - values: [65535, 65535]
341            tags: ['tsan']
342          - values: [65535, 65536]
343          - values: [10, 0xFFFFFFFF]
344          - values: [256, 0xFFFFFFFE]
345          - values: [65536, 0xFFFFFFFD]
346            tags: ['tsan']
347          - values: [0x100000, 0xFFFFFFFC]
348          - values: [10, 0x80000000]
349          - values: [256, 0x80000001]
350          - values: [65536, 0x80000002]
351            tags: ['tsan']
352          - values: [0x100000, 0x80000003]
353
354
355      - file-name: uninitialized_regs
356        isa:
357          verification:
358            - v1_array_type
359            - v2_i32
360            - acc_type
361        description: Check 'fstarr.32' with uninitialized registers
362        tags: ['verifier']
363        runner-options: ['verifier-failure', 'verifier-config']
364        header-template: []
365        code-template: |
366            #
367            .function i32 main() {
368                %s
369                fstarr.32 v1, v2
370        check-type: exit-positive
371        cases:
372          - values:
373              - |
374                # acc is not initialized
375                    movi v0, 10
376                    newarr v1, v0, f32[]
377                    movi v2, 0
378          - values:
379              - |
380                # v1 is not initialized
381                    movi v2, 0
382                    fldai.64 0
383          - values:
384              - |
385                # v2 is not initialized
386                    movi v0, 10
387                    newarr v1, v0, f32[]
388                    fldai.64 0
389          - values:
390              - |
391                # all regs are not initialized
392
393
394      - file-name: "acceptable_primitive_types_p"
395        isa:
396          verification:
397            - v1_array_type
398        description: Check acceptable array of primitive types for fstarr.32 instruction in Panda Assembly context.
399        runner-options: ['verifier-only', 'verifier-config']
400        tags: ['verifier']
401        bugid: ['3060']
402        header-template: [main]
403        code-template: |
404          #
405              movi v0, 1
406              newarr v1, v0, f32[]
407              movi v2, 0
408              fldai 0
409              fstarr.32 v1, v2
410        check-type: exit-positive
411
412
413      - file-name: "acceptable_primitive_types_j"
414        isa:
415          verification:
416            - v1_array_type
417        description: Check acceptable array of primitive types for fstarr.32 instruction in PandaAssembly context.
418        runner-options: [verifier-only, use-pa, verifier-config]
419        tags: ['verifier', 'pa-verifier']
420        bugid: ['3060', '6886']
421        header-template: [PandaAssembly, main]
422        code-template: |
423          #
424              movi v0, 1
425              newarr v1, v0, f32[]
426              movi v2, 0
427              fldai 0
428              fstarr.32 v1, v2
429        check-type: exit-positive
430
431
432      - file-name: "rejectable_primitive_types_p"
433        isa:
434          verification:
435            - v1_array_type
436        description: Check rejectable array of primitive types for fstarr.32 instruction in Panda Assembly context.
437        runner-options: ['verifier-failure', 'verifier-config']
438        tags: ['verifier']
439        header-template: [main]
440        code-template: |
441          #
442              movi v0, 1
443              newarr v1, v0, %s
444              movi v2, 0
445              fldai 0
446              fstarr.32 v1, v2
447        check-type: exit-positive
448        cases:
449          - values: ['u1[]']
450          - values: ['i8[]']
451          - values: ['u8[]']
452          - values: ['i16[]']
453          - values: ['u16[]']
454          - values: ['i32[]']
455          - values: ['u32[]']
456          - values: ['i64[]']
457          - values: ['u64[]']
458          - values: ['f64[]']
459
460
461      - file-name: "rejectable_primitive_types_j"
462        isa:
463          verification:
464            - v1_array_type
465        description: Check rejectable array of primitive types for fstarr.32 instruction in PandaAssembly context.
466        runner-options: [verifier-failure, use-pa, verifier-config]
467        tags: ['verifier', 'pa-verifier']
468        bugid: ['3293', '5271', '6886']
469        header-template: [PandaAssembly, main]
470        code-template: |
471          #
472              movi v0, 1
473              newarr v1, v0, %s
474              movi v2, 0
475              fldai 0
476              fstarr.32 v1, v2
477        check-type: exit-positive
478        cases:
479          - values: ['u1[]']
480          - values: ['i8[]']
481          - values: ['u8[]']
482          - values: ['i16[]']
483          - values: ['u16[]']
484          - values: ['i32[]']
485          - values: ['u32[]']
486          - values: ['i64[]']
487          - values: ['u64[]']
488          - values: ['f64[]']
489
490
491      - file-name: "arr_type_p"
492        isa:
493          verification:
494            - v1_array_type
495        description: Check 'fstarr.32' with incorrect array type in Panda Assembly context. See also "rejectable_primitive_types" tests.
496        runner-options: ['verifier-failure', 'verifier-config']
497        tags: ['verifier']
498        header-template: []
499        code-template: |
500          #
501          .record A {}
502          .function void A.ctor(A a0) <ctor> {
503              return.void
504          }
505          .record panda.String <external>
506          .record panda.Object <external>
507          .function i32 main() {
508              %s
509              movi v1, 0
510              fldai 0
511              fstarr.32 v0, v1
512        check-type: exit-positive
513        cases:
514          - values:
515              - movi v0, 0
516          - values:
517              - movi.64 v0, 0
518          - values:
519              - fmovi.64 v0, 0
520          - values:
521              - |
522                #
523                    initobj A.ctor
524                    sta.obj v0
525          - values:
526              - |
527                #
528                    movi v0, 1
529                    newarr v0, v0, A[]
530          - values:
531              - |
532                #
533                    lda.type A
534                    sta.obj v0
535          - values:
536              - |
537                #
538                    lda.type A[]
539                    sta.obj v0
540          - values:
541              - |
542                #
543                    lda.type panda.String
544                    sta.obj v0
545          - values:
546              - |
547                #
548                    lda.type panda.String[]
549                    sta.obj v0
550          - values:
551              - |
552                #
553                    lda.type panda.Object
554                    sta.obj v0
555          - values:
556              - |
557                #
558                    lda.type panda.Object[]
559                    sta.obj v0
560          - values:
561              - |
562                #
563                    lda.str "string"
564                    sta.obj v0
565          - values:
566              - |
567                #
568                    movi v0, 1
569                    newarr v0, v0, panda.Object[]
570          - values:
571              - |
572                #
573                    movi v0, 1
574                    newarr v0, v0, panda.String[]
575
576
577      - file-name: "arr_type_j"
578        isa:
579          verification:
580            - v1_array_type
581        description: Check 'fstarr.32' with incorrect array type in PandaAssembly context. See also "rejectable_primitive_types" tests.
582        runner-options: [verifier-failure, use-pa, verifier-config]
583        tags: ['verifier', 'pa-verifier']
584        bugid: ['3293', '5271', '6886']
585        header-template: [PandaAssembly]
586        code-template: |
587          #
588          .record A {}
589          .function void A.ctor(A a0) <ctor> {
590              return.void
591          }
592          .record panda.Object <external>
593          .function void panda.Object.ctor(panda.Object a0) <external,ctor>
594          .function i32 main() {
595              %s
596              movi v1, 0
597              fldai 0
598              fstarr.32 v0, v1
599        check-type: exit-positive
600        cases:
601          - values:
602              - movi v0, 0
603          - values:
604              - movi.64 v0, 0
605          - values:
606              - fmovi.64 v0, 0
607          - values:
608              - |
609                #
610                    initobj A.ctor
611                    sta.obj v0
612          - values:
613              - |
614                #
615                    movi v0, 1
616                    newarr v0, v0, A[]
617          - values:
618              - |
619                #
620                    initobj panda.Object.ctor
621                    sta.obj v0
622          - values:
623              - |
624                #
625                    movi v0, 1
626                    newarr v0, v0, panda.Object[]
627          - values:
628              - |
629                #
630                    lda.type A
631                    sta.obj v0
632          - values:
633              - |
634                #
635                    lda.type A[]
636                    sta.obj v0
637          - values:
638              - |
639                #
640                    lda.type panda.Object
641                    sta.obj v0
642          - values:
643              - |
644                #
645                    lda.type panda.Object[]
646                    sta.obj v0
647          - values:
648              - |
649                #
650                    lda.str "string"
651                    sta.obj v0
652
653
654      - file-name: "index_type_p"
655        isa:
656          verification:
657            - v2_i32
658        description: Check 'fstarr.32' with incorrect array index type in Panda Assembly context.
659        runner-options: ['verifier-failure', 'verifier-config']
660        tags: ['verifier']
661        header-template: []
662        code-template: |
663          #
664          .record A {}
665          .function void A.ctor(A a0) <ctor> {
666              return.void
667          }
668          .record panda.String <external>
669          .record panda.Object <external>
670          .function i32 main() {
671              movi v0, 1
672              newarr v1, v0, *s
673              %s
674              fldai 0
675              fstarr.32 v1, v2
676        check-type: exit-positive
677        cases:
678          - values: ['f32[]']
679        template-cases:
680          - values:
681              - mov.null v2
682          - values:
683              - movi.64 v2, 0
684          - values:
685              - fmovi v2, 0
686          - values:
687              - fmovi.64 v2, 0
688          - values:
689              - |
690                #
691                    initobj A.ctor
692                    sta.obj v1
693          - values:
694              - |
695                #
696                    movi v0, 1
697                    newarr v2, v0, A[]
698          - values:
699              - |
700                #
701                    lda.type A
702                    sta.obj v2
703          - values:
704              - |
705                #
706                    lda.type A[]
707                    sta.obj v2
708          - values:
709              - |
710                #
711                    lda.type panda.String
712                    sta.obj v2
713          - values:
714              - |
715                #
716                    lda.type panda.String[]
717                    sta.obj v2
718          - values:
719              - |
720                #
721                    lda.type panda.Object
722                    sta.obj v2
723          - values:
724              - |
725                #
726                    lda.type panda.Object[]
727                    sta.obj v2
728          - values:
729              - |
730                #
731                    lda.str "string"
732                    sta.obj v2
733          - values:
734              - |
735                #
736                    movi v0, 1
737                    newarr v2, v0, panda.Object[]
738          - values:
739              - |
740                #
741                    movi v0, 1
742                    newarr v2, v0, panda.String[]
743
744
745      - file-name: "index_type_j"
746        isa:
747          verification:
748            - v2_i32
749        description: Check 'fstarr.32' with incorrect array index type in PandaAssembly context.
750        runner-options: [verifier-failure, use-pa, verifier-config]
751        tags: ['verifier', 'pa-verifier']
752        bugid: ['3293', '5271', '6886']
753        header-template: [PandaAssembly]
754        code-template: |
755          #
756          .record A {}
757          .function void A.ctor(A a0) <ctor> {
758              return.void
759          }
760          .record panda.Object <external>
761          .function void panda.Object.ctor(panda.Object a0) <external,ctor>
762          .function i32 main() {
763              movi v0, 1
764              newarr v1, v0, *s
765              %s
766              fldai 0
767              fstarr.32 v1, v2
768        check-type: exit-positive
769        cases:
770          - values: ['f32[]']
771        template-cases:
772          - values:
773              - mov.null v2
774          - values:
775              - movi.64 v2, 0
776          - values:
777              - fmovi v2, 0
778          - values:
779              - fmovi.64 v2, 0
780          - values:
781              - |
782                #
783                    initobj A.ctor
784                    sta.obj v2
785          - values:
786              - |
787                #
788                    movi v0, 1
789                    newarr v2, v0, A[]
790          - values:
791              - |
792                #
793                    initobj panda.Object.ctor
794                    sta.obj v2
795          - values:
796              - |
797                #
798                    movi v0, 1
799                    newarr v2, v0, panda.Object[]
800          - values:
801              - |
802                #
803                    lda.type A
804                    sta.obj v2
805          - values:
806              - |
807                #
808                    lda.type A[]
809                    sta.obj v2
810          - values:
811              - |
812                #
813                    lda.type panda.Object
814                    sta.obj v2
815          - values:
816              - |
817                #
818                    lda.type panda.Object[]
819                    sta.obj v2
820          - values:
821              - |
822                #
823                    lda.str "string"
824                    sta.obj v2
825
826
827      - file-name: "acc_type_p"
828        isa:
829          verification:
830            - acc_type
831        description: Check 'fstarr.32' with incorrect accumulator type in Panda Assembly context.
832        runner-options: ['verifier-failure', 'verifier-config']
833        tags: ['verifier']
834        header-template: []
835        code-template: |
836          #
837          .record A {}
838          .function void A.ctor(A a0) <ctor> {
839              return.void
840          }
841          .record panda.String <external>
842          .record panda.Object <external>
843          .function i32 main() {
844              movi v0, 1
845              newarr v1, v0, *s
846              movi v2, 0
847              %s
848              fstarr.32 v1, v2
849        check-type: exit-positive
850        cases:
851          - values: ['f32[]']
852        template-cases:
853          - values:
854              - lda.null
855          - values:
856              - ldai.64 0
857          - values:
858              - ldai 0
859          - values:
860              - fldai.64 0
861          - values:
862              - |
863                #
864                    initobj A.ctor
865          - values:
866              - |
867                #
868                    lda.type A
869          - values:
870              - |
871                #
872                    lda.type panda.String
873          - values:
874              - |
875                #
876                    lda.type panda.String[]
877          - values:
878              - |
879                #
880                    lda.type panda.Object
881          - values:
882              - |
883                #
884                    lda.type panda.Object[]
885          - values:
886              - |
887                #
888                    lda.str "string"
889          - values:
890              - |
891                #
892                    movi v0, 1
893                    newarr v0, v0, panda.Object[]
894                    lda.obj v0
895          - values:
896              - |
897                #
898                    movi v0, 1
899                    newarr v0, v0, panda.String[]
900                    lda.obj v0
901
902      - file-name: "acc_type_j"
903        isa:
904          verification:
905            - acc_type
906        description: Check 'fstarr.32' with incorrect accumulator type in PandaAssembly context.
907        runner-options: [verifier-failure, use-pa, verifier-config]
908        tags: ['verifier', 'pa-verifier']
909        bugid: ['3293', '5271', '6886']
910        header-template: [PandaAssembly]
911        code-template: |
912          #
913          .record A {}
914          .function void A.ctor(A a0) <ctor> {
915              return.void
916          }
917          .record panda.Object <external>
918          .function void panda.Object.ctor(panda.Object a0) <external,ctor>
919          .function i32 main() {
920              movi v0, 1
921              newarr v1, v0, *s
922              movi v2, 0
923              %s
924              fstarr.32 v1, v2
925        check-type: exit-positive
926        cases:
927          - values: ['f32[]']
928        template-cases:
929          - values:
930              - lda.null
931          - values:
932              - ldai.64 0
933          - values:
934              - ldai 0
935          - values:
936              - fldai.64 0
937          - values:
938              - |
939                #
940                    initobj A.ctor
941          - values:
942              - |
943                #
944                    initobj panda.Object.ctor
945          - values:
946              - |
947                #
948                    lda.type A
949          - values:
950              - |
951                #
952                    lda.type A[]
953          - values:
954              - |
955                #
956                    lda.type panda.Object
957          - values:
958              - |
959                #
960                    lda.type panda.Object[]
961          - values:
962              - |
963                #
964                    lda.str "string"
965          - values:
966              - |
967                #
968                    movi v0, 1
969                    newarr v0, v0, panda.Object[]
970                    lda.obj v0
971          - values:
972              - |
973                #
974                    movi v0, 1
975                    newarr v0, v0, A[]
976                    lda.obj v0
977
978
979      - file-name: "mult_regs_types_p"
980        isa:
981          verification:
982            - v1_array_type
983            - v2_i32
984            - acc_type
985        description: Check 'fstarr.32' with multiple incorrect register types in Panda Assembly context.
986        runner-options: ['verifier-failure', 'verifier-config']
987        tags: ['verifier']
988        header-template: []
989        code-template: |
990          #
991          .record A {}
992          .function void A.ctor(A a0) <ctor> {
993              return.void
994          }
995          .record panda.String <external>
996          .record panda.Object <external>
997          .function void panda.Object.ctor(panda.Object a0) <external,ctor>
998          .function i32 main() {
999              %s
1000              fstarr.32 v1, v2
1001        check-type: exit-positive
1002        cases:
1003          - values:
1004              - |
1005                # all registers invalid
1006                    initobj panda.Object.ctor
1007                    sta.obj v1
1008                    movi.64 v2, 0
1009                    lda.str "test string"
1010          - values:
1011              - |
1012                # v1 and v2 invalid
1013                    lda.str "test string"
1014                    sta.obj v1
1015                    fmovi.64 v2, 1
1016                    ldai 0
1017          - values:
1018              - |
1019                # v1 and acc invalid
1020                    lda.type panda.Object
1021                    sta.obj v1
1022                    movi v2, 0
1023                    lda.str "test string"
1024          - values:
1025              - |
1026                # v2 and acc invalid
1027                    movi v0, 1
1028                    newarr v1, v0, f32[]
1029                    mov.obj v2, v1
1030                    initobj A.ctor
1031
1032
1033      - file-name: "mult_regs_types_j"
1034        isa:
1035          verification:
1036            - v1_array_type
1037            - v2_i32
1038            - acc_type
1039        description: Check 'fstarr.32' with multiple incorrect register types in PandaAssembly context.
1040        runner-options: [verifier-failure, use-pa, verifier-config]
1041        tags: ['verifier', 'pa-verifier']
1042        bugid: ['3293', '5271', '6886']
1043        header-template: [PandaAssembly]
1044        code-template: |
1045          #
1046          .record A {}
1047          .function void A.ctor(A a0) <ctor> {
1048              return.void
1049          }
1050          .record panda.Object <external>
1051          .function void panda.Object.ctor(panda.Object a0) <external,ctor>
1052          .function i32 main() {
1053              %s
1054              fstarr.32 v1, v2
1055        check-type: exit-positive
1056        cases:
1057          - values:
1058              - |
1059                # all registers invalid
1060                    initobj panda.Object.ctor
1061                    sta.obj v1
1062                    movi.64 v2, 0
1063                    lda.str "test string"
1064          - values:
1065              - |
1066                # v1 and v2 invalid
1067                    lda.str "test string"
1068                    sta.obj v1
1069                    fmovi.64 v2, 1
1070                    ldai 0
1071          - values:
1072              - |
1073                # v1 and acc invalid
1074                    lda.type panda.Object
1075                    sta.obj v1
1076                    movi v2, 0
1077                    lda.str "test string"
1078          - values:
1079              - |
1080                # v2 and acc invalid
1081                    movi v0, 1
1082                    newarr v1, v0, f32[]
1083                    mov.obj v2, v1
1084                    initobj A.ctor
1085
1086
1087      - file-name: "store_arr_p"
1088        isa:
1089          instructions:
1090            - sig: fstarr.32 v1:in:f32[], v2:in:i32
1091              acc: in:f32
1092              format: [op_v1_4_v2_4]
1093              properties: [acc_read, float]
1094        description: Check fstarr.32 stores items to array of different size and type in Panda Assembly context.
1095        tags: ['irtoc_ignore']
1096        code-template: |
1097          #
1098              movi v0, *s
1099              newarr v1, v0, %s
1100              movi v2, *s
1101              fldai 1234567890.0
1102              fstarr.32 v1, v2
1103        check-type: exit-positive
1104        template-cases:
1105          - values: ['f32[]']
1106        cases:
1107          - values: ['1', '0']
1108          - values: ['255', '254']
1109            tags: ['tsan']
1110          - values: ['65536', '65535']
1111
1112
1113      - file-name: "store_arr_j"
1114        isa:
1115          instructions:
1116            - sig: fstarr.32 v1:in:f32[], v2:in:i32
1117              acc: in:f32
1118              format: [op_v1_4_v2_4]
1119              properties: [acc_read, float]
1120        description: Check fstarr.32 stores items to array of different size and type in PandaAssembly context.
1121        tags: ['irtoc_ignore']
1122        runner-options: ['use-pa']
1123        header-template: [PandaAssembly, main]
1124        code-template: |
1125          #
1126              movi v0, *s
1127              newarr v1, v0, %s
1128              movi v2, *s
1129              fldai 1234567890.0
1130              fstarr.32 v1, v2
1131        check-type: exit-positive
1132        template-cases:
1133          - values: ['f32[]']
1134        cases:
1135          - values: ['1', '0']
1136          - values: ['255', '254']
1137          - values: ['65536', '65535']
1138            tags: ['tsan']
1139
1140
1141      - file-name: "store_all_elements"
1142        isa:
1143          description: >
1144            Store accumulator content into array slot pointed by index.
1145        description: Check fstarr.32 stores correct items into array of primitives.
1146        tags: ['irtoc_ignore']
1147        header-template: []
1148        code-template: |
1149            .function i32 main() {
1150                movi v7, *s         # v7 is array size
1151                newarr v1, v7, %s          # v1 - testable array
1152
1153                movi v2, 0          # array index
1154            fill_array:
1155                lda v2
1156                i32tof32
1157                fstarr.32 v1, v2      # v1[v2] = acc
1158                inci v2, 1            # v2 = v2 + 1
1159                lda v2
1160                jne v7, fill_array
1161                inci v2, -1
1162            check_array:
1163                lda v2
1164                i32tof32
1165                sta v3            # value to compare with
1166                lda v2
1167                fldarr.32 v1
1168                fcmpg v3
1169                jeqz ok
1170                ldai 2
1171                return
1172            ok:
1173                inci v2, -1
1174                lda v2
1175                jgez check_array
1176        check-type: exit-positive
1177        template-cases:
1178          - values:
1179            - f32[]
1180            tags: ['tsan']
1181        cases:
1182          - values: [10000]
1183