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

Side by Side Diff: src/x64/assembler-x64.h

Issue 143003013: Initial patch for a64. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/a64
Patch Set: Created 6 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « src/utils.h ('k') | test/cctest/cctest.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 1994-2006 Sun Microsystems Inc. 1 // Copyright (c) 1994-2006 Sun Microsystems Inc.
2 // All Rights Reserved. 2 // All Rights Reserved.
3 // 3 //
4 // Redistribution and use in source and binary forms, with or without 4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions are 5 // modification, are permitted provided that the following conditions are
6 // met: 6 // met:
7 // 7 //
8 // - Redistributions of source code must retain the above copyright notice, 8 // - Redistributions of source code must retain the above copyright notice,
9 // this list of conditions and the following disclaimer. 9 // this list of conditions and the following disclaimer.
10 // 10 //
(...skipping 26 matching lines...) Expand all
37 #ifndef V8_X64_ASSEMBLER_X64_H_ 37 #ifndef V8_X64_ASSEMBLER_X64_H_
38 #define V8_X64_ASSEMBLER_X64_H_ 38 #define V8_X64_ASSEMBLER_X64_H_
39 39
40 #include "serialize.h" 40 #include "serialize.h"
41 41
42 namespace v8 { 42 namespace v8 {
43 namespace internal { 43 namespace internal {
44 44
45 // Utility functions 45 // Utility functions
46 46
47 // Test whether a 64-bit value is in a specific range.
48 inline bool is_uint32(int64_t x) {
49 static const uint64_t kMaxUInt32 = V8_UINT64_C(0xffffffff);
50 return static_cast<uint64_t>(x) <= kMaxUInt32;
51 }
52
53 inline bool is_int32(int64_t x) {
54 static const int64_t kMinInt32 = -V8_INT64_C(0x80000000);
55 return is_uint32(x - kMinInt32);
56 }
57
58 inline bool uint_is_int32(uint64_t x) {
59 static const uint64_t kMaxInt32 = V8_UINT64_C(0x7fffffff);
60 return x <= kMaxInt32;
61 }
62
63 inline bool is_uint32(uint64_t x) {
64 static const uint64_t kMaxUInt32 = V8_UINT64_C(0xffffffff);
65 return x <= kMaxUInt32;
66 }
67
68 // CPU Registers. 47 // CPU Registers.
69 // 48 //
70 // 1) We would prefer to use an enum, but enum values are assignment- 49 // 1) We would prefer to use an enum, but enum values are assignment-
71 // compatible with int, which has caused code-generation bugs. 50 // compatible with int, which has caused code-generation bugs.
72 // 51 //
73 // 2) We would prefer to use a class instead of a struct but we don't like 52 // 2) We would prefer to use a class instead of a struct but we don't like
74 // the register initialization to depend on the particular initialization 53 // the register initialization to depend on the particular initialization
75 // order (which appears to be different on OS X, Linux, and Windows for the 54 // order (which appears to be different on OS X, Linux, and Windows for the
76 // installed versions of C++ we tried). Using a struct permits C-style 55 // installed versions of C++ we tried). Using a struct permits C-style
77 // "initialization". Also, the Register objects cannot be const as this 56 // "initialization". Also, the Register objects cannot be const as this
(...skipping 1573 matching lines...) Expand 10 before | Expand all | Expand 10 after
1651 private: 1630 private:
1652 Assembler* assembler_; 1631 Assembler* assembler_;
1653 #ifdef DEBUG 1632 #ifdef DEBUG
1654 int space_before_; 1633 int space_before_;
1655 #endif 1634 #endif
1656 }; 1635 };
1657 1636
1658 } } // namespace v8::internal 1637 } } // namespace v8::internal
1659 1638
1660 #endif // V8_X64_ASSEMBLER_X64_H_ 1639 #endif // V8_X64_ASSEMBLER_X64_H_
OLDNEW
« no previous file with comments | « src/utils.h ('k') | test/cctest/cctest.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698