This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| en:multiasm:papc:chapter_6_4 [2025/05/15 15:05] – [Floating point vector data types] ktokarz | en:multiasm:papc:chapter_6_4 [2026/03/29 18:50] (current) – [Data Types and Encoding] ktokarz | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Data Types and Encoding ====== | ====== Data Types and Encoding ====== | ||
| + | The x86 family of processors allows for computations on integer, floating-point, | ||
| ===== Fundamental data types ===== | ===== Fundamental data types ===== | ||
| Fundamental data types cover the types of data elements that are stored in memory as 8-bit (Byte), 16-bit (Word), 32-bit (Doubleword), | Fundamental data types cover the types of data elements that are stored in memory as 8-bit (Byte), 16-bit (Word), 32-bit (Doubleword), | ||
| <figure fundamentaldata> | <figure fundamentaldata> | ||
| - | {{ : | + | {{ : |
| < | < | ||
| </ | </ | ||
| Line 46: | Line 47: | ||
| <figure packedint128> | <figure packedint128> | ||
| - | {{ : | + | {{ : |
| < | < | ||
| </ | </ | ||
| Line 53: | Line 54: | ||
| <figure packedint256> | <figure packedint256> | ||
| - | {{ : | + | {{ : |
| < | < | ||
| </ | </ | ||
| Line 60: | Line 61: | ||
| <figure packedint512> | <figure packedint512> | ||
| - | {{ : | + | {{ : |
| < | < | ||
| </ | </ | ||
| Line 69: | Line 70: | ||
| <figure floattypes> | <figure floattypes> | ||
| - | {{ : | + | {{ : |
| < | < | ||
| </ | </ | ||
| Line 75: | Line 76: | ||
| <table tablefloattypes> | <table tablefloattypes> | ||
| < | < | ||
| - | ^ Name ^ Bits ^ Mantissa bits ^ Exponent bits ^ Min value | + | ^ Name ^ Bits ^ Mantissa bits ^ Exponent bits ^ Min value ^ Max value ^ |
| - | | Double extended | + | | Double extended |
| - | | Double precision | + | | Double precision |
| - | | Single precision | + | | Single precision |
| - | | Half precision | + | | Half precision |
| - | | Brain Float | 16 | 7 | 8 | {{: | + | | Brain Float | 16 | 7 | 8 | {{: |
| </ | </ | ||
| ===== Floating point vector data types ===== | ===== Floating point vector data types ===== | ||
| - | Floating point vectors are formed with single or double precision packed data formats. They are processed by SSE or AVX instructions in a SIMD approach of processing. A 128-bit packed data format can store four single-precision data elements or two double-precision data elements. A 256-bit packed data format can store eight single-precision values or four double-precision values. A 512-bit packed data format can store sixteen single-precision values or eight double-precision values. Instructions operating on 16-bit half-precision values or Brain Floats can use twice as many such elements simultaneously in comparison to single-precision data. | + | Floating-point vectors are formed with single or double-precision packed data formats. They are processed by SSE or AVX instructions in a SIMD approach of processing. A 128-bit packed data format can store four single-precision data elements or two double-precision data elements. A 256-bit packed data format can store eight single-precision values or four double-precision values. A 512-bit packed data format can store sixteen single-precision values or eight double-precision values. These packed data types are shown in figure {{ref> |
| It is worth mentioning that some instructions operate on a single floating-point value, using only the lowest elements of the operands. | It is worth mentioning that some instructions operate on a single floating-point value, using only the lowest elements of the operands. | ||
| + | <figure packedfloattypes> | ||
| + | {{ : | ||
| + | < | ||
| + | </ | ||
| + | |||
| + | ===== Bit field data type ===== | ||
| + | A bit field is a data type whose size is counted by the number of bits it occupies. The bit field can start at any bit position in the fundamental data type and can be up to 32 bits long. MASM supports it with the RECORD data type. The bit field type is shown in figure {{ref> | ||
| + | |||
| + | <figure bitfieldtype> | ||
| + | {{ : | ||
| + | < | ||
| + | </ | ||
| + | |||
| + | |||
| + | ===== Pointers ===== | ||
| + | Pointers store the address of the memory which contains interesting information. They can point to the data or the instruction. If the segmentation is enabled, pointers can be near or far. The far pointer contains the logical address (formed with the segment and offset parts). The near pointer contains the offset only. The offset can be 16, 32 or 64 bits long. The segment selector is always stored as a 16-bit number. Illustration of possible pointer types is shown in figure {{ref> | ||
| + | |||
| + | <figure pointertypes> | ||
| + | {{ : | ||
| + | < | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | The offset is often the result of complex addressing mode calculations and is called an effective address. | ||
| + | </ | ||