Changeset de8a0a4b for src/BasicTypes-gen.cpp
- Timestamp:
- Jan 26, 2025, 6:37:05 PM (11 months ago)
- Branches:
- master
- Children:
- a950021
- Parents:
- 0f070a4 (diff), 11f92fac (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - File:
-
- 1 edited
-
src/BasicTypes-gen.cpp (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/BasicTypes-gen.cpp
r0f070a4 rde8a0a4b 99 99 100 100 { Float16, "Float16", "_FH", "_Float16", "DF16_", Floating, Float32, Float16Complex, -1, 7 }, 101 { Float16Complex, "Float16Complex", "_FHC", "_Float16 _Complex", "CDF16_", Floating, Float32Complex, -1, -1, 7},102 103 { Float32, "Float32", "_F", "_Float32", "DF32_", Floating, Float, Float32Complex, -1, 8},104 { Float32Complex, "Float32Complex", "_FC", "_Float32 _Complex", "CDF32_", Floating, FloatComplex, -1, -1, 8},105 { Float, "Float", "F", "float", "f", Floating, Float32x, FloatComplex, -1, 9},106 { FloatComplex, "FloatComplex", "FC", "float _Complex", "Cf", Floating, Float32xComplex, -1, -1, 9},107 { Float32x, "Float32x", "_FX", "_Float32x", "DF32x_", Floating, Float64, Float32xComplex, -1, 1 0},108 { Float32xComplex, "Float32xComplex", "_FXC", "_Float32x _Complex", "CDF32x_", Floating, Float64Complex, -1, -1, 1 0},109 110 { Float64, "Float64", "_FD", "_Float64", "DF64_", Floating, Double, Float64Complex, -1, 1 1},111 { Float64Complex, "Float64Complex", "_FDC", "_Float64 _Complex", "CDF64_", Floating, DoubleComplex, -1, -1, 1 1},112 { Double, "Double", "D", "double", "d", Floating, Float64x, DoubleComplex, -1, 1 2},113 { DoubleComplex, "DoubleComplex", "DC", "double _Complex", "Cd", Floating, Float64xComplex, -1, -1, 1 2},114 { Float64x, "Float64x", "_FDX", "_Float64x", "DF64x_", Floating, Float80, Float64xComplex, -1, 1 3},115 { Float64xComplex, "Float64xComplex", "_FDXC", "_Float64x _Complex", "CDF64x_", Floating, LongDoubleComplex, -1, -1, 13},116 117 { Float80, "Float80", "_F80", "__float80", "Dq", Floating, LongDouble, LongDoubleComplex, -1, 14},101 { Float16Complex, "Float16Complex", "_FHC", "_Float16 _Complex", "CDF16_", Floating, Float32Complex, -1, -1, 8 }, 102 103 { Float32, "Float32", "_F", "_Float32", "DF32_", Floating, Float, Float32Complex, -1, 9 }, 104 { Float32Complex, "Float32Complex", "_FC", "_Float32 _Complex", "CDF32_", Floating, FloatComplex, -1, -1, 10 }, 105 { Float, "Float", "F", "float", "f", Floating, Float32x, FloatComplex, -1, 11 }, 106 { FloatComplex, "FloatComplex", "FC", "float _Complex", "Cf", Floating, Float32xComplex, -1, -1, 12 }, 107 { Float32x, "Float32x", "_FX", "_Float32x", "DF32x_", Floating, Float64, Float32xComplex, -1, 13 }, 108 { Float32xComplex, "Float32xComplex", "_FXC", "_Float32x _Complex", "CDF32x_", Floating, Float64Complex, -1, -1, 14 }, 109 110 { Float64, "Float64", "_FD", "_Float64", "DF64_", Floating, Double, Float64Complex, -1, 15 }, 111 { Float64Complex, "Float64Complex", "_FDC", "_Float64 _Complex", "CDF64_", Floating, DoubleComplex, -1, -1, 16 }, 112 { Double, "Double", "D", "double", "d", Floating, Float64x, DoubleComplex, -1, 17 }, 113 { DoubleComplex, "DoubleComplex", "DC", "double _Complex", "Cd", Floating, Float64xComplex, -1, -1, 18 }, 114 { Float64x, "Float64x", "_FDX", "_Float64x", "DF64x_", Floating, Float80, Float64xComplex, -1, 19 }, 115 { Float64xComplex, "Float64xComplex", "_FDXC", "_Float64x _Complex", "CDF64x_", Floating, LongDoubleComplex, -1, -1, 20 }, 116 117 { Float80, "Float80", "_F80", "__float80", "Dq", Floating, LongDouble, LongDoubleComplex, -1, 21 }, 118 118 // __float80 _Complex, no complex counterpart 119 119 // gcc implements long double as float80 (12 bytes) 120 { LongDouble, "LongDouble", "LD", "long double", "e", Floating, uuFloat128, LongDoubleComplex, -1, 15},121 { LongDoubleComplex, "LongDoubleComplex", "LDC", "long double _Complex", "Ce", Floating, Float128Complex, -1, -1, 15},122 123 { uuFloat128, "uuFloat128", "__FLD", "__float128", "g", Floating, Float128, Float128Complex, -1, 16},120 { LongDouble, "LongDouble", "LD", "long double", "e", Floating, uuFloat128, LongDoubleComplex, -1, 22 }, 121 { LongDoubleComplex, "LongDoubleComplex", "LDC", "long double _Complex", "Ce", Floating, Float128Complex, -1, -1, 23 }, 122 123 { uuFloat128, "uuFloat128", "__FLD", "__float128", "g", Floating, Float128, Float128Complex, -1, 24 }, 124 124 // __float128 _Complex, no complex counterpart 125 { Float128, "Float128", "_FLD", "_Float128", "DF128_", Floating, Float128x, Float128Complex, -1, 17},126 { Float128Complex, "Float128Complex", "_FLDC", "_Float128 _Complex", "CDF128_", Floating, Float128xComplex, -1, -1, 17},125 { Float128, "Float128", "_FLD", "_Float128", "DF128_", Floating, Float128x, Float128Complex, -1, 25 }, 126 { Float128Complex, "Float128Complex", "_FLDC", "_Float128 _Complex", "CDF128_", Floating, Float128xComplex, -1, -1, 26 }, 127 127 128 128 // may not be supported 129 { Float128x, "Float128x", "_FLDX", "_Float128x", "DF128x_", Floating, Float128xComplex, -1, -1, 18},130 { Float128xComplex, "Float128xComplex", "_FLDXC", "_Float128x _Complex", "CDF128x_", Floating, -1, -1, -1, 18 }129 { Float128x, "Float128x", "_FLDX", "_Float128x", "DF128x_", Floating, Float128xComplex, -1, -1, 27 }, 130 { Float128xComplex, "Float128xComplex", "_FLDXC", "_Float128x _Complex", "CDF128x_", Floating, -1, -1, -1, 28 } 131 131 }; // graph 132 132 … … 135 135 static Kind commonTypeMatrix[NUMBER_OF_BASIC_TYPES][NUMBER_OF_BASIC_TYPES]; 136 136 137 // Fangren explain shortest cost algorithm.137 // Compute the minimal conversion costs using Dijkstra's algorithm 138 138 void generateCosts( int row ) { 139 139 bool seen[NUMBER_OF_BASIC_TYPES] = { false /*, ... */ }; … … 176 176 177 177 // traverse children 178 // Fangren explain "max"178 // any conversion should have a cost of at least 1, even if between types of equal rank 179 179 int i = graph[col].left; 180 180 if ( i == -1 ) continue; // leaf … … 191 191 } // generateCosts 192 192 193 // Fangren explain this routine if you can. 193 // Note: this algorithm is not general. 194 // It relies on the specific structure of the conversion graph. 195 // When the common type is not one of the two given types, we should always have a real and a complex floating point type, 196 // in which case the common type is the next complex type ranked higher than the real type. 194 197 void generateCommonType( int row, int col ) { // row <= col 195 198 if ( costMatrix[row][col] >= 0 ) {
Note:
See TracChangeset
for help on using the changeset viewer.