GCC Middle and Back End API Reference
machmode.h
Go to the documentation of this file.
1/* Machine mode definitions for GCC; included by rtl.h and tree.h.
2 Copyright (C) 1991-2026 Free Software Foundation, Inc.
3
4This file is part of GCC.
5
6GCC is free software; you can redistribute it and/or modify it under
7the terms of the GNU General Public License as published by the Free
8Software Foundation; either version 3, or (at your option) any later
9version.
10
11GCC is distributed in the hope that it will be useful, but WITHOUT ANY
12WARRANTY; without even the implied warranty of MERCHANTABILITY or
13FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14for more details.
15
16You should have received a copy of the GNU General Public License
17along with GCC; see the file COPYING3. If not see
18<http://www.gnu.org/licenses/>. */
19
20#ifndef HAVE_MACHINE_MODES
21#define HAVE_MACHINE_MODES
22
24
25extern CONST_MODE_SIZE poly_uint16 mode_size[NUM_MACHINE_MODES];
26extern CONST_MODE_PRECISION poly_uint16 mode_precision[NUM_MACHINE_MODES];
27extern const unsigned short mode_inner[NUM_MACHINE_MODES];
28extern CONST_MODE_NUNITS poly_uint16 mode_nunits[NUM_MACHINE_MODES];
29extern CONST_MODE_UNIT_SIZE unsigned char mode_unit_size[NUM_MACHINE_MODES];
30extern const unsigned short mode_unit_precision[NUM_MACHINE_MODES];
31extern const unsigned short mode_next[NUM_MACHINE_MODES];
32extern const unsigned short mode_wider[NUM_MACHINE_MODES];
33extern const unsigned short mode_2xwider[NUM_MACHINE_MODES];
34
35template<typename T>
37{
38 /* For use by the machmode support code only.
39
40 There are cases in which the machmode support code needs to forcibly
41 convert a machine_mode to a specific mode class T, and in which the
42 context guarantees that this is valid without the need for an assert.
43 This can be done using:
44
45 return typename mode_traits<T>::from_int (mode);
46
47 when returning a T and:
48
49 res = T (typename mode_traits<T>::from_int (mode));
50
51 when assigning to a value RES that must be assignment-compatible
52 with (but possibly not the same as) T. */
53#ifdef USE_ENUM_MODES
54 /* Allow direct conversion of enums to specific mode classes only
55 when USE_ENUM_MODES is defined. This is only intended for use
56 by gencondmd, so that it can tell more easily when .md conditions
57 are always false. */
58 typedef machine_mode from_int;
59#else
60 /* Here we use an enum type distinct from machine_mode but with the
61 same range as machine_mode. T should have a constructor that
62 accepts this enum type; it should not have a constructor that
63 accepts machine_mode.
64
65 We use this somewhat indirect approach to avoid too many constructor
66 calls when the compiler is built with -O0. For example, even in
67 unoptimized code, the return statement above would construct the
68 returned T directly from the numerical value of MODE. */
69 enum from_int { dummy = MAX_MACHINE_MODE };
70#endif
71};
72
73template<>
74struct mode_traits<machine_mode>
75{
76 /* machine_mode itself needs no conversion. */
77 typedef machine_mode from_int;
78};
79
80/* Always treat machine modes as fixed-size while compiling code specific
81 to targets that have no variable-size modes. */
82#if defined (IN_TARGET_CODE) && NUM_POLY_INT_COEFFS == 1
83#define ONLY_FIXED_SIZE_MODES 1
84#else
85#define ONLY_FIXED_SIZE_MODES 0
86#endif
87
88/* Get the name of mode MODE as a string. */
89
90extern const char * const mode_name[NUM_MACHINE_MODES];
91#define GET_MODE_NAME(MODE) mode_name[MODE]
92
93/* Mode classes. */
94
95#include "mode-classes.def"
96#define DEF_MODE_CLASS(M) M
98#undef DEF_MODE_CLASS
99#undef MODE_CLASSES
100
101/* Get the general kind of object that mode MODE represents
102 (integer, floating, complex, etc.) */
103
104extern const unsigned char mode_class[NUM_MACHINE_MODES];
105#define GET_MODE_CLASS(MODE) ((enum mode_class) mode_class[MODE])
106
107/* Nonzero if MODE is an integral mode. */
108#define INTEGRAL_MODE_P(MODE) \
109 (GET_MODE_CLASS (MODE) == MODE_INT \
110 || GET_MODE_CLASS (MODE) == MODE_PARTIAL_INT \
111 || GET_MODE_CLASS (MODE) == MODE_COMPLEX_INT \
112 || GET_MODE_CLASS (MODE) == MODE_VECTOR_BOOL \
113 || GET_MODE_CLASS (MODE) == MODE_VECTOR_INT)
114
115/* Nonzero if MODE is a floating-point mode. */
116#define FLOAT_MODE_P(MODE) \
117 (GET_MODE_CLASS (MODE) == MODE_FLOAT \
118 || GET_MODE_CLASS (MODE) == MODE_DECIMAL_FLOAT \
119 || GET_MODE_CLASS (MODE) == MODE_COMPLEX_FLOAT \
120 || GET_MODE_CLASS (MODE) == MODE_VECTOR_FLOAT)
121
122/* Nonzero if MODE is a complex mode. */
123#define COMPLEX_MODE_P(MODE) \
124 (GET_MODE_CLASS (MODE) == MODE_COMPLEX_INT \
125 || GET_MODE_CLASS (MODE) == MODE_COMPLEX_FLOAT)
126
127/* Nonzero if MODE is a vector mode. */
128#define VECTOR_MODE_P(MODE) \
129 (GET_MODE_CLASS (MODE) == MODE_VECTOR_BOOL \
130 || GET_MODE_CLASS (MODE) == MODE_VECTOR_INT \
131 || GET_MODE_CLASS (MODE) == MODE_VECTOR_FLOAT \
132 || GET_MODE_CLASS (MODE) == MODE_VECTOR_FRACT \
133 || GET_MODE_CLASS (MODE) == MODE_VECTOR_UFRACT \
134 || GET_MODE_CLASS (MODE) == MODE_VECTOR_ACCUM \
135 || GET_MODE_CLASS (MODE) == MODE_VECTOR_UACCUM)
136
137/* Nonzero if MODE is a scalar integral mode. */
138#define SCALAR_INT_MODE_P(MODE) \
139 (GET_MODE_CLASS (MODE) == MODE_INT \
140 || GET_MODE_CLASS (MODE) == MODE_PARTIAL_INT)
141
142/* Nonzero if MODE is a scalar floating point mode. */
143#define SCALAR_FLOAT_MODE_P(MODE) \
144 (GET_MODE_CLASS (MODE) == MODE_FLOAT \
145 || GET_MODE_CLASS (MODE) == MODE_DECIMAL_FLOAT)
146
147/* Nonzero if MODE is a decimal floating point mode. */
148#define DECIMAL_FLOAT_MODE_P(MODE) \
149 (GET_MODE_CLASS (MODE) == MODE_DECIMAL_FLOAT)
150
151/* Nonzero if MODE is a scalar fract mode. */
152#define SCALAR_FRACT_MODE_P(MODE) \
153 (GET_MODE_CLASS (MODE) == MODE_FRACT)
154
155/* Nonzero if MODE is a scalar ufract mode. */
156#define SCALAR_UFRACT_MODE_P(MODE) \
157 (GET_MODE_CLASS (MODE) == MODE_UFRACT)
158
159/* Nonzero if MODE is a scalar fract or ufract mode. */
160#define ALL_SCALAR_FRACT_MODE_P(MODE) \
161 (SCALAR_FRACT_MODE_P (MODE) || SCALAR_UFRACT_MODE_P (MODE))
162
163/* Nonzero if MODE is a scalar accum mode. */
164#define SCALAR_ACCUM_MODE_P(MODE) \
165 (GET_MODE_CLASS (MODE) == MODE_ACCUM)
166
167/* Nonzero if MODE is a scalar uaccum mode. */
168#define SCALAR_UACCUM_MODE_P(MODE) \
169 (GET_MODE_CLASS (MODE) == MODE_UACCUM)
170
171/* Nonzero if MODE is a scalar accum or uaccum mode. */
172#define ALL_SCALAR_ACCUM_MODE_P(MODE) \
173 (SCALAR_ACCUM_MODE_P (MODE) || SCALAR_UACCUM_MODE_P (MODE))
174
175/* Nonzero if MODE is a scalar fract or accum mode. */
176#define SIGNED_SCALAR_FIXED_POINT_MODE_P(MODE) \
177 (SCALAR_FRACT_MODE_P (MODE) || SCALAR_ACCUM_MODE_P (MODE))
178
179/* Nonzero if MODE is a scalar ufract or uaccum mode. */
180#define UNSIGNED_SCALAR_FIXED_POINT_MODE_P(MODE) \
181 (SCALAR_UFRACT_MODE_P (MODE) || SCALAR_UACCUM_MODE_P (MODE))
182
183/* Nonzero if MODE is a scalar fract, ufract, accum or uaccum mode. */
184#define ALL_SCALAR_FIXED_POINT_MODE_P(MODE) \
185 (SIGNED_SCALAR_FIXED_POINT_MODE_P (MODE) \
186 || UNSIGNED_SCALAR_FIXED_POINT_MODE_P (MODE))
187
188/* Nonzero if MODE is a scalar/vector fract mode. */
189#define FRACT_MODE_P(MODE) \
190 (GET_MODE_CLASS (MODE) == MODE_FRACT \
191 || GET_MODE_CLASS (MODE) == MODE_VECTOR_FRACT)
192
193/* Nonzero if MODE is a scalar/vector ufract mode. */
194#define UFRACT_MODE_P(MODE) \
195 (GET_MODE_CLASS (MODE) == MODE_UFRACT \
196 || GET_MODE_CLASS (MODE) == MODE_VECTOR_UFRACT)
197
198/* Nonzero if MODE is a scalar/vector fract or ufract mode. */
199#define ALL_FRACT_MODE_P(MODE) \
200 (FRACT_MODE_P (MODE) || UFRACT_MODE_P (MODE))
201
202/* Nonzero if MODE is a scalar/vector accum mode. */
203#define ACCUM_MODE_P(MODE) \
204 (GET_MODE_CLASS (MODE) == MODE_ACCUM \
205 || GET_MODE_CLASS (MODE) == MODE_VECTOR_ACCUM)
206
207/* Nonzero if MODE is a scalar/vector uaccum mode. */
208#define UACCUM_MODE_P(MODE) \
209 (GET_MODE_CLASS (MODE) == MODE_UACCUM \
210 || GET_MODE_CLASS (MODE) == MODE_VECTOR_UACCUM)
211
212/* Nonzero if MODE is a scalar/vector accum or uaccum mode. */
213#define ALL_ACCUM_MODE_P(MODE) \
214 (ACCUM_MODE_P (MODE) || UACCUM_MODE_P (MODE))
215
216/* Nonzero if MODE is a scalar/vector fract or accum mode. */
217#define SIGNED_FIXED_POINT_MODE_P(MODE) \
218 (FRACT_MODE_P (MODE) || ACCUM_MODE_P (MODE))
219
220/* Nonzero if MODE is a scalar/vector ufract or uaccum mode. */
221#define UNSIGNED_FIXED_POINT_MODE_P(MODE) \
222 (UFRACT_MODE_P (MODE) || UACCUM_MODE_P (MODE))
223
224/* Nonzero if MODE is a scalar/vector fract, ufract, accum or uaccum mode. */
225#define ALL_FIXED_POINT_MODE_P(MODE) \
226 (SIGNED_FIXED_POINT_MODE_P (MODE) \
227 || UNSIGNED_FIXED_POINT_MODE_P (MODE))
228
229/* Nonzero if MODE is opaque. */
230#define OPAQUE_MODE_P(MODE) \
231 (GET_MODE_CLASS (MODE) == MODE_OPAQUE)
232
233/* Nonzero if CLASS modes can be widened. */
234#define CLASS_HAS_WIDER_MODES_P(CLASS) \
235 (CLASS == MODE_INT \
236 || CLASS == MODE_PARTIAL_INT \
237 || CLASS == MODE_FLOAT \
238 || CLASS == MODE_DECIMAL_FLOAT \
239 || CLASS == MODE_COMPLEX_FLOAT \
240 || CLASS == MODE_FRACT \
241 || CLASS == MODE_UFRACT \
242 || CLASS == MODE_ACCUM \
243 || CLASS == MODE_UACCUM)
244
245/* The MACHINE_MODE_BITSIZE should be exactly aligned with the type of the
246 machine_mode array in the machmode.h and genmodes.cc. For example as below.
247 +------------------------+-------+
248 | MACHINE_MODE_BITSIZE | 16 |
249 +------------------------+-------+
250 | mode_inter[] | short |
251 | mode_next[] | short |
252 | mode_wider[] | short |
253 | mode_2xwider[] | short |
254 | mode_complex[] | short |
255 | class_narrowest_mode[] | short |
256 +------------------------+-------+
257 */
258#define MACHINE_MODE_BITSIZE 16
259
260/* An optional T (i.e. a T or nothing), where T is some form of mode class. */
261template<typename T>
263{
264public:
265 enum from_int { dummy = MAX_MACHINE_MODE };
266
267 ALWAYS_INLINE constexpr opt_mode () : m_mode (E_VOIDmode) {}
268 ALWAYS_INLINE constexpr opt_mode (const T &m) : m_mode (m) {}
269 template<typename U>
270 ALWAYS_INLINE constexpr opt_mode (const U &m) : m_mode (T (m)) {}
271 template<typename U>
272 ALWAYS_INLINE constexpr opt_mode (const opt_mode<U> &);
273 ALWAYS_INLINE constexpr opt_mode (from_int m) : m_mode (machine_mode (m)) {}
274
275 machine_mode else_void () const;
276 machine_mode else_blk () const { return else_mode (BLKmode); }
277 machine_mode else_mode (machine_mode) const;
278 T require () const;
279
280 bool exists () const;
281 template<typename U> bool exists (U *) const;
282
283 bool operator== (const T &m) const { return m_mode == m; }
284 bool operator!= (const T &m) const { return m_mode != m; }
285
286private:
287 machine_mode m_mode;
288};
289
290template<typename T>
291template<typename U>
292ALWAYS_INLINE constexpr
294 : m_mode (m.exists () ? T (m.require ()) : E_VOIDmode)
295{
296}
297
298/* If the object contains a T, return its enum value, otherwise return
299 E_VOIDmode. */
300
301template<typename T>
302ALWAYS_INLINE machine_mode
304{
305 return m_mode;
306}
307
308/* If the T exists, return its enum value, otherwise return FALLBACK. */
309
310template<typename T>
311inline machine_mode
313{
314 return m_mode == E_VOIDmode ? fallback : m_mode;
315}
316
317/* Assert that the object contains a T and return it. */
318
319template<typename T>
320inline T
322{
323 gcc_checking_assert (m_mode != E_VOIDmode);
324 return typename mode_traits<T>::from_int (m_mode);
325}
326
327/* Return true if the object contains a T rather than nothing. */
328
329template<typename T>
330ALWAYS_INLINE bool
332{
333 return m_mode != E_VOIDmode;
334}
335
336/* Return true if the object contains a T, storing it in *MODE if so. */
337
338template<typename T>
339template<typename U>
340inline bool
341opt_mode<T>::exists (U *mode) const
342{
343 if (m_mode != E_VOIDmode)
344 {
345 *mode = T (typename mode_traits<T>::from_int (m_mode));
346 return true;
347 }
348 return false;
349}
350
351/* A POD version of mode class T. */
352
353template<typename T>
355{
357 typedef typename T::measurement_type measurement_type;
358
359 machine_mode m_mode;
360 ALWAYS_INLINE constexpr
361 operator machine_mode () const { return m_mode; }
362
363 ALWAYS_INLINE constexpr
364 operator T () const { return from_int (m_mode); }
365
366 ALWAYS_INLINE pod_mode &operator = (const T &m) { m_mode = m; return *this; }
367};
368
369/* Return true if mode M has type T. */
370
371template<typename T>
372inline bool
373is_a (machine_mode m)
374{
375 return T::includes_p (m);
376}
377
378template<typename T, typename U>
379inline bool
381{
382 return T::includes_p (m.else_void ());
383}
384
385/* Assert that mode M has type T, and return it in that form. */
386
387template<typename T>
388inline T
389as_a (machine_mode m)
390{
391 gcc_checking_assert (T::includes_p (m));
392 return typename mode_traits<T>::from_int (m);
393}
394
395template<typename T, typename U>
396inline T
398{
399 return as_a <T> (m.else_void ());
400}
401
402/* Convert M to an opt_mode<T>. */
403
404template<typename T>
405inline opt_mode<T>
406dyn_cast (machine_mode m)
407{
408 if (T::includes_p (m))
409 return T (typename mode_traits<T>::from_int (m));
410 return opt_mode<T> ();
411}
412
413template<typename T, typename U>
414inline opt_mode<T>
416{
417 return dyn_cast <T> (m.else_void ());
418}
419
420/* Return true if mode M has type T, storing it as a T in *RESULT
421 if so. */
422
423template<typename T, typename U>
424inline bool
425is_a (machine_mode m, U *result)
426{
427 if (T::includes_p (m))
428 {
429 *result = T (typename mode_traits<T>::from_int (m));
430 return true;
431 }
432 return false;
433}
434
435/* Represents a machine mode that is known to be a SCALAR_INT_MODE_P. */
437{
438public:
440 typedef unsigned short measurement_type;
441
443
444 ALWAYS_INLINE constexpr
445 scalar_int_mode (from_int m) : m_mode (machine_mode (m)) {}
446
447 ALWAYS_INLINE constexpr operator machine_mode () const { return m_mode; }
448
449 static bool includes_p (machine_mode);
450
451protected:
452 machine_mode m_mode;
453};
454
455/* Return true if M is a scalar_int_mode. */
456
457inline bool
459{
460 return SCALAR_INT_MODE_P (m);
461}
462
463/* Represents a machine mode that is known to be a SCALAR_FLOAT_MODE_P. */
465{
466public:
468 typedef unsigned short measurement_type;
469
471
472 ALWAYS_INLINE constexpr
473 scalar_float_mode (from_int m) : m_mode (machine_mode (m)) {}
474
475 ALWAYS_INLINE constexpr operator machine_mode () const { return m_mode; }
476
477 static bool includes_p (machine_mode);
478
479protected:
480 machine_mode m_mode;
481};
482
483/* Return true if M is a scalar_float_mode. */
484
485inline bool
487{
488 return SCALAR_FLOAT_MODE_P (m);
489}
490
491/* Represents a machine mode that is known to be scalar. */
493{
494public:
496 typedef unsigned short measurement_type;
497
499
500 ALWAYS_INLINE constexpr
501 scalar_mode (from_int m) : m_mode (machine_mode (m)) {}
502
503 ALWAYS_INLINE constexpr
505
506 ALWAYS_INLINE constexpr
508
509 ALWAYS_INLINE constexpr
511
512 ALWAYS_INLINE constexpr operator machine_mode () const { return m_mode; }
513
514 static bool includes_p (machine_mode);
515
516protected:
517 machine_mode m_mode;
518};
519
520/* Return true if M represents some kind of scalar value. */
521
522inline bool
524{
525 switch (GET_MODE_CLASS (m))
526 {
527 case MODE_INT:
528 case MODE_PARTIAL_INT:
529 case MODE_FRACT:
530 case MODE_UFRACT:
531 case MODE_ACCUM:
532 case MODE_UACCUM:
533 case MODE_FLOAT:
534 case MODE_DECIMAL_FLOAT:
535 return true;
536 default:
537 return false;
538 }
539}
540
541/* Represents a machine mode that is known to be a COMPLEX_MODE_P. */
543{
544public:
546 typedef unsigned short measurement_type;
547
549
550 ALWAYS_INLINE constexpr
551 complex_mode (from_int m) : m_mode (machine_mode (m)) {}
552
553 ALWAYS_INLINE constexpr operator machine_mode () const { return m_mode; }
554
555 static bool includes_p (machine_mode);
556
557protected:
558 machine_mode m_mode;
559};
560
561/* Return true if M is a complex_mode. */
562
563inline bool
565{
566 return COMPLEX_MODE_P (m);
567}
568
569/* Return the base GET_MODE_SIZE value for MODE. */
570
572mode_to_bytes (machine_mode mode)
573{
574#if GCC_VERSION >= 4001
575 return (__builtin_constant_p (mode)
576 ? mode_size_inline (mode) : mode_size[mode]);
577#else
578 return mode_size[mode];
579#endif
580}
581
582/* Return the base GET_MODE_BITSIZE value for MODE. */
583
585mode_to_bits (machine_mode mode)
586{
587 return mode_to_bytes (mode) * BITS_PER_UNIT;
588}
589
590/* Return the base GET_MODE_PRECISION value for MODE. */
591
593mode_to_precision (machine_mode mode)
594{
595 return mode_precision[mode];
596}
597
598/* Return the base GET_MODE_INNER value for MODE. */
599
601mode_to_inner (machine_mode mode)
602{
603#if GCC_VERSION >= 4001
604 return scalar_mode::from_int (__builtin_constant_p (mode)
605 ? mode_inner_inline (mode)
606 : mode_inner[mode]);
607#else
608 return scalar_mode::from_int (mode_inner[mode]);
609#endif
610}
611
612/* Return the base GET_MODE_UNIT_SIZE value for MODE. */
613
614ALWAYS_INLINE unsigned char
615mode_to_unit_size (machine_mode mode)
616{
617#if GCC_VERSION >= 4001
618 return (__builtin_constant_p (mode)
619 ? mode_unit_size_inline (mode) : mode_unit_size[mode]);
620#else
621 return mode_unit_size[mode];
622#endif
623}
624
625/* Return the base GET_MODE_UNIT_PRECISION value for MODE. */
626
627ALWAYS_INLINE unsigned short
628mode_to_unit_precision (machine_mode mode)
629{
630#if GCC_VERSION >= 4001
631 return (__builtin_constant_p (mode)
632 ? mode_unit_precision_inline (mode) : mode_unit_precision[mode]);
633#else
634 return mode_unit_precision[mode];
635#endif
636}
637
638/* Return the base GET_MODE_NUNITS value for MODE. */
639
641mode_to_nunits (machine_mode mode)
642{
643#if GCC_VERSION >= 4001
644 return (__builtin_constant_p (mode)
645 ? mode_nunits_inline (mode) : mode_nunits[mode]);
646#else
647 return mode_nunits[mode];
648#endif
649}
650
651/* Get the size in bytes of an object of mode MODE. */
652
653#if ONLY_FIXED_SIZE_MODES
654#define GET_MODE_SIZE(MODE) ((unsigned short) mode_to_bytes (MODE).coeffs[0])
655#else
657GET_MODE_SIZE (machine_mode mode)
658{
659 return mode_to_bytes (mode);
660}
661
662template<typename T>
664GET_MODE_SIZE (const T &mode)
665{
666 return mode_to_bytes (mode);
667}
668
669template<typename T>
671GET_MODE_SIZE (const T &mode)
672{
673 return mode_to_bytes (mode).coeffs[0];
674}
675#endif
676
677/* Get the size in bits of an object of mode MODE. */
678
679#if ONLY_FIXED_SIZE_MODES
680#define GET_MODE_BITSIZE(MODE) ((unsigned short) mode_to_bits (MODE).coeffs[0])
681#else
683GET_MODE_BITSIZE (machine_mode mode)
684{
685 return mode_to_bits (mode);
686}
687
688template<typename T>
690GET_MODE_BITSIZE (const T &mode)
691{
692 return mode_to_bits (mode);
693}
694
695template<typename T>
697GET_MODE_BITSIZE (const T &mode)
698{
699 return mode_to_bits (mode).coeffs[0];
700}
701#endif
702
703/* Get the number of value bits of an object of mode MODE. */
704
705#if ONLY_FIXED_SIZE_MODES
706#define GET_MODE_PRECISION(MODE) \
707 ((unsigned short) mode_to_precision (MODE).coeffs[0])
708#else
710GET_MODE_PRECISION (machine_mode mode)
711{
712 return mode_to_precision (mode);
713}
714
715template<typename T>
717GET_MODE_PRECISION (const T &mode)
718{
719 return mode_to_precision (mode);
720}
721
722template<typename T>
724GET_MODE_PRECISION (const T &mode)
725{
726 return mode_to_precision (mode).coeffs[0];
727}
728#endif
729
730/* Get the number of integral bits of an object of mode MODE. */
731extern CONST_MODE_IBIT unsigned char mode_ibit[NUM_MACHINE_MODES];
732#define GET_MODE_IBIT(MODE) mode_ibit[MODE]
733
734/* Get the number of fractional bits of an object of mode MODE. */
735extern CONST_MODE_FBIT unsigned char mode_fbit[NUM_MACHINE_MODES];
736#define GET_MODE_FBIT(MODE) mode_fbit[MODE]
737
738/* Get a bitmask containing 1 for all bits in a word
739 that fit within mode MODE. */
740
741extern CONST_MODE_MASK unsigned HOST_WIDE_INT
742 mode_mask_array[NUM_MACHINE_MODES];
743
744#define GET_MODE_MASK(MODE) mode_mask_array[MODE]
745
746/* Return the mode of the basic parts of MODE. For vector modes this is the
747 mode of the vector elements. For complex modes it is the mode of the real
748 and imaginary parts. For other modes it is MODE itself. */
749
750#define GET_MODE_INNER(MODE) (mode_to_inner (MODE))
751
752/* Get the size in bytes or bits of the basic parts of an
753 object of mode MODE. */
754
755#define GET_MODE_UNIT_SIZE(MODE) mode_to_unit_size (MODE)
756
757#define GET_MODE_UNIT_BITSIZE(MODE) \
758 ((unsigned short) (GET_MODE_UNIT_SIZE (MODE) * BITS_PER_UNIT))
759
760#define GET_MODE_UNIT_PRECISION(MODE) (mode_to_unit_precision (MODE))
761
762/* Get the number of units in an object of mode MODE. This is 2 for
763 complex modes and the number of elements for vector modes. */
764
765#if ONLY_FIXED_SIZE_MODES
766#define GET_MODE_NUNITS(MODE) (mode_to_nunits (MODE).coeffs[0])
767#else
769GET_MODE_NUNITS (machine_mode mode)
770{
771 return mode_to_nunits (mode);
772}
773
774template<typename T>
776GET_MODE_NUNITS (const T &mode)
777{
778 return mode_to_nunits (mode);
779}
780
781template<typename T>
783GET_MODE_NUNITS (const T &mode)
784{
785 return mode_to_nunits (mode).coeffs[0];
786}
787#endif
788
789/* Get the next natural mode (not narrower, eg, QI -> HI -> SI -> DI -> TI
790 or HF -> BF -> SF -> DF -> XF -> TF). */
791
792template<typename T>
795{
796 return typename opt_mode<T>::from_int (mode_next[m]);
797}
798
799/* Get the next wider mode (eg, QI -> HI -> SI -> DI -> TI
800 or { HF, BF } -> SF -> DF -> XF -> TF).
801 This is similar to GET_MODE_NEXT_MODE, but while GET_MODE_NEXT_MODE
802 can include mode that have the same precision (e.g.
803 GET_MODE_NEXT_MODE (HFmode) can be BFmode even when both have the same
804 precision), this one will skip those. And always VOIDmode for
805 modes whose class is !CLASS_HAS_WIDER_MODES_P. */
806
807template<typename T>
810{
811 return typename opt_mode<T>::from_int (mode_wider[m]);
812}
813
814/* For scalars, this is a mode with twice the precision. For vectors,
815 this is a mode with the same inner mode but with twice the elements. */
816
817template<typename T>
820{
821 return typename opt_mode<T>::from_int (mode_2xwider[m]);
822}
823
824/* Get the complex mode from the component mode. */
825extern const unsigned short mode_complex[NUM_MACHINE_MODES];
826#define GET_MODE_COMPLEX_MODE(MODE) ((machine_mode) mode_complex[MODE])
827
828/* Represents a machine mode that must have a fixed size. The main
829 use of this class is to represent the modes of objects that always
830 have static storage duration, such as constant pool entries.
831 (No current target supports the concept of variable-size static data.) */
833{
834public:
836 typedef unsigned short measurement_type;
837
839
840 ALWAYS_INLINE constexpr
841 fixed_size_mode (from_int m) : m_mode (machine_mode (m)) {}
842
843 ALWAYS_INLINE constexpr
845
846 ALWAYS_INLINE constexpr
848
849 ALWAYS_INLINE constexpr
851
852 ALWAYS_INLINE constexpr
854
855 ALWAYS_INLINE constexpr
857
858 ALWAYS_INLINE constexpr
860
861 ALWAYS_INLINE constexpr operator machine_mode () const { return m_mode; }
862
863 static bool includes_p (machine_mode);
864
865protected:
866 machine_mode m_mode;
867};
868
869/* Return true if MODE has a fixed size. */
870
871inline bool
873{
874 return mode_to_bytes (mode).is_constant ();
875}
876
877/* Wrapper for mode arguments to target macros, so that if a target
878 doesn't need polynomial-sized modes, its header file can continue
879 to treat everything as fixed_size_mode. This should go away once
880 macros are moved to target hooks. It shouldn't be used in other
881 contexts. */
882#if NUM_POLY_INT_COEFFS == 1
883#define MACRO_MODE(MODE) (as_a <fixed_size_mode> (MODE))
884#else
885#define MACRO_MODE(MODE) (MODE)
886#endif
887
889
890/* Return the machine mode to use for a MODE_INT of SIZE bits, if one
891 exists. If LIMIT is nonzero, modes wider than MAX_FIXED_MODE_SIZE
892 will not be used. */
893
896{
897 return dyn_cast <scalar_int_mode> (mode_for_size (size, MODE_INT, limit));
898}
899
900/* Return the machine mode to use for a MODE_FLOAT of SIZE bits, if one
901 exists. */
902
905{
906 return dyn_cast <scalar_float_mode> (mode_for_size (size, MODE_FLOAT, 0));
907}
908
909/* Likewise for MODE_DECIMAL_FLOAT. */
910
913{
915 (mode_for_size (size, MODE_DECIMAL_FLOAT, 0));
916}
917
919
920/* Find the narrowest integer mode that contains at least SIZE bits,
921 if such a mode exists. */
922
928
929/* Parses a machine mode from NAME. If successful the machine mode is stored
930 into RESULT and true is returned. Otherwise false is returned. */
931
932inline bool
933parse_machine_mode (const char *name, machine_mode *result)
934{
935 for (unsigned i = 0; i < NUM_MACHINE_MODES; i++)
936 if (strcmp (GET_MODE_NAME (i), name) == 0)
937 {
938 *result = (machine_mode) i;
939 return true;
940 }
941 return false;
942}
943
944extern opt_scalar_int_mode int_mode_for_mode (machine_mode);
945extern opt_machine_mode bitwise_mode_for_mode (machine_mode);
948 poly_uint64 = 0);
949extern opt_machine_mode related_int_vector_mode (machine_mode);
950
951/* A class for iterating through possible bitfield modes. */
953{
954public:
955 bit_field_mode_iterator (HOST_WIDE_INT, HOST_WIDE_INT,
957 unsigned int, bool);
958 bool next_mode (scalar_int_mode *);
959 bool prefer_smaller_modes ();
960
961private:
963 /* We use signed values here because the bit position can be negative
964 for invalid input such as gcc.dg/pr48335-8.c. */
965 HOST_WIDE_INT m_bitsize;
966 HOST_WIDE_INT m_bitpos;
969 unsigned int m_align;
972};
973
974/* Find the best mode to use to access a bit field. */
975
976extern bool get_best_mode (HOST_WIDE_INT, HOST_WIDE_INT,
977 poly_uint64, poly_uint64, unsigned int,
978 unsigned HOST_WIDE_INT, bool, scalar_int_mode *);
979
980/* Determine alignment, 1<=result<=BIGGEST_ALIGNMENT. */
981
982extern CONST_MODE_BASE_ALIGN unsigned short mode_base_align[NUM_MACHINE_MODES];
983
984extern unsigned get_mode_alignment (machine_mode);
985
986#define GET_MODE_ALIGNMENT(MODE) get_mode_alignment (MODE)
987
988/* For each class, get the narrowest mode in that class. */
989
990extern const unsigned short class_narrowest_mode[MAX_MODE_CLASS];
991#define GET_CLASS_NARROWEST_MODE(CLASS) \
992 ((machine_mode) class_narrowest_mode[CLASS])
993
994/* The narrowest full integer mode available on the target. */
995
996#define NARROWEST_INT_MODE \
997 (scalar_int_mode \
998 (scalar_int_mode::from_int (class_narrowest_mode[MODE_INT])))
999
1000/* Return the narrowest mode in T's class. */
1001
1002template<typename T>
1003inline T
1005{
1006 return typename mode_traits<T>::from_int
1008}
1009
1010/* Define the integer modes whose sizes are BITS_PER_UNIT and BITS_PER_WORD
1011 and the mode whose class is Pmode and whose size is POINTER_SIZE. */
1012
1016
1017/* Target-dependent machine mode initialization - in insn-modes.cc. */
1018extern void init_adjust_machine_modes (void);
1019
1020#define TRULY_NOOP_TRUNCATION_MODES_P(MODE1, MODE2) \
1021 (targetm.truly_noop_truncation (GET_MODE_PRECISION (MODE1), \
1022 GET_MODE_PRECISION (MODE2)))
1023
1024/* Return true if MODE is a scalar integer mode that fits in a
1025 HOST_WIDE_INT. */
1026
1027inline bool
1028HWI_COMPUTABLE_MODE_P (machine_mode mode)
1029{
1030 machine_mode mme = mode;
1031 return (SCALAR_INT_MODE_P (mme)
1032 && mode_to_precision (mme).coeffs[0] <= HOST_BITS_PER_WIDE_INT);
1033}
1034
1035inline bool
1040
1042 /* These parts are initialized by genmodes output */
1043 unsigned int bitsize;
1045 /* RID_* is RID_INTN_BASE + index into this array */
1046};
1047
1048/* This is also in tree.h. genmodes.cc guarantees the're sorted from
1049 smallest bitsize to largest bitsize. */
1050extern bool int_n_enabled_p[NUM_INT_N_ENTS];
1051extern const int_n_data_t int_n_data[NUM_INT_N_ENTS];
1052
1053/* Return true if MODE has class MODE_INT, storing it as a scalar_int_mode
1054 in *INT_MODE if so. */
1055
1056template<typename T>
1057inline bool
1058is_int_mode (machine_mode mode, T *int_mode)
1059{
1060 if (GET_MODE_CLASS (mode) == MODE_INT)
1061 {
1062 *int_mode = scalar_int_mode (scalar_int_mode::from_int (mode));
1063 return true;
1064 }
1065 return false;
1066}
1067
1068/* Return true if MODE has class MODE_FLOAT, storing it as a
1069 scalar_float_mode in *FLOAT_MODE if so. */
1070
1071template<typename T>
1072inline bool
1073is_float_mode (machine_mode mode, T *float_mode)
1074{
1075 if (GET_MODE_CLASS (mode) == MODE_FLOAT)
1076 {
1077 *float_mode = scalar_float_mode (scalar_float_mode::from_int (mode));
1078 return true;
1079 }
1080 return false;
1081}
1082
1083/* Return true if MODE has class MODE_COMPLEX_INT, storing it as
1084 a complex_mode in *CMODE if so. */
1085
1086template<typename T>
1087inline bool
1088is_complex_int_mode (machine_mode mode, T *cmode)
1089{
1090 if (GET_MODE_CLASS (mode) == MODE_COMPLEX_INT)
1091 {
1092 *cmode = complex_mode (complex_mode::from_int (mode));
1093 return true;
1094 }
1095 return false;
1096}
1097
1098/* Return true if MODE has class MODE_COMPLEX_FLOAT, storing it as
1099 a complex_mode in *CMODE if so. */
1100
1101template<typename T>
1102inline bool
1103is_complex_float_mode (machine_mode mode, T *cmode)
1104{
1105 if (GET_MODE_CLASS (mode) == MODE_COMPLEX_FLOAT)
1106 {
1107 *cmode = complex_mode (complex_mode::from_int (mode));
1108 return true;
1109 }
1110 return false;
1111}
1112
1113/* Return true if MODE is a scalar integer mode with a precision
1114 smaller than LIMIT's precision. */
1115
1116inline bool
1117is_narrower_int_mode (machine_mode mode, scalar_int_mode limit)
1118{
1119 scalar_int_mode int_mode;
1120 return (is_a <scalar_int_mode> (mode, &int_mode)
1121 && GET_MODE_PRECISION (int_mode) < GET_MODE_PRECISION (limit));
1122}
1123
1125{
1126 /* Start mode iterator *ITER at the first mode in class MCLASS, if any. */
1127
1128 template<typename T>
1129 inline void
1130 start (opt_mode<T> *iter, enum mode_class mclass)
1131 {
1132 if (GET_CLASS_NARROWEST_MODE (mclass) == E_VOIDmode)
1133 *iter = opt_mode<T> ();
1134 else
1135 *iter = as_a<T> (GET_CLASS_NARROWEST_MODE (mclass));
1136 }
1137
1138 inline void
1139 start (machine_mode *iter, enum mode_class mclass)
1140 {
1141 *iter = GET_CLASS_NARROWEST_MODE (mclass);
1142 }
1143
1144 /* Return true if mode iterator *ITER has not reached the end. */
1145
1146 template<typename T>
1147 inline bool
1149 {
1150 return iter->exists ();
1151 }
1152
1153 inline bool
1154 iterate_p (machine_mode *iter)
1155 {
1156 return *iter != E_VOIDmode;
1157 }
1158
1159 /* Set mode iterator *ITER to the next mode in the same class,
1160 if any. */
1161
1162 template<typename T>
1163 inline void
1165 {
1166 *iter = GET_MODE_NEXT_MODE (iter->require ());
1167 }
1168
1169 inline void
1170 get_next (machine_mode *iter)
1171 {
1172 *iter = GET_MODE_NEXT_MODE (*iter).else_void ();
1173 }
1174
1175 /* Set mode iterator *ITER to the next mode in the same class.
1176 Such a mode is known to exist. */
1177
1178 template<typename T>
1179 inline void
1181 {
1182 *iter = GET_MODE_NEXT_MODE (*iter).require ();
1183 }
1184
1185 /* Set mode iterator *ITER to the next wider mode in the same class,
1186 if any. */
1187
1188 template<typename T>
1189 inline void
1191 {
1192 *iter = GET_MODE_WIDER_MODE (iter->require ());
1193 }
1194
1195 inline void
1196 get_wider (machine_mode *iter)
1197 {
1198 *iter = GET_MODE_WIDER_MODE (*iter).else_void ();
1199 }
1200
1201 /* Set mode iterator *ITER to the next wider mode in the same class.
1202 Such a mode is known to exist. */
1203
1204 template<typename T>
1205 inline void
1207 {
1208 *iter = GET_MODE_WIDER_MODE (*iter).require ();
1209 }
1210
1211 /* Set mode iterator *ITER to the mode that is two times wider than the
1212 current one, if such a mode exists. */
1213
1214 template<typename T>
1215 inline void
1217 {
1218 *iter = GET_MODE_2XWIDER_MODE (iter->require ());
1219 }
1220
1221 inline void
1222 get_2xwider (machine_mode *iter)
1223 {
1224 *iter = GET_MODE_2XWIDER_MODE (*iter).else_void ();
1225 }
1226}
1227
1228/* Make ITERATOR iterate over all the modes in mode class CLASS,
1229 from narrowest to widest. */
1230#define FOR_EACH_MODE_IN_CLASS(ITERATOR, CLASS) \
1231 for (mode_iterator::start (&(ITERATOR), CLASS); \
1232 mode_iterator::iterate_p (&(ITERATOR)); \
1233 mode_iterator::get_next (&(ITERATOR)))
1234
1235/* Make ITERATOR iterate over all the modes in the range [START, END),
1236 in order of increasing width. */
1237#define FOR_EACH_MODE(ITERATOR, START, END) \
1238 for ((ITERATOR) = (START); \
1239 (ITERATOR) != (END); \
1240 mode_iterator::get_known_next (&(ITERATOR)))
1241
1242/* Make ITERATOR iterate over START and all non-narrower modes in the same
1243 class, in order of increasing width. */
1244#define FOR_EACH_MODE_FROM(ITERATOR, START) \
1245 for ((ITERATOR) = (START); \
1246 mode_iterator::iterate_p (&(ITERATOR)); \
1247 mode_iterator::get_next (&(ITERATOR)))
1248
1249/* Make ITERATOR iterate over START and all wider modes in the same
1250 class, in order of strictly increasing width. */
1251#define FOR_EACH_WIDER_MODE_FROM(ITERATOR, START) \
1252 for ((ITERATOR) = (START); \
1253 mode_iterator::iterate_p (&(ITERATOR)); \
1254 mode_iterator::get_wider (&(ITERATOR)))
1255
1256/* Make ITERATOR iterate over modes in the range [NARROWEST, END)
1257 in order of increasing width, where NARROWEST is the narrowest mode
1258 in END's class. */
1259#define FOR_EACH_MODE_UNTIL(ITERATOR, END) \
1260 FOR_EACH_MODE (ITERATOR, get_narrowest_mode (END), END)
1261
1262/* Make ITERATOR iterate over modes in the same class as MODE, in order
1263 of non-decreasing width. Start at next such mode after START,
1264 or don't iterate at all if there is no such mode. */
1265#define FOR_EACH_NEXT_MODE(ITERATOR, START) \
1266 for ((ITERATOR) = (START), mode_iterator::get_next (&(ITERATOR)); \
1267 mode_iterator::iterate_p (&(ITERATOR)); \
1268 mode_iterator::get_next (&(ITERATOR)))
1269
1270/* Make ITERATOR iterate over modes in the same class as MODE, in order
1271 of increasing width. Start at the first mode wider than START,
1272 or don't iterate at all if there is no wider mode. */
1273#define FOR_EACH_WIDER_MODE(ITERATOR, START) \
1274 for ((ITERATOR) = (START), mode_iterator::get_wider (&(ITERATOR)); \
1275 mode_iterator::iterate_p (&(ITERATOR)); \
1276 mode_iterator::get_wider (&(ITERATOR)))
1277
1278/* Make ITERATOR iterate over modes in the same class as MODE, in order
1279 of increasing width, and with each mode being twice the width of the
1280 previous mode. Start at the mode that is two times wider than START,
1281 or don't iterate at all if there is no such mode. */
1282#define FOR_EACH_2XWIDER_MODE(ITERATOR, START) \
1283 for ((ITERATOR) = (START), mode_iterator::get_2xwider (&(ITERATOR)); \
1284 mode_iterator::iterate_p (&(ITERATOR)); \
1285 mode_iterator::get_2xwider (&(ITERATOR)))
1286
1287template<typename T>
1288void
1290{
1291}
1292
1293template<typename T>
1294void
1296{
1297}
1298
1299template<typename T>
1300void
1304
1305#endif /* not HAVE_MACHINE_MODES */
void gt_pch_nx(bbitmap< N > *)
Definition bbitmap.h:226
void gt_ggc_mx(bbitmap< N > *)
Definition bbitmap.h:220
bool prefer_smaller_modes()
Definition stor-layout.cc:3139
poly_int64 m_bitregion_end
Definition machmode.h:968
HOST_WIDE_INT m_bitsize
Definition machmode.h:965
bit_field_mode_iterator(HOST_WIDE_INT, HOST_WIDE_INT, poly_int64, poly_int64, unsigned int, bool)
Definition stor-layout.cc:3058
opt_scalar_int_mode m_mode
Definition machmode.h:962
poly_int64 m_bitregion_start
Definition machmode.h:967
unsigned int m_align
Definition machmode.h:969
bool next_mode(scalar_int_mode *)
Definition stor-layout.cc:3087
HOST_WIDE_INT m_bitpos
Definition machmode.h:966
bool m_volatilep
Definition machmode.h:970
int m_count
Definition machmode.h:971
Definition machmode.h:543
ALWAYS_INLINE constexpr complex_mode(from_int m)
Definition machmode.h:551
unsigned short measurement_type
Definition machmode.h:546
static bool includes_p(machine_mode)
Definition machmode.h:564
ALWAYS_INLINE complex_mode()
Definition machmode.h:548
machine_mode m_mode
Definition machmode.h:558
mode_traits< complex_mode >::from_int from_int
Definition machmode.h:545
ALWAYS_INLINE constexpr fixed_size_mode(const scalar_mode &m)
Definition machmode.h:844
ALWAYS_INLINE constexpr fixed_size_mode(from_int m)
Definition machmode.h:841
ALWAYS_INLINE fixed_size_mode()
Definition machmode.h:838
unsigned short measurement_type
Definition machmode.h:836
ALWAYS_INLINE constexpr fixed_size_mode(const scalar_mode_pod &m)
Definition machmode.h:853
ALWAYS_INLINE constexpr fixed_size_mode(const scalar_int_mode &m)
Definition machmode.h:847
mode_traits< fixed_size_mode >::from_int from_int
Definition machmode.h:835
ALWAYS_INLINE constexpr fixed_size_mode(const scalar_float_mode &m)
Definition machmode.h:850
ALWAYS_INLINE constexpr fixed_size_mode(const scalar_int_mode_pod &m)
Definition machmode.h:856
static bool includes_p(machine_mode)
Definition machmode.h:872
ALWAYS_INLINE constexpr fixed_size_mode(const complex_mode &m)
Definition machmode.h:859
machine_mode m_mode
Definition machmode.h:866
Definition machmode.h:263
bool exists(U *) const
Definition machmode.h:341
ALWAYS_INLINE constexpr opt_mode(const opt_mode< U > &)
Definition machmode.h:293
ALWAYS_INLINE constexpr opt_mode(const U &m)
Definition machmode.h:270
bool operator==(const T &m) const
Definition machmode.h:283
bool exists() const
Definition machmode.h:331
from_int
Definition machmode.h:265
@ dummy
Definition machmode.h:265
ALWAYS_INLINE constexpr opt_mode(from_int m)
Definition machmode.h:273
ALWAYS_INLINE constexpr opt_mode()
Definition machmode.h:267
ALWAYS_INLINE constexpr opt_mode(const T &m)
Definition machmode.h:268
machine_mode else_mode(machine_mode) const
bool operator!=(const T &m) const
Definition machmode.h:284
machine_mode else_blk() const
Definition machmode.h:276
machine_mode else_void() const
Definition machmode.h:303
machine_mode m_mode
Definition machmode.h:287
T require() const
Definition machmode.h:321
bool is_constant() const
Definition poly-int.h:557
C coeffs[N]
Definition poly-int.h:433
Definition machmode.h:465
ALWAYS_INLINE scalar_float_mode()
Definition machmode.h:470
unsigned short measurement_type
Definition machmode.h:468
machine_mode m_mode
Definition machmode.h:480
mode_traits< scalar_float_mode >::from_int from_int
Definition machmode.h:467
ALWAYS_INLINE constexpr scalar_float_mode(from_int m)
Definition machmode.h:473
static bool includes_p(machine_mode)
Definition machmode.h:486
Definition machmode.h:437
mode_traits< scalar_int_mode >::from_int from_int
Definition machmode.h:439
machine_mode m_mode
Definition machmode.h:452
ALWAYS_INLINE scalar_int_mode()
Definition machmode.h:442
unsigned short measurement_type
Definition machmode.h:440
ALWAYS_INLINE constexpr scalar_int_mode(from_int m)
Definition machmode.h:445
static bool includes_p(machine_mode)
Definition machmode.h:458
Definition machmode.h:493
ALWAYS_INLINE constexpr scalar_mode(const scalar_float_mode &m)
Definition machmode.h:507
ALWAYS_INLINE constexpr scalar_mode(const scalar_int_mode_pod &m)
Definition machmode.h:510
mode_traits< scalar_mode >::from_int from_int
Definition machmode.h:495
machine_mode m_mode
Definition machmode.h:517
ALWAYS_INLINE scalar_mode()
Definition machmode.h:498
ALWAYS_INLINE constexpr scalar_mode(const scalar_int_mode &m)
Definition machmode.h:504
static bool includes_p(machine_mode)
Definition machmode.h:523
ALWAYS_INLINE constexpr scalar_mode(from_int m)
Definition machmode.h:501
unsigned short measurement_type
Definition machmode.h:496
opt_mode< scalar_float_mode > opt_scalar_float_mode
Definition coretypes.h:67
pod_mode< scalar_mode > scalar_mode_pod
Definition coretypes.h:69
pod_mode< scalar_int_mode > scalar_int_mode_pod
Definition coretypes.h:70
opt_mode< scalar_int_mode > opt_scalar_int_mode
Definition coretypes.h:66
void(*) gt_pointer_operator(void *, void *, void *)
Definition coretypes.h:469
scalar_int_mode word_mode
Definition emit-rtl.cc:78
scalar_int_mode byte_mode
Definition emit-rtl.cc:77
scalar_int_mode ptr_mode
Definition emit-rtl.cc:79
mode_class
Definition genmodes.cc:29
@ MAX_MODE_CLASS
Definition genmodes.cc:29
@ MODE_CLASSES
Definition genmodes.cc:29
fallback
Definition gimplify.h:29
#define HOST_BITS_PER_WIDE_INT
Definition hwint.h:53
bool is_a(U *p)
Definition is-a.h:230
T as_a(U *p)
Definition is-a.h:253
T dyn_cast(U *p)
Definition is-a.h:280
CONST_MODE_UNIT_SIZE unsigned char mode_unit_size[NUM_MACHINE_MODES]
#define GET_CLASS_NARROWEST_MODE(CLASS)
Definition machmode.h:991
ALWAYS_INLINE unsigned short mode_to_unit_precision(machine_mode mode)
Definition machmode.h:628
opt_machine_mode bitwise_mode_for_mode(machine_mode)
Definition stor-layout.cc:416
CONST_MODE_IBIT unsigned char mode_ibit[NUM_MACHINE_MODES]
bool get_best_mode(HOST_WIDE_INT, HOST_WIDE_INT, poly_uint64, poly_uint64, unsigned int, unsigned HOST_WIDE_INT, bool, scalar_int_mode *)
Definition stor-layout.cc:3174
opt_scalar_int_mode int_mode_for_mode(machine_mode)
Definition stor-layout.cc:372
opt_machine_mode mode_for_size(poly_uint64, enum mode_class, int)
Definition stor-layout.cc:302
#define GET_MODE_CLASS(MODE)
Definition machmode.h:105
opt_machine_mode related_vector_mode(machine_mode, scalar_mode, poly_uint64=0)
Definition stor-layout.cc:563
bool parse_machine_mode(const char *name, machine_mode *result)
Definition machmode.h:933
const unsigned short class_narrowest_mode[MAX_MODE_CLASS]
unsigned get_mode_alignment(machine_mode)
Definition stor-layout.cc:594
ALWAYS_INLINE poly_uint16 GET_MODE_SIZE(machine_mode mode)
Definition machmode.h:657
CONST_MODE_SIZE poly_uint16 mode_size[NUM_MACHINE_MODES]
#define COMPLEX_MODE_P(MODE)
Definition machmode.h:123
bool is_complex_float_mode(machine_mode mode, T *cmode)
Definition machmode.h:1103
const unsigned short mode_complex[NUM_MACHINE_MODES]
CONST_MODE_MASK unsigned HOST_WIDE_INT mode_mask_array[NUM_MACHINE_MODES]
#define GET_MODE_NAME(MODE)
Definition machmode.h:91
#define SCALAR_INT_MODE_P(MODE)
Definition machmode.h:138
ALWAYS_INLINE opt_mode< T > GET_MODE_2XWIDER_MODE(const T &m)
Definition machmode.h:819
ALWAYS_INLINE unsigned char mode_to_unit_size(machine_mode mode)
Definition machmode.h:615
T get_narrowest_mode(T mode)
Definition machmode.h:1004
const unsigned short mode_wider[NUM_MACHINE_MODES]
const unsigned short mode_unit_precision[NUM_MACHINE_MODES]
ALWAYS_INLINE opt_mode< T > GET_MODE_WIDER_MODE(const T &m)
Definition machmode.h:809
opt_scalar_float_mode decimal_float_mode_for_size(unsigned int size)
Definition machmode.h:912
void init_adjust_machine_modes(void)
opt_machine_mode related_int_vector_mode(machine_mode)
Definition stor-layout.cc:580
opt_scalar_float_mode float_mode_for_size(poly_uint64 size)
Definition machmode.h:904
bool int_n_enabled_p[NUM_INT_N_ENTS]
Definition tree.cc:291
ALWAYS_INLINE poly_uint16 GET_MODE_PRECISION(machine_mode mode)
Definition machmode.h:710
opt_machine_mode mode_for_vector(scalar_mode, poly_uint64)
Definition stor-layout.cc:511
ALWAYS_INLINE scalar_mode mode_to_inner(machine_mode mode)
Definition machmode.h:601
const int_n_data_t int_n_data[NUM_INT_N_ENTS]
ALWAYS_INLINE poly_uint16 mode_to_nunits(machine_mode mode)
Definition machmode.h:641
opt_machine_mode smallest_mode_for_size(poly_uint64, enum mode_class)
Definition stor-layout.cc:345
bool is_complex_int_mode(machine_mode mode, T *cmode)
Definition machmode.h:1088
bool is_float_mode(machine_mode mode, T *float_mode)
Definition machmode.h:1073
opt_scalar_int_mode smallest_int_mode_for_size(poly_uint64 size)
Definition machmode.h:924
bool is_a(machine_mode m)
Definition machmode.h:373
opt_scalar_int_mode int_mode_for_size(poly_uint64 size, int limit)
Definition machmode.h:895
const unsigned short mode_inner[NUM_MACHINE_MODES]
const unsigned short mode_2xwider[NUM_MACHINE_MODES]
ALWAYS_INLINE poly_uint16 mode_to_precision(machine_mode mode)
Definition machmode.h:593
const unsigned short mode_next[NUM_MACHINE_MODES]
#define SCALAR_FLOAT_MODE_P(MODE)
Definition machmode.h:143
opt_mode< T > dyn_cast(machine_mode m)
Definition machmode.h:406
bool is_narrower_int_mode(machine_mode mode, scalar_int_mode limit)
Definition machmode.h:1117
ALWAYS_INLINE poly_uint16 GET_MODE_BITSIZE(machine_mode mode)
Definition machmode.h:683
ALWAYS_INLINE poly_uint16 mode_to_bytes(machine_mode mode)
Definition machmode.h:572
bool HWI_COMPUTABLE_MODE_P(machine_mode mode)
Definition machmode.h:1028
CONST_MODE_BASE_ALIGN unsigned short mode_base_align[NUM_MACHINE_MODES]
ALWAYS_INLINE poly_uint16 GET_MODE_NUNITS(machine_mode mode)
Definition machmode.h:769
opt_mode< machine_mode > opt_machine_mode
Definition machmode.h:23
CONST_MODE_FBIT unsigned char mode_fbit[NUM_MACHINE_MODES]
T as_a(machine_mode m)
Definition machmode.h:389
ALWAYS_INLINE poly_uint16 mode_to_bits(machine_mode mode)
Definition machmode.h:585
ALWAYS_INLINE opt_mode< T > GET_MODE_NEXT_MODE(const T &m)
Definition machmode.h:794
CONST_MODE_PRECISION poly_uint16 mode_precision[NUM_MACHINE_MODES]
const char *const mode_name[NUM_MACHINE_MODES]
CONST_MODE_NUNITS poly_uint16 mode_nunits[NUM_MACHINE_MODES]
bool is_int_mode(machine_mode mode, T *int_mode)
Definition machmode.h:1058
Definition machmode.h:1125
void get_2xwider(opt_mode< T > *iter)
Definition machmode.h:1216
void get_known_next(T *iter)
Definition machmode.h:1180
void get_known_wider(T *iter)
Definition machmode.h:1206
void get_wider(opt_mode< T > *iter)
Definition machmode.h:1190
bool iterate_p(opt_mode< T > *iter)
Definition machmode.h:1148
void get_next(opt_mode< T > *iter)
Definition machmode.h:1164
void start(opt_mode< T > *iter, enum mode_class mclass)
Definition machmode.h:1130
poly_int< NUM_POLY_INT_COEFFS, unsigned short > poly_uint16
Definition poly-int-types.h:23
poly_int< NUM_POLY_INT_COEFFS, unsigned HOST_WIDE_INT > poly_uint64
Definition poly-int-types.h:25
poly_int< NUM_POLY_INT_COEFFS, HOST_WIDE_INT > poly_int64
Definition poly-int-types.h:24
i
Definition poly-int.h:776
Definition poly-int.h:213
Definition poly-int.h:236
Definition machmode.h:1041
scalar_int_mode_pod m
Definition machmode.h:1044
unsigned int bitsize
Definition machmode.h:1043
machine_mode from_int
Definition machmode.h:77
Definition machmode.h:37
from_int
Definition machmode.h:69
@ dummy
Definition machmode.h:69
Definition machmode.h:355
scalar_mode::measurement_type measurement_type
Definition machmode.h:357
machine_mode m_mode
Definition machmode.h:359
ALWAYS_INLINE pod_mode & operator=(const T &m)
Definition machmode.h:366
mode_traits< scalar_mode >::from_int from_int
Definition machmode.h:356
#define ALWAYS_INLINE
Definition system.h:832
#define gcc_checking_assert(EXPR)
Definition system.h:826