gem5 v24.0.0.0
Loading...
Searching...
No Matches
sve.cc
Go to the documentation of this file.
1/*
2 * Copyright (c) 2017-2019 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software
9 * licensed hereunder. You may use the software subject to the license
10 * terms below provided that you ensure that this notice is replicated
11 * unmodified and in its entirety in all distributions of the software,
12 * modified or unmodified, in source code or in binary form.
13 *
14 * Redistribution and use in source and binary forms, with or without
15 * modification, are permitted provided that the following conditions are
16 * met: redistributions of source code must retain the above copyright
17 * notice, this list of conditions and the following disclaimer;
18 * redistributions in binary form must reproduce the above copyright
19 * notice, this list of conditions and the following disclaimer in the
20 * documentation and/or other materials provided with the distribution;
21 * neither the name of the copyright holders nor the names of its
22 * contributors may be used to endorse or promote products derived from
23 * this software without specific prior written permission.
24 *
25 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
26 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
27 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
28 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
29 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
30 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
31 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
32 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
33 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
34 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
35 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 */
37
38// TODO: add support for suffixes of register specifiers in disasm strings.
39
40#include "arch/arm/insts/sve.hh"
41
42namespace gem5
43{
44
45namespace ArmISA {
46
47const char*
49{
50 switch (pt) {
52 return "m";
54 return "z";
55 default:
56 return "";
57 }
58}
59
60std::string
62 const loader::SymbolTable *symtab) const
63{
64 std::stringstream ss;
65 printMnemonic(ss, "", false);
67 ccprintf(ss, ", ");
69 ccprintf(ss, ", ");
71 return ss.str();
72}
73
74std::string
76 Addr pc, const loader::SymbolTable *symtab) const
77{
78 std::stringstream ss;
79 printMnemonic(ss, "", false);
80 if (destIsVec) {
81 printVecReg(ss, dest, true);
82 } else {
84 }
85 ccprintf(ss, ", ");
86 uint8_t opWidth = 64;
88 ccprintf(ss, ", ");
89 if (srcIs32b)
90 opWidth = 32;
91 printIntReg(ss, dest, opWidth);
92 return ss.str();
93}
94
95std::string
97 Addr pc, const loader::SymbolTable *symtab) const
98{
99 std::stringstream ss;
100 printMnemonic(ss, "", false);
101 printVecReg(ss, dest, true);
102 ccprintf(ss, ", #%d, #%d", imm1, imm2);
103 return ss.str();
104}
105
106std::string
108 Addr pc, const loader::SymbolTable *symtab) const
109{
110 std::stringstream ss;
111 printMnemonic(ss, "", false);
112 printVecReg(ss, dest, true);
113 ccprintf(ss, ", #%d, ", imm1);
115 return ss.str();
116}
117
118std::string
120 Addr pc, const loader::SymbolTable *symtab) const
121{
122 std::stringstream ss;
123 printMnemonic(ss, "", false);
124 printVecReg(ss, dest, true);
125 ccprintf(ss, ", ");
127 ccprintf(ss, ", #%d", imm2);
128 return ss.str();
129}
130
131std::string
133 Addr pc, const loader::SymbolTable *symtab) const
134{
135 std::stringstream ss;
136 printMnemonic(ss, "", false);
137 printVecReg(ss, dest, true);
138 ccprintf(ss, ", ");
140 ccprintf(ss, ", ");
142 return ss.str();
143}
144
145std::string
147 Addr pc, const loader::SymbolTable *symtab) const
148{
149 std::stringstream ss;
150 printMnemonic(ss, "", false);
152 ccprintf(ss, ", ");
153 uint8_t opWidth;
154 if (srcIs32b)
155 opWidth = 32;
156 else
157 opWidth = 64;
158 printIntReg(ss, op1, opWidth);
159 ccprintf(ss, ", ");
160 printIntReg(ss, op2, opWidth);
161 return ss.str();
162}
163
164std::string
166 const loader::SymbolTable *symtab) const
167{
168 std::stringstream ss;
169 printMnemonic(ss, "", false);
171 ss << ", ";
173 ss << ", ";
175 ss << ", ";
177 ss << ", ";
178 ccprintf(ss, "#%d", imm);
179 return ss.str();
180}
181
182std::string
184 Addr pc, const loader::SymbolTable *symtab) const
185{
186 std::stringstream ss;
187 printMnemonic(ss, "", false);
189 ccprintf(ss, ", ");
191 return ss.str();
192}
193
194std::string
196 Addr pc, const loader::SymbolTable *symtab) const
197{
198 std::stringstream ss;
199 printMnemonic(ss, "", false);
200 printVecReg(ss, dest, true);
201 ccprintf(ss, ", ");
203 ccprintf(ss, "/m, ");
204 printVecReg(ss, op1, true);
205 return ss.str();
206}
207
208std::string
210 Addr pc, const loader::SymbolTable *symtab) const
211{
212 std::stringstream ss;
213 printMnemonic(ss, "", false);
214 printVecReg(ss, dest, true);
215 ccprintf(ss, ", ");
216 printVecReg(ss, op1, true);
217 return ss.str();
218}
219
220std::string
222 Addr pc, const loader::SymbolTable *symtab) const
223{
224 std::stringstream ss;
225 printMnemonic(ss, "", false);
226 printVecReg(ss, dest, true);
227 ccprintf(ss, ", #");
228 ss << imm;
229 return ss.str();
230}
231
232std::string
234 Addr pc, const loader::SymbolTable *symtab) const
235{
236 std::stringstream ss;
237 printMnemonic(ss, "", false);
238 printVecReg(ss, dest, true);
239 ccprintf(ss, ", ");
241 ccprintf(ss, (isMerging ? "/m" : "/z"));
242 ccprintf(ss, ", #");
243 ss << imm;
244 return ss.str();
245}
246
247std::string
249 Addr pc, const loader::SymbolTable *symtab) const
250{
251 std::stringstream ss;
252 printMnemonic(ss, "", false);
253 printVecReg(ss, dest, true);
254 ccprintf(ss, ", ");
256 ccprintf(ss, ", #");
257 ss << imm;
258 return ss.str();
259}
260
261std::string
263 Addr pc, const loader::SymbolTable *symtab) const
264{
265 std::stringstream ss;
266 printMnemonic(ss, "", false);
267 printVecReg(ss, dest, true);
268 ccprintf(ss, ", ");
270 ccprintf(ss, "/m, ");
271 printVecReg(ss, dest, true);
272 ccprintf(ss, ", #");
273 ss << imm;
274 return ss.str();
275}
276
277std::string
279 Addr pc, const loader::SymbolTable *symtab) const
280{
281 std::stringstream ss;
282 printMnemonic(ss, "", false);
283 printVecReg(ss, dest, true);
284 ccprintf(ss, ", ");
285 printVecReg(ss, dest, true);
286 ccprintf(ss, ", #");
287 ss << imm;
288 return ss.str();
289}
290
291std::string
293 Addr pc, const loader::SymbolTable *symtab) const
294{
295 std::stringstream ss;
296 printMnemonic(ss, "", false);
297 printVecReg(ss, dest, true);
298 ccprintf(ss, ", ");
300 ccprintf(ss, "/m, ");
301 printVecReg(ss, dest, true);
302 ccprintf(ss, ", ");
303 printVecReg(ss, op2, true);
304 return ss.str();
305}
306
307std::string
309 Addr pc, const loader::SymbolTable *symtab) const
310{
311 std::stringstream ss;
312 printMnemonic(ss, "", false);
313 printVecReg(ss, dest, true);
314 ccprintf(ss, ", ");
318 }
319 ccprintf(ss, ", ");
320 printVecReg(ss, op1, true);
321 ccprintf(ss, ", ");
322 printVecReg(ss, op2, true);
323 return ss.str();
324}
325
326std::string
328 Addr pc, const loader::SymbolTable *symtab) const
329{
330 std::stringstream ss;
331 printMnemonic(ss, "", false);
332 printVecReg(ss, dest, true);
333 ccprintf(ss, ", ");
334 printVecReg(ss, op1, true);
335 ccprintf(ss, ", ");
336 printVecReg(ss, op2, true);
337 return ss.str();
338}
339
340std::string
342 Addr pc, const loader::SymbolTable *symtab) const
343{
344 std::stringstream ss;
345 printMnemonic(ss, "", false);
346 printVecReg(ss, dest, true);
347 ccprintf(ss, ", ");
348 printVecReg(ss, op1, true);
349 ccprintf(ss, ", ");
350 printVecReg(ss, op2, true);
351 ccprintf(ss, "[");
352 ss << (uint64_t)index;
353 ccprintf(ss, "]");
354 return ss.str();
355}
356
357std::string
359 Addr pc, const loader::SymbolTable *symtab) const
360{
361 std::stringstream ss;
362 printMnemonic(ss, "", false);
363 printVecReg(ss, dest, true);
364 ccprintf(ss, ", ");
366 if (isSel) {
367 ccprintf(ss, ", ");
368 } else {
369 ccprintf(ss, "/z, ");
370 }
372 ccprintf(ss, ", ");
374 return ss.str();
375}
376
377std::string
379 Addr pc, const loader::SymbolTable *symtab) const
380{
381 std::stringstream ss;
382 printMnemonic(ss, "", false);
384 ccprintf(ss, ", ");
386 ccprintf(ss, ", ");
388 return ss.str();
389}
390
391std::string
393{
394 std::stringstream ss;
395 printMnemonic(ss, "", false);
397 ccprintf(ss, ", ");
399 ccprintf(ss, "/z, ");
400 printVecReg(ss, op1, true);
401 ccprintf(ss, ", ");
402 printVecReg(ss, op2, true);
403 return ss.str();
404}
405
406std::string
408 Addr pc, const loader::SymbolTable *symtab) const
409{
410 std::stringstream ss;
411 printMnemonic(ss, "", false);
413 ccprintf(ss, ", ");
415 ccprintf(ss, "/z, ");
416 printVecReg(ss, op1, true);
417 ccprintf(ss, ", #");
418 ss << imm;
419 return ss.str();
420}
421
422std::string
424 Addr pc, const loader::SymbolTable *symtab) const
425{
426 std::stringstream ss;
427 printMnemonic(ss, "", false);
428 printVecReg(ss, dest, true);
429 ccprintf(ss, ", ");
431 ccprintf(ss, "/m, ");
432 printVecReg(ss, op1, true);
433 ccprintf(ss, ", ");
434 printVecReg(ss, op2, true);
435 return ss.str();
436}
437
438std::string
440 Addr pc, const loader::SymbolTable *symtab) const
441{
442 std::stringstream ss;
443 printMnemonic(ss, "", false);
444 printVecReg(ss, dest, true);
445 ccprintf(ss, ", ");
446 printVecReg(ss, op1, true);
447 ccprintf(ss, ", ");
448 printVecReg(ss, op2, true);
449 return ss.str();
450}
451
452std::string
454 Addr pc, const loader::SymbolTable *symtab) const
455{
456 std::stringstream ss;
457 printMnemonic(ss, "", false);
458 printVecReg(ss, dest, true);
459 ccprintf(ss, ", ");
460 printVecReg(ss, dest, true);
461 ccprintf(ss, ", ");
462 printVecReg(ss, op2, true);
463 ccprintf(ss, ", #");
464 ss << imm;
465 return ss.str();
466}
467
468std::string
470 Addr pc, const loader::SymbolTable *symtab) const
471{
472 std::stringstream ss;
473 printMnemonic(ss, "", false);
475 ccprintf(ss, ", ");
477 ccprintf(ss, ", ");
478 printVecReg(ss, op1, true);
479 return ss.str();
480}
481
482std::string
484 Addr pc, const loader::SymbolTable *symtab) const
485{
486 std::stringstream ss;
487 printMnemonic(ss, "", false);
489 ccprintf(ss, ", ");
491 ccprintf(ss, ", ");
493 ccprintf(ss, ", ");
494 printVecReg(ss, op1, true);
495 return ss.str();
496}
497
498std::string
500 Addr pc, const loader::SymbolTable *symtab) const
501{
502 std::stringstream ss;
503 printMnemonic(ss, "", false);
505 if (imm != 0x1f) {
506 ccprintf(ss, ", ");
508 }
509 return ss.str();
510}
511
512std::string
514 Addr pc, const loader::SymbolTable *symtab) const
515{
516 std::stringstream ss;
517 printMnemonic(ss, "", false);
519 ccprintf(ss, ", ");
521 ccprintf(ss, "/z, ");
522 printVecReg(ss, op1, true);
523 ccprintf(ss, ", ");
524 if (op2IsWide) {
525 printVecReg(ss, op2, true);
526 } else {
527 printVecReg(ss, op2, true);
528 }
529 return ss.str();
530}
531
532std::string
534 Addr pc, const loader::SymbolTable *symtab) const
535{
536 std::stringstream ss;
537 printMnemonic(ss, "", false);
539 ccprintf(ss, "/z, ");
541 ccprintf(ss, ", ");
542 printVecReg(ss, op1, true);
543 ccprintf(ss, ", #");
544 ss << imm;
545 return ss.str();
546}
547
548std::string
550{
551 std::stringstream ss;
552 printMnemonic(ss, "", false);
553 printVecReg(ss, dest, true);
554 ccprintf(ss, ", [");
555 printVecReg(ss, op1, true);
556 ccprintf(ss, ", ");
557 printVecReg(ss, op2, true);
559 ccprintf(ss, ", sxtw");
561 ccprintf(ss, ", uxtw");
562 } else if (mult != 1) {
563 ccprintf(ss, ", lsl");
564 }
565 if (mult != 1) {
566 ss << __builtin_ctz(mult);
567 }
568 ccprintf(ss, "]");
569 return ss.str();
570}
571
572std::string
574 Addr pc, const loader::SymbolTable *symtab) const
575{
576 static const char suffix[9] =
577 {'\0', 'b', 'h', '\0', 'w', '\0', '\0', '\0', 'd'};
578 std::stringstream ss;
579 ss << " " << mnemonic << suffix[esize] << " ";
580 if (dstIsVec) {
581 printVecReg(ss, dest, true);
582 } else {
583 if (dstIs32b) {
584 printIntReg(ss, dest, 32);
585 } else {
586 printIntReg(ss, dest, 64);
587 }
588 }
589 if (pattern != 0x1f) {
590 ccprintf(ss, ", ");
592 if (imm != 1) {
593 ccprintf(ss, ", mul #");
594 ss << std::to_string(imm);
595 }
596 }
597 return ss.str();
598}
599
600std::string
602 Addr pc, const loader::SymbolTable *symtab) const
603{
604 std::stringstream ss;
605 printMnemonic(ss, "", false);
607 ccprintf(ss, ", ");
609 ccprintf(ss, isMerging ? "/m, " : "/z, ");
611 return ss.str();
612}
613
614std::string
616 Addr pc, const loader::SymbolTable *symtab) const
617{
618 std::stringstream ss;
619 printMnemonic(ss, "", false);
621 ccprintf(ss, ", ");
623 ccprintf(ss, "/z, ");
625 ccprintf(ss, ", ");
627 return ss.str();
628}
629
630std::string
632 Addr pc, const loader::SymbolTable *symtab) const
633{
634 std::stringstream ss;
635 printMnemonic(ss, "", false);
636 if (scalar)
638 else if (simdFp)
640 else
641 printVecReg(ss, dest, true);
642 ccprintf(ss, ", ");
644 if (conditional) {
645 ccprintf(ss, ", ");
646 if (scalar)
648 else
649 printVecReg(ss, dest, true);
650 }
651 ccprintf(ss, ", ");
652 printVecReg(ss, op1, true);
653 return ss.str();
654}
655
656std::string
658 Addr pc, const loader::SymbolTable *symtab) const
659{
660 std::stringstream ss;
661 printMnemonic(ss, "", false);
663 ccprintf(ss, ", ");
665 ccprintf(ss, ", ");
667 return ss.str();
668}
669
670std::string
672{
673 std::stringstream ss;
674 printMnemonic(ss, "", false);
675 printVecReg(ss, dest, true);
676 ccprintf(ss, ", { ");
677 printVecReg(ss, op1, true);
678 ccprintf(ss, " }, ");
679 printVecReg(ss, op2, true);
680 return ss.str();
681}
682
683std::string
685 Addr pc, const loader::SymbolTable *symtab) const
686{
687 std::stringstream ss;
688 printMnemonic(ss, "", false);
690 ccprintf(ss, ", ");
692 return ss.str();
693}
694
695std::string
697 Addr pc, const loader::SymbolTable *symtab) const
698{
699 std::stringstream ss;
700 printMnemonic(ss, "", false);
702 ccprintf(ss, ", ");
704 return ss.str();
705}
706
707std::string
709 Addr pc, const loader::SymbolTable *symtab) const
710{
711 std::stringstream ss;
712 printMnemonic(ss, "", false);
714 return ss.str();
715}
716
717std::string
719 Addr pc, const loader::SymbolTable *symtab) const
720{
721 std::stringstream ss;
722 printMnemonic(ss, "", false);
724 ccprintf(ss, ", ");
726 ccprintf(ss, "/z, ");
727 return ss.str();
728}
729
730std::string
732 Addr pc, const loader::SymbolTable *symtab) const
733{
734 std::stringstream ss;
735 printMnemonic(ss, "", false);
737 return ss.str();
738}
739
740std::string
742 Addr pc, const loader::SymbolTable *symtab) const
743{
744 std::stringstream ss;
745 printMnemonic(ss, "", false);
746 return ss.str();
747}
748
749std::string
751 Addr pc, const loader::SymbolTable *symtab) const
752{
753 std::stringstream ss;
754 printMnemonic(ss, "", false);
755 printVecReg(ss, dest, true);
756 ccprintf(ss, ", ");
757 printVecReg(ss, dest, true);
758 ccprintf(ss, ", ");
759 printVecReg(ss, op1, true);
760 ccprintf(ss, ", #");
761 ss << imm;
762 return ss.str();
763}
764
765std::string
767 Addr pc, const loader::SymbolTable *symtab) const
768{
769 std::stringstream ss;
770 printMnemonic(ss, "", false);
771 printVecReg(ss, dest, true);
772 ccprintf(ss, ", ");
773 printVecReg(ss, op1, true);
774 ccprintf(ss, "[");
775 ss << imm;
776 ccprintf(ss, "]");
777 return ss.str();
778}
779
780std::string
782 Addr pc, const loader::SymbolTable *symtab) const
783{
784 std::stringstream ss;
785 printMnemonic(ss, "", false);
786 printVecReg(ss, dest, true);
787 ccprintf(ss, ", ");
788 if (simdFp) {
790 } else {
792 }
793 return ss.str();
794}
795
796std::string
798 Addr pc, const loader::SymbolTable *symtab) const
799{
800 std::stringstream ss;
801 printMnemonic(ss, "", false);
802 printVecReg(ss, dest, true);
803 ccprintf(ss, ", ");
804 printVecReg(ss, op1, true);
805 ccprintf(ss, ", ");
806 printVecReg(ss, op2, true);
807 ccprintf(ss, "[");
808 ccprintf(ss, "%lu", imm);
809 ccprintf(ss, "]");
810 return ss.str();
811}
812
813std::string
815 Addr pc, const loader::SymbolTable *symtab) const
816{
817 std::stringstream ss;
818 printMnemonic(ss, "", false);
819 printVecReg(ss, dest, true);
820 ccprintf(ss, ", ");
821 printVecReg(ss, op1, true);
822 ccprintf(ss, ", ");
823 printVecReg(ss, op2, true);
824 return ss.str();
825}
826
827std::string
829 Addr pc, const loader::SymbolTable *symtab) const
830{
831 std::stringstream ss;
832 printMnemonic(ss, "", false);
834 ccprintf(ss, ", ");
836 ccprintf(ss, "/m, ");
838 ccprintf(ss, ", ");
840 ccprintf(ss, ", #");
841 const char* rotstr[4] = {"0", "90", "180", "270"};
842 ccprintf(ss, rotstr[rot]);
843
844 return ss.str();
845}
846
847std::string
849 Addr pc, const loader::SymbolTable *symtab) const
850{
851 std::stringstream ss;
852 printMnemonic(ss, "", false);
854 ccprintf(ss, ", ");
856 ccprintf(ss, ", ");
858 ccprintf(ss, "[");
859 ss << imm;
860 ccprintf(ss, "], #");
861 const char* rotstr[4] = {"0", "90", "180", "270"};
862 ccprintf(ss, rotstr[rot]);
863 return ss.str();
864}
865
866std::string
868 Addr pc, const loader::SymbolTable *symtab) const
869{
870 std::stringstream ss;
871 printMnemonic(ss, "", false);
872 printVecReg(ss, dest, true);
873 ss << ", ";
874 printVecReg(ss, op1, true);
875 ss << ", ";
876 printVecReg(ss, op2, true);
877 return ss.str();
878}
879
880std::string
882{
883 switch (imm) {
884 case 0x0:
885 return "POW2";
886 case 0x1:
887 case 0x2:
888 case 0x3:
889 case 0x4:
890 case 0x5:
891 case 0x6:
892 case 0x7:
893 return "VL" + std::to_string(imm);
894 case 0x8:
895 case 0x9:
896 case 0xa:
897 case 0xb:
898 case 0xc:
899 case 0xd:
900 return "VL" + std::to_string(1 << ((imm & 0x7) + 3));
901 case 0x1d:
902 return "MUL4";
903 case 0x1e:
904 return "MUL3";
905 case 0x1f:
906 return "ALL";
907 default:
908 return "#" + std::to_string(imm);
909 }
910}
911
912unsigned int
913sveDecodePredCount(uint8_t imm, unsigned int num_elems)
914{
915 assert(num_elems > 0);
916
917 switch (imm) {
918 case 0x0:
919 // POW2
920 return 1 << (31 - __builtin_clz((uint32_t) num_elems));
921 case 0x1:
922 case 0x2:
923 case 0x3:
924 case 0x4:
925 case 0x5:
926 case 0x6:
927 case 0x7:
928 // VL1, VL2, VL3, VL4, VL5, VL6, VL7
929 return (num_elems >= imm) ? imm : 0;
930 case 0x8:
931 case 0x9:
932 case 0xa:
933 case 0xb:
934 case 0xc:
935 case 0xd:
936 // VL8, VL16, VL32, VL64, VL128, VL256
937 {
938 unsigned int pcount = 1 << ((imm & 0x7) + 3);
939 return (num_elems >= pcount) ? pcount : 0;
940 }
941 case 0x1d:
942 // MUL4
943 return num_elems - (num_elems % 4);
944 case 0x1e:
945 // MUL3
946 return num_elems - (num_elems % 3);
947 case 0x1f:
948 // ALL
949 return num_elems;
950 default:
951 return 0;
952 }
953}
954
955uint64_t
956sveExpandFpImmAddSub(uint8_t imm, uint8_t size)
957{
958 static constexpr uint16_t fpOne16 = 0x3c00;
959 static constexpr uint16_t fpPointFive16 = 0x3800;
960 static constexpr uint32_t fpOne32 = 0x3f800000;
961 static constexpr uint32_t fpPointFive32 = 0x3f000000;
962 static constexpr uint64_t fpOne64 = 0x3ff0000000000000;
963 static constexpr uint64_t fpPointFive64 = 0x3fe0000000000000;
964
965 switch (size) {
966 case 0x1:
967 return imm ? fpOne16 : fpPointFive16;
968 case 0x2:
969 return imm ? fpOne32 : fpPointFive32;
970 case 0x3:
971 return imm ? fpOne64 : fpPointFive64;
972 default:
973 panic("Unsupported size");
974 }
975}
976
977uint64_t
978sveExpandFpImmMaxMin(uint8_t imm, uint8_t size)
979{
980 static constexpr uint16_t fpOne16 = 0x3c00;
981 static constexpr uint32_t fpOne32 = 0x3f800000;
982 static constexpr uint64_t fpOne64 = 0x3ff0000000000000;
983
984 switch (size) {
985 case 0x1:
986 return imm ? fpOne16 : 0x0;
987 case 0x2:
988 return imm ? fpOne32 : 0x0;
989 case 0x3:
990 return imm ? fpOne64 : 0x0;
991 default:
992 panic("Unsupported size");
993 }
994}
995
996uint64_t
997sveExpandFpImmMul(uint8_t imm, uint8_t size)
998{
999 static constexpr uint16_t fpTwo16 = 0x4000;
1000 static constexpr uint16_t fpPointFive16 = 0x3800;
1001 static constexpr uint32_t fpTwo32 = 0x40000000;
1002 static constexpr uint32_t fpPointFive32 = 0x3f000000;
1003 static constexpr uint64_t fpTwo64 = 0x4000000000000000;
1004 static constexpr uint64_t fpPointFive64 = 0x3fe0000000000000;
1005
1006 switch (size) {
1007 case 0x1:
1008 return imm ? fpTwo16 : fpPointFive16;
1009 case 0x2:
1010 return imm ? fpTwo32 : fpPointFive32;
1011 case 0x3:
1012 return imm ? fpTwo64 : fpPointFive64;
1013 default:
1014 panic("Unsupported size");
1015 }
1016}
1017
1018} // namespace ArmISA
1019} // namespace gem5
void printMnemonic(std::ostream &os, const std::string &suffix="", bool withPred=true, bool withCond64=false, ConditionCode cond64=COND_UC) const
void printVecReg(std::ostream &os, RegIndex reg_idx, bool isSveVecReg=false) const
void printIntReg(std::ostream &os, RegIndex reg_idx, uint8_t opWidth=0) const
Print a register name for disassembly given the unique dependence tag number (FP or int).
void printFloatReg(std::ostream &os, RegIndex reg_idx) const
void printVecPredReg(std::ostream &os, RegIndex reg_idx) const
SveAdrOffsetFormat offsetFormat
Definition sve.hh:637
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition sve.cc:549
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition sve.cc:308
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition sve.cc:292
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition sve.cc:341
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition sve.cc:766
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition sve.cc:262
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition sve.cc:248
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition sve.cc:750
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition sve.cc:327
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition sve.cc:278
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition sve.cc:867
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition sve.cc:407
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition sve.cc:392
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition sve.cc:183
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition sve.cc:848
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition sve.cc:828
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition sve.cc:797
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition sve.cc:814
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition sve.cc:573
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition sve.cc:96
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition sve.cc:107
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition sve.cc:119
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition sve.cc:132
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition sve.cc:533
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition sve.cc:513
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition sve.cc:483
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition sve.cc:601
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition sve.cc:615
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition sve.cc:378
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition sve.cc:75
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition sve.cc:61
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition sve.cc:358
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition sve.cc:696
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition sve.cc:731
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition sve.cc:708
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition sve.cc:718
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition sve.cc:165
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition sve.cc:499
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition sve.cc:469
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition sve.cc:631
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition sve.cc:671
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition sve.cc:453
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition sve.cc:423
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition sve.cc:439
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition sve.cc:195
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition sve.cc:657
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition sve.cc:781
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition sve.cc:209
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition sve.cc:233
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition sve.cc:221
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition sve.cc:684
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition sve.cc:741
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition sve.cc:146
const char * mnemonic
Base mnemonic (e.g., "add").
#define panic(...)
This implements a cprintf based panic() function.
Definition logging.hh:188
Bitfield< 7, 0 > imm
Definition types.hh:132
uint64_t sveExpandFpImmAddSub(uint8_t imm, uint8_t size)
Expand 1-bit floating-point immediate to 0.5 or 1.0 (FADD, FSUB, FSUBR).
Definition sve.cc:956
unsigned int sveDecodePredCount(uint8_t imm, unsigned int num_elems)
Returns the actual number of elements active for PTRUE(S) instructions.
Definition sve.cc:913
const char * svePredTypeToStr(SvePredType pt)
Returns the specifier for the predication type pt as a string.
Definition sve.cc:48
std::string sveDisasmPredCountImm(uint8_t imm)
Returns the symbolic name associated with pattern imm for PTRUE(S) instructions.
Definition sve.cc:881
uint64_t sveExpandFpImmMul(uint8_t imm, uint8_t size)
Expand 1-bit floating-point immediate to 0.5 or 2.0 (FMUL).
Definition sve.cc:997
uint64_t sveExpandFpImmMaxMin(uint8_t imm, uint8_t size)
Expand 1-bit floating-point immediate to 0.0 or 1.0 (FMAX, FMAXNM, FMIN, FMINNM).
Definition sve.cc:978
Bitfield< 21 > ss
Definition misc_types.hh:60
Bitfield< 4 > pc
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
Definition binary32.hh:36
Bitfield< 8 > pt
Definition x86_cpu.cc:127
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition types.hh:147
void ccprintf(cp::Print &print)
Definition cprintf.hh:130

Generated on Tue Jun 18 2024 16:23:56 for gem5 by doxygen 1.11.0