Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(605)

Side by Side Diff: crosstest/test_cast_main.cpp

Issue 560493002: Subzero: The cross tests should use the actual Subzero runtime. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Make the g++/clang++ comment correct Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | crosstest/test_vector_ops_main.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 //===- subzero/crosstest/test_cast_main.cpp - Driver for tests ------------===// 1 //===- subzero/crosstest/test_cast_main.cpp - Driver for tests ------------===//
2 // 2 //
3 // The Subzero Code Generator 3 // The Subzero Code Generator
4 // 4 //
5 // This file is distributed under the University of Illinois Open Source 5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details. 6 // License. See LICENSE.TXT for details.
7 // 7 //
8 //===----------------------------------------------------------------------===// 8 //===----------------------------------------------------------------------===//
9 // 9 //
10 // Driver for crosstesting cast operations. 10 // Driver for crosstesting cast operations.
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 Val = -Val; 217 Val = -Val;
218 testValue<double>(Val, TotalTests, Passes, Failures, "double"); 218 testValue<double>(Val, TotalTests, Passes, Failures, "double");
219 COMPARE(castBits, double, uint64_t, Val, "double"); 219 COMPARE(castBits, double, uint64_t, Val, "double");
220 } 220 }
221 } 221 }
222 222
223 std::cout << "TotalTests=" << TotalTests << " Passes=" << Passes 223 std::cout << "TotalTests=" << TotalTests << " Passes=" << Passes
224 << " Failures=" << Failures << "\n"; 224 << " Failures=" << Failures << "\n";
225 return Failures; 225 return Failures;
226 } 226 }
227
228 ////////////////////////////////////////////////////////////////
229
230 // The following are helper definitions that should be part of the
231 // Subzero runtime.
232
233 extern "C" {
234 uint32_t cvtdtoui32(double a) { return (uint32_t)a; }
235 uint32_t cvtftoui32(float a) { return (uint32_t)a; }
236 int64_t cvtdtosi64(double a) { return (int64_t)a; }
237 int64_t cvtftosi64(float a) { return (int64_t)a; }
238 uint64_t cvtdtoui64(double a) { return (uint64_t)a; }
239 uint64_t cvtftoui64(float a) { return (uint64_t)a; }
240 float cvtui64tof(uint64_t a) { return (float)a; }
241 double cvtui64tod(uint64_t a) { return (double)a; }
242 float cvtsi64tof(int64_t a) { return (float)a; }
243 float cvtui32tof(uint32_t a) { return (float)a; }
244 double cvtui32tod(uint32_t a) { return (double)a; }
245 double cvtsi64tod(int64_t a) { return (double)a; }
246 }
OLDNEW
« no previous file with comments | « no previous file | crosstest/test_vector_ops_main.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698