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

Side by Side Diff: IceTypes.cpp

Issue 205613002: Initial skeleton of Subzero. (Closed) Base URL: https://gerrit.chromium.org/gerrit/p/native_client/pnacl-subzero.git@master
Patch Set: Created 6 years, 9 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
« IceCfg.h ('K') | « IceTypes.h ('k') | LICENSE » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /* Copyright 2014 The Native Client Authors. All rights reserved.
2 * Use of this source code is governed by a BSD-style license that can
3 * be found in the LICENSE file.
4 */
5
6 #include "IceDefs.h"
7 #include "IceTypes.h"
8
9 uint32_t iceTypeWidth(IceType T) {
10 switch (T) {
11 case IceType_i1:
12 return 1;
13 case IceType_i8:
14 return 1;
15 case IceType_i16:
16 return 2;
17 case IceType_i32:
18 return 4;
19 case IceType_i64:
20 return 8;
21 case IceType_f32:
22 return 4;
23 case IceType_f64:
24 return 8;
25 case IceType_void:
26 case IceType_NUM:
27 break;
28 }
29 assert(0 && "Invalid type for iceTypeWidth()");
30 return 0;
31 }
32
33 // ======================== Dump routines ======================== //
34
35 IceOstream &operator<<(IceOstream &Str, IceType T) {
36 switch (T) {
37 case IceType_void:
38 Str << "void";
39 return Str;
40 case IceType_i1:
41 Str << "i1";
42 return Str;
43 case IceType_i8:
44 Str << "i8";
45 return Str;
46 case IceType_i16:
47 Str << "i16";
48 return Str;
49 case IceType_i32:
50 Str << "i32";
51 return Str;
52 case IceType_i64:
53 Str << "i64";
54 return Str;
55 case IceType_f32:
56 Str << "float";
57 return Str;
58 case IceType_f64:
59 Str << "double";
60 return Str;
61 case IceType_NUM:
62 default:
63 assert(0 && "Invalid type for printing");
64 break;
65 }
66 Str << "???";
67 return Str;
68 }
OLDNEW
« IceCfg.h ('K') | « IceTypes.h ('k') | LICENSE » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698