gem5 [DEVELOP-FOR-25.1]
Loading...
Searching...
No Matches
integer.hh
Go to the documentation of this file.
1/*
2 * Copyright (c) 2009 The University of Edinburgh
3 * Copyright (c) 2021 IBM Corporation
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are
8 * met: redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer;
10 * redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution;
13 * neither the name of the copyright holders nor the names of its
14 * contributors may be used to endorse or promote products derived from
15 * this software without specific prior written permission.
16 *
17 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 */
29
30#ifndef __ARCH_POWER_INSTS_INTEGER_HH__
31#define __ARCH_POWER_INSTS_INTEGER_HH__
32
35#include "base/bitfield.hh"
36#include "base/cprintf.hh"
37
38namespace gem5
39{
40
41namespace PowerISA
42{
43
50
54class IntOp : public PowerStaticInst
55{
56 protected:
57
58 bool rc;
59 bool oe;
60
61 // Needed for srawi only
62 uint32_t sh;
63
65 IntOp(const char *mnem, MachInst _machInst, OpClass __opClass)
66 : PowerStaticInst(mnem, _machInst, __opClass),
67 rc(machInst.rc),
69 {
70 }
71
72 /* Compute the CR (condition register) field using signed comparison */
73 inline uint32_t
74 makeCRFieldSigned(int64_t a, int64_t b, bool so) const
75 {
76 Cr cr = 0;
77
78 if (a < b) { cr.cr0.lt = 1; }
79 else if (a > b) { cr.cr0.gt = 1; }
80 else { cr.cr0.eq = 1; }
81 if (so) { cr.cr0.so = 1; }
82
83 return cr.cr0;
84 }
85
86 /* Compute the CR (condition register) field using unsigned comparison */
87 inline uint32_t
88 makeCRFieldUnsigned(uint64_t a, uint64_t b, bool so) const
89 {
90 Cr cr = 0;
91
92 if (a < b) { cr.cr0.lt = 1; }
93 else if (a > b) { cr.cr0.gt = 1; }
94 else { cr.cr0.eq = 1; }
95 if (so) { cr.cr0.so = 1; }
96
97 return cr.cr0;
98 }
99
100 std::string generateDisassembly(
101 Addr pc, const loader::SymbolTable *symtab) const override;
102};
103
104
108class IntImmOp : public IntOp
109{
110 protected:
111
112 int32_t si;
113 uint32_t ui;
114
116 IntImmOp(const char *mnem, MachInst _machInst, OpClass __opClass)
117 : IntOp(mnem, _machInst, __opClass),
118 si(sext<16>(machInst.si)),
119 ui(machInst.si)
120 {
121 }
122
123 std::string generateDisassembly(
124 Addr pc, const loader::SymbolTable *symtab) const override;
125};
126
127
131class IntArithOp : public IntOp
132{
133 protected:
134
136 IntArithOp(const char *mnem, MachInst _machInst, OpClass __opClass)
137 : IntOp(mnem, _machInst, __opClass)
138 {
139 }
140
141 /* Compute 128-bit sum of 128-bit to 64-bit unsigned integer addition */
142 inline std::tuple<uint64_t, uint64_t>
143 add(uint64_t ralo, uint64_t rahi, uint64_t rb) const
144 {
145 uint64_t slo, shi;
146 #if defined(__SIZEOF_INT128__)
147 __uint128_t ra = ((__uint128_t)rahi << 64) | ralo;
148 __uint128_t sum = ra + rb;
149 slo = sum;
150 shi = sum >> 64;
151 #else
152 shi = rahi + ((ralo + rb) < ralo);
153 slo = ralo + rb;
154 #endif
155 return std::make_tuple(slo, shi);
156 }
157
158 /* Compute 128-bit sum of 128-bit to 64-bit signed integer addition */
159 inline std::tuple<uint64_t, int64_t>
160 add(uint64_t ralo, int64_t rahi, int64_t rb) const
161 {
162 uint64_t slo;
163 int64_t shi;
164 #if defined(__SIZEOF_INT128__)
165 __int128_t ra = ((__int128_t)rahi << 64) | ralo;
166 __int128_t sum = (__int128_t)ra + rb;
167 slo = sum;
168 shi = sum >> 64;
169 #else
170 if (rb < 0) {
171 shi = rahi - 1;
172 slo = ralo + rb;
173 if (slo < rb) {
174 shi++;
175 }
176 } else {
177 shi = rahi;
178 slo = ralo + rb;
179 if (slo < rb) {
180 shi++;
181 }
182 }
183 #endif
184 return std::make_tuple(slo, shi);
185 }
186
191 inline std::tuple<uint64_t, uint64_t>
192 multiply(uint64_t ra, uint64_t rb) const
193 {
194 uint64_t plo, phi;
195 #if defined(__SIZEOF_INT128__)
196 __uint128_t prod = (__uint128_t)ra * rb;
197 plo = prod;
198 phi = prod >> 64;
199 #else
200 uint64_t ralo = (uint32_t)ra, rahi = ra >> 32;
201 uint64_t rblo = (uint32_t)rb, rbhi = rb >> 32;
202 uint64_t pp0 = ralo * rblo;
203 uint64_t pp1 = rahi * rblo;
204 uint64_t pp2 = ralo * rbhi;
205 uint64_t pp3 = rahi * rbhi;
206 uint64_t c = ((uint32_t)pp1) + ((uint32_t)pp2) + (pp0 >> 32);
207 phi = pp3 + (pp2 >> 32) + (pp1 >> 32) + (c >> 32);
208 plo = (c << 32) | ((uint32_t)pp0);
209 #endif
210 return std::make_tuple(plo, phi);
211 }
212
213 /* Compute 128-bit product of 64-bit signed integer multiplication */
214 inline std::tuple<uint64_t, int64_t>
215 multiply(int64_t ra, int64_t rb) const
216 {
217 uint64_t plo, phi;
218 #if defined(__SIZEOF_INT128__)
219 __int128_t prod = (__int128_t)ra * rb;
220 plo = prod;
221 phi = prod >> 64;
222 #else
223 std::tie(plo, phi) = multiply((uint64_t)ra, (uint64_t)rb);
224 if (rb < 0) phi -= (uint64_t)ra;
225 if (ra < 0) phi -= (uint64_t)rb;
226 #endif
227 return std::make_tuple(plo, (int64_t)phi);
228 }
229
234 inline std::tuple<uint64_t, uint64_t>
235 multiplyAdd(uint64_t ra, uint64_t rb, uint64_t rc) const
236 {
237 uint64_t rlo, rhi;
238 #if defined(__SIZEOF_INT128__)
239 __uint128_t res = ((__uint128_t)ra * rb) + rc;
240 rlo = res;
241 rhi = res >> 64;
242 #else
243 uint64_t plo, phi;
244 std::tie(plo, phi) = multiply(ra, rb);
245 std::tie(rlo, rhi) = add(plo, phi, rc);
246 #endif
247 return std::make_tuple(rlo, rhi);
248 }
249
254 inline std::tuple<uint64_t, int64_t>
255 multiplyAdd(int64_t ra, int64_t rb, int64_t rc) const
256 {
257 uint64_t rlo;
258 int64_t rhi;
259 #if defined(__SIZEOF_INT128__)
260 __int128_t res = (__int128_t)ra * rb + rc;
261 rlo = res;
262 rhi = res >> 64;
263 #else
264 uint64_t plo;
265 int64_t phi;
266 std::tie(plo, phi) = multiply(ra, rb);
267 std::tie(rlo, rhi) = add(plo, phi, rc);
268 #endif
269 return std::make_tuple(rlo, rhi);
270 }
271
277 // clang-format off
278 inline std::tuple<bool, uint64_t, uint64_t>
279 divide(uint64_t ralo, uint64_t rahi, uint64_t rb) const
280 {
281 bool ov;
282 uint64_t q = 0, r = 0;
283 #if defined(__SIZEOF_INT128__)
284 if (rb == 0) {
285 ov = true;
286 } else {
287 __uint128_t ra = ((__uint128_t)rahi << 64) | ralo;
288 __uint128_t res = ra / rb;
289 q = res;
290 r = ra % rb;
291 ov = res > UINT64_MAX;
292 }
293 #else
294 uint64_t c = 0;
295
296 if (rb == 0) {
297 ov = true;
298 } else if (rahi == 0) {
299 q = ralo / rb;
300 r = ralo % rb;
301 ov = false;
302 } else if (rahi >= rb) {
303 ov = true;
304 } else {
305 for (int i = 0; i < 64; ++i) {
306 c = rahi >> 63;
307 rahi = (rahi << 1) | (ralo >> 63);
308 if (c || (rahi >= rb)) {
309 rahi -= rb;
310 c = 1;
311 } else {
312 c = 0;
313 }
314 ralo = (ralo << 1) | c;
315 }
316 q = ralo;
317 r = rahi;
318 ov = false;
319 }
320 #endif
321 return std::make_tuple(ov, q, r);
322 }
323
328 inline std::tuple<bool, int64_t, int64_t>
329 divide(uint64_t ralo, int64_t rahi, int64_t rb) const
330 {
331 bool ov;
332 int64_t q = 0, r = 0;
333 #if defined(__SIZEOF_INT128__)
334 if (rb == 0) {
335 ov = true;
336 } else {
337 __int128_t ra = ((__int128_t)rahi << 64) | ralo;
338 __int128_t res = ra / rb;
339 q = res;
340 r = ra % rb;
341 ov = res != q;
342 }
343 #else
344 bool raneg = rahi < 0;
345 bool rbneg = rb < 0;
346
347 if (raneg) {
348 ralo = ~(ralo);
349 rahi = ~(rahi);
350 if (ralo == -1ULL) {
351 ralo = 0;
352 rahi++;
353 } else {
354 ralo++;
355 }
356 }
357
358 if (rbneg) rb = -rb;
359 std::tie(ov, q, r) = divide(ralo, (uint64_t)rahi, (uint64_t)rb);
360 if (raneg ^ rbneg) q = -q;
361 if (raneg) r = -r;
362 if (!ov) ov = ((q < 0) ^ (raneg ^ rbneg));
363 #endif
364 return std::make_tuple(ov, q, r);
365 }
366 // clang-format on
367
368 std::string generateDisassembly(
369 Addr pc, const loader::SymbolTable *symtab) const override;
370};
371
372
377{
378 protected:
379
380 int32_t si;
381
383 IntImmArithOp(const char *mnem, MachInst _machInst, OpClass __opClass)
384 : IntArithOp(mnem, _machInst, __opClass),
385 si(sext<16>(machInst.si))
386 {
387 }
388
389 std::string generateDisassembly(
390 Addr pc, const loader::SymbolTable *symtab) const override;
391};
392
393
398{
399 protected:
400
401 int64_t d;
402
404 IntDispArithOp(const char *mnem, MachInst _machInst, OpClass __opClass)
405 : IntArithOp(mnem, _machInst, __opClass),
406 d(sext<16>((machInst.d0 << 6) | (machInst.d1 << 1) | machInst.d2))
407 {
408 }
409
410 std::string generateDisassembly(
411 Addr pc, const loader::SymbolTable *symtab) const override;
412};
413
414
418class IntCompOp : public IntOp
419{
420 protected:
421
422 bool l;
423 uint8_t bf;
424
426 IntCompOp(const char *mnem, MachInst _machInst, OpClass __opClass)
427 : IntOp(mnem, _machInst, __opClass),
428 l(machInst.l),
429 bf(machInst.bf)
430 {
431 }
432
433 std::string generateDisassembly(
434 Addr pc, const loader::SymbolTable *symtab) const override;
435};
436
437
442{
443 protected:
444
445 int32_t si;
446
448 IntImmCompOp(const char *mnem, MachInst _machInst, OpClass __opClass)
449 : IntCompOp(mnem, _machInst, __opClass),
450 si(sext<16>(machInst.si))
451 {
452 }
453
454 std::string generateDisassembly(
455 Addr pc, const loader::SymbolTable *symtab) const override;
456};
457
458
463{
464 protected:
465
466 uint32_t ui;
467
469 IntImmCompLogicOp(const char *mnem, MachInst _machInst, OpClass __opClass)
470 : IntCompOp(mnem, _machInst, __opClass),
471 ui(machInst.ui)
472 {
473 }
474
475 std::string generateDisassembly(
476 Addr pc, const loader::SymbolTable *symtab) const override;
477};
478
479
483class IntLogicOp : public IntOp
484{
485 protected:
486
488 IntLogicOp(const char *mnem, MachInst _machInst, OpClass __opClass)
489 : IntOp(mnem, _machInst, __opClass)
490 {
491 }
492
493 /* Compute the number of consecutive zero bits starting from the
494 leftmost bit and moving right in a 32-bit integer */
495 inline int
496 findLeadingZeros(uint32_t rs) const
497 {
498 if (rs) {
499 #if defined(__GNUC__) || (defined(__clang__) && \
500 __has_builtin(__builtin_clz))
501 return __builtin_clz(rs);
502 #else
503 return 31 - findMsbSet(rs);
504 #endif
505 } else {
506 return 32;
507 }
508 }
509
510 /* Compute the number of consecutive zero bits starting from the
511 leftmost bit and moving right in a 64-bit integer */
512 inline int
513 findLeadingZeros(uint64_t rs) const
514 {
515 if (rs) {
516 #if defined(__GNUC__) || (defined(__clang__) && \
517 __has_builtin(__builtin_clzll))
518 return __builtin_clzll(rs);
519 #else
520 return 63 - findMsbSet(rs);
521 #endif
522 } else {
523 return 64;
524 }
525 }
526
527 /* Compute the number of consecutive zero bits starting from the
528 rightmost bit and moving left in a 32-bit integer */
529 inline int
530 findTrailingZeros(uint32_t rs) const
531 {
532 if (rs) {
533 #if defined(__GNUC__) || (defined(__clang__) && \
534 __has_builtin(__builtin_ctz))
535 return __builtin_ctz(rs);
536 #else
537 return findLsbSet(rs);
538 #endif
539 } else {
540 return 32;
541 }
542 }
543
544 /* Compute the number of consecutive zero bits starting from the
545 rightmost bit and moving left in a 64-bit integer */
546 inline int
547 findTrailingZeros(uint64_t rs) const
548 {
549 if (rs) {
550 #if defined(__GNUC__) || (defined(__clang__) && \
551 __has_builtin(__builtin_ctzll))
552 return __builtin_ctzll(rs);
553 #else
554 return findLsbSet(rs);
555 #endif
556 } else {
557 return 64;
558 }
559 }
560
561 std::string generateDisassembly(
562 Addr pc, const loader::SymbolTable *symtab) const override;
563};
564
565
570{
571 protected:
572
573 uint32_t ui;
574
576 IntImmLogicOp(const char *mnem, MachInst _machInst, OpClass __opClass)
577 : IntLogicOp(mnem, _machInst, __opClass),
578 ui(machInst.ui)
579 {
580 }
581
582 std::string generateDisassembly(
583 Addr pc, const loader::SymbolTable *symtab) const override;
584};
585
586
591class IntShiftOp : public IntOp
592{
593 protected:
594
595 uint8_t sh;
596
598 IntShiftOp(const char *mnem, MachInst _machInst, OpClass __opClass)
599 : IntOp(mnem, _machInst, __opClass),
600 sh(machInst.sh)
601 {
602 }
603
604 std::string generateDisassembly(
605 Addr pc, const loader::SymbolTable *symtab) const override;
606};
607
608
614{
615 protected:
616
617 uint8_t sh;
618
620 IntConcatShiftOp(const char *mnem, MachInst _machInst, OpClass __opClass)
621 : IntOp(mnem, _machInst, __opClass),
622 sh((machInst.shn << 5) | machInst.sh)
623 {
624 }
625
626 std::string generateDisassembly(
627 Addr pc, const loader::SymbolTable *symtab) const override;
628};
629
630
637{
638 protected:
639
640 uint8_t mb;
641 uint8_t me;
642
644 IntRotateOp(const char *mnem, MachInst _machInst, OpClass __opClass)
645 : IntShiftOp(mnem, _machInst, __opClass),
646 mb(machInst.mb),
647 me(machInst.me)
648 {
649 }
650
651 inline uint64_t
652 rotate(uint32_t value, uint32_t shift) const
653 {
654 uint64_t res;
655 shift = shift & 0x1f;
656 res = value;
657 res = (res << 32) | res;
658 res = (res << shift) | (res >> (32 - shift));
659 return res;
660 }
661
662 inline uint64_t
663 bitmask(uint32_t begin, uint32_t end) const
664 {
665 begin = begin & 0x1f;
666 end = end & 0x1f;
667 if (begin <= end) {
668 return mask(31 - begin, 31 - end);
669 } else {
670 return ~mask(31 - (end + 1), 31 - (begin - 1));
671 }
672 }
673
674 std::string generateDisassembly(
675 Addr pc, const loader::SymbolTable *symtab) const override;
676};
677
678
685{
686 protected:
687
688 uint8_t mb;
689 uint8_t me;
690
692 IntConcatRotateOp(const char *mnem, MachInst _machInst, OpClass __opClass)
693 : IntConcatShiftOp(mnem, _machInst, __opClass),
694 mb((machInst.mbn << 5) | machInst.mb),
695 me((machInst.men << 5) | machInst.mb)
696 {
697 }
698
699 inline uint64_t
700 rotate(uint64_t value, uint32_t shift) const
701 {
702 shift = shift & 0x3f;
703 return (value << shift) | (value >> (64 - shift));
704 }
705
706 inline uint64_t
707 bitmask(uint32_t begin, uint32_t end) const
708 {
709 begin = begin & 0x3f;
710 end = end & 0x3f;
711 if (begin <= end) {
712 return mask(63 - begin, 63 - end);
713 } else {
714 return ~mask(63 - (end + 1), 63 - (begin - 1));
715 }
716 }
717
718 std::string generateDisassembly(
719 Addr pc, const loader::SymbolTable *symtab) const override;
720};
721
722
726class IntTrapOp : public IntOp
727{
728 protected:
729 uint8_t to;
730
732 IntTrapOp(const char *mnem, MachInst _machInst, OpClass __opClass)
733 : IntOp(mnem, _machInst, __opClass),
734 to(machInst.to)
735 {
736 }
737
738 inline bool
739 checkTrap(int64_t a, int64_t b) const
740 {
741 if (((to & 0x10) && (a < b)) ||
742 ((to & 0x08) && (a > b)) ||
743 ((to & 0x04) && (a == b)) ||
744 ((to & 0x02) && ((uint64_t)a < (uint64_t)b)) ||
745 ((to & 0x01) && ((uint64_t)a > (uint64_t)b))) {
746 return true;
747 }
748
749 return false;
750 }
751
752 inline std::string
753 suffix() const
754 {
755 std::string str;
756
757 switch (to) {
758 case 1: str = "lgt"; break;
759 case 2: str = "llt"; break;
760 case 4: str = "eq"; break;
761 case 5: str = "lge"; break;
762 case 6: str = "lle"; break;
763 case 8: str = "gt"; break;
764 case 12: str = "ge"; break;
765 case 16: str = "lt"; break;
766 case 20: str = "le"; break;
767 case 24: str = "ne"; break;
768 case 31: str = "u"; break;
769 }
770
771 return str;
772 }
773
774 std::string generateDisassembly(
775 Addr pc, const loader::SymbolTable *symtab) const override;
776};
777
778
783{
784 protected:
785 int32_t si;
786
788 IntImmTrapOp(const char *mnem, MachInst _machInst, OpClass __opClass)
789 : IntTrapOp(mnem, _machInst, __opClass),
790 si(sext<16>(machInst.si))
791 {
792 }
793
794 std::string generateDisassembly(
795 Addr pc, const loader::SymbolTable *symtab) const override;
796};
797
798} // namespace PowerISA
799} // namespace gem5
800
801#endif //__ARCH_POWER_INSTS_INTEGER_HH__
std::tuple< uint64_t, int64_t > multiplyAdd(int64_t ra, int64_t rb, int64_t rc) const
Compute 128-bit result of 64-bit signed integer multiplication followed by addition.
Definition integer.hh:255
std::tuple< bool, uint64_t, uint64_t > divide(uint64_t ralo, uint64_t rahi, uint64_t rb) const
Compute overflow, 64-bit quotient and 64-bit remainder of 128-bit by 64-bit unsigned integer division...
Definition integer.hh:279
IntArithOp(const char *mnem, MachInst _machInst, OpClass __opClass)
Constructor.
Definition integer.hh:136
std::tuple< uint64_t, uint64_t > multiplyAdd(uint64_t ra, uint64_t rb, uint64_t rc) const
Compute 128-bit result of 64-bit unsigned integer multiplication followed by addition.
Definition integer.hh:235
std::tuple< uint64_t, uint64_t > add(uint64_t ralo, uint64_t rahi, uint64_t rb) const
Definition integer.hh:143
std::tuple< bool, int64_t, int64_t > divide(uint64_t ralo, int64_t rahi, int64_t rb) const
Compute overflow, 64-bit quotient and 64-bit remainder of 128-bit by 64-bit signed integer division.
Definition integer.hh:329
std::tuple< uint64_t, int64_t > add(uint64_t ralo, int64_t rahi, int64_t rb) const
Definition integer.hh:160
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition integer.cc:119
std::tuple< uint64_t, int64_t > multiply(int64_t ra, int64_t rb) const
Definition integer.hh:215
std::tuple< uint64_t, uint64_t > multiply(uint64_t ra, uint64_t rb) const
Compute 128-bit product of 64-bit unsigned integer multiplication based on https://stackoverflow....
Definition integer.hh:192
IntCompOp(const char *mnem, MachInst _machInst, OpClass __opClass)
Constructor.
Definition integer.hh:426
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition integer.cc:394
IntConcatRotateOp(const char *mnem, MachInst _machInst, OpClass __opClass)
Constructor.
Definition integer.hh:692
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition integer.cc:753
uint64_t bitmask(uint32_t begin, uint32_t end) const
Definition integer.hh:707
uint64_t rotate(uint64_t value, uint32_t shift) const
Definition integer.hh:700
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition integer.cc:606
IntConcatShiftOp(const char *mnem, MachInst _machInst, OpClass __opClass)
Constructor.
Definition integer.hh:620
IntDispArithOp(const char *mnem, MachInst _machInst, OpClass __opClass)
Constructor.
Definition integer.hh:404
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition integer.cc:237
IntImmArithOp(const char *mnem, MachInst _machInst, OpClass __opClass)
Constructor.
Definition integer.hh:383
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition integer.cc:177
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition integer.cc:496
IntImmCompLogicOp(const char *mnem, MachInst _machInst, OpClass __opClass)
Constructor.
Definition integer.hh:469
IntImmCompOp(const char *mnem, MachInst _machInst, OpClass __opClass)
Constructor.
Definition integer.hh:448
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition integer.cc:447
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition integer.cc:346
IntImmLogicOp(const char *mnem, MachInst _machInst, OpClass __opClass)
Constructor.
Definition integer.hh:576
IntImmOp(const char *mnem, MachInst _machInst, OpClass __opClass)
Constructor.
Definition integer.hh:116
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition integer.cc:94
IntImmTrapOp(const char *mnem, MachInst _machInst, OpClass __opClass)
Constructor.
Definition integer.hh:788
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition integer.cc:885
int findLeadingZeros(uint64_t rs) const
Definition integer.hh:513
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition integer.cc:282
IntLogicOp(const char *mnem, MachInst _machInst, OpClass __opClass)
Constructor.
Definition integer.hh:488
int findTrailingZeros(uint64_t rs) const
Definition integer.hh:547
int findLeadingZeros(uint32_t rs) const
Definition integer.hh:496
int findTrailingZeros(uint32_t rs) const
Definition integer.hh:530
uint32_t makeCRFieldUnsigned(uint64_t a, uint64_t b, bool so) const
Definition integer.hh:88
uint32_t makeCRFieldSigned(int64_t a, int64_t b, bool so) const
Definition integer.hh:74
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition integer.cc:38
IntOp(const char *mnem, MachInst _machInst, OpClass __opClass)
Constructor.
Definition integer.hh:65
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition integer.cc:668
uint64_t bitmask(uint32_t begin, uint32_t end) const
Definition integer.hh:663
uint64_t rotate(uint32_t value, uint32_t shift) const
Definition integer.hh:652
IntRotateOp(const char *mnem, MachInst _machInst, OpClass __opClass)
Constructor.
Definition integer.hh:644
IntShiftOp(const char *mnem, MachInst _machInst, OpClass __opClass)
Constructor.
Definition integer.hh:598
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition integer.cc:545
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition integer.cc:834
std::string suffix() const
Definition integer.hh:753
bool checkTrap(int64_t a, int64_t b) const
Definition integer.hh:739
IntTrapOp(const char *mnem, MachInst _machInst, OpClass __opClass)
Constructor.
Definition integer.hh:732
PowerStaticInst(const char *mnem, ExtMachInst _machInst, OpClass __opClass)
constexpr int findMsbSet(uint64_t val)
Returns the bit position of the MSB that is set in the input.
Definition bitfield.hh:279
constexpr uint64_t sext(uint64_t val)
Sign-extend an N-bit value to 64 bits.
Definition bitfield.hh:129
constexpr int findLsbSet(uint64_t val)
Returns the bit position of the LSB that is set in the input That function will either use a builtin ...
Definition bitfield.hh:369
Bitfield< 19, 16 > divide
Bitfield< 3, 0 > mask
Definition pcstate.hh:63
Bitfield< 7 > b
Bitfield< 27 > q
Definition misc_types.hh:55
Bitfield< 7 > i
Definition misc_types.hh:67
Bitfield< 29 > c
Definition misc_types.hh:53
Bitfield< 8 > a
Definition misc_types.hh:66
Bitfield< 6, 5 > shift
Definition types.hh:117
Bitfield< 4 > pc
Bitfield< 28 > so
Definition misc.hh:59
Bitfield< 5 > men
Definition types.hh:58
Bitfield< 20, 16 > d1
Definition types.hh:66
Bitfield< 30 > ov
Definition misc.hh:66
uint32_t MachInst
Definition types.hh:44
Bitfield< 20, 16 > ra
Definition types.hh:50
Bitfield< 1 > shn
Definition types.hh:54
Bitfield< 15, 6 > d0
Definition types.hh:65
Bitfield< 5 > mbn
Definition types.hh:56
Bitfield< 1, 0 > d2
Definition types.hh:67
Bitfield< 18 > sum
Definition misc.hh:1346
Copyright (c) 2024 Arm Limited All rights reserved.
Definition binary32.hh:36
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition types.hh:147

Generated on Mon Oct 27 2025 04:12:58 for gem5 by doxygen 1.14.0