Changeset 897 for trunk/test/lol-bench.cpp
- Timestamp:
- Sep 4, 2011, 12:05:57 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/lol-bench.cpp
r890 r897 75 75 static void bench_trig(int mode) 76 76 { 77 float result[ 5] = { 0.0f };77 float result[7] = { 0.0f }; 78 78 Timer timer; 79 79 … … 128 128 result[3] += timer.GetMs(); 129 129 130 /* Fast cos */ 131 timer.GetMs(); 132 for (size_t i = 0; i < TRIG_TABLE_SIZE; i++) 133 #if defined HAVE_FASTMATH_H 134 pf2[i] = f_cosf(pf[i]); 135 #else 136 pf2[i] = cosf(pf[i]); 137 #endif 138 result[4] += timer.GetMs(); 139 140 /* Lol cos */ 141 timer.GetMs(); 142 for (size_t i = 0; i < TRIG_TABLE_SIZE; i++) 143 pf2[i] = lol_cos(pf[i]); 144 result[5] += timer.GetMs(); 145 130 146 /* Tan */ 131 147 timer.GetMs(); 132 148 for (size_t i = 0; i < TRIG_TABLE_SIZE; i++) 133 149 pf2[i] = __builtin_tanf(pf[i]); 134 result[ 4] += timer.GetMs();150 result[6] += timer.GetMs(); 135 151 } 136 152 … … 146 162 Log::Info("float = lol_sinf(float) %7.3f\n", result[2]); 147 163 Log::Info("float = cosf(float) %7.3f\n", result[3]); 148 Log::Info("float = tanf(float) %7.3f\n", result[4]); 164 Log::Info("float = fastcosf(float) %7.3f\n", result[4]); 165 Log::Info("float = lol_cosf(float) %7.3f\n", result[5]); 166 Log::Info("float = tanf(float) %7.3f\n", result[6]); 149 167 } 150 168
Note: See TracChangeset
for help on using the changeset viewer.