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

Side by Side Diff: src/assembler.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 | « build/standalone.gypi ('k') | src/assembler.cc » ('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 964 matching lines...) Expand 10 before | Expand all | Expand 10 after
975 PositionsRecorder* positions_recorder_; 975 PositionsRecorder* positions_recorder_;
976 const PositionState saved_state_; 976 const PositionState saved_state_;
977 977
978 DISALLOW_COPY_AND_ASSIGN(PreservePositionScope); 978 DISALLOW_COPY_AND_ASSIGN(PreservePositionScope);
979 }; 979 };
980 980
981 981
982 // ----------------------------------------------------------------------------- 982 // -----------------------------------------------------------------------------
983 // Utility functions 983 // Utility functions
984 984
985 inline bool is_intn(int x, int n) {
986 return -(1 << (n-1)) <= x && x < (1 << (n-1));
987 }
988
989 inline bool is_int8(int x) { return is_intn(x, 8); }
990 inline bool is_int16(int x) { return is_intn(x, 16); }
991 inline bool is_int18(int x) { return is_intn(x, 18); }
992 inline bool is_int24(int x) { return is_intn(x, 24); }
993
994 inline bool is_uintn(int x, int n) {
995 return (x & -(1 << n)) == 0;
996 }
997
998 inline bool is_uint2(int x) { return is_uintn(x, 2); }
999 inline bool is_uint3(int x) { return is_uintn(x, 3); }
1000 inline bool is_uint4(int x) { return is_uintn(x, 4); }
1001 inline bool is_uint5(int x) { return is_uintn(x, 5); }
1002 inline bool is_uint6(int x) { return is_uintn(x, 6); }
1003 inline bool is_uint8(int x) { return is_uintn(x, 8); }
1004 inline bool is_uint10(int x) { return is_uintn(x, 10); }
1005 inline bool is_uint12(int x) { return is_uintn(x, 12); }
1006 inline bool is_uint16(int x) { return is_uintn(x, 16); }
1007 inline bool is_uint24(int x) { return is_uintn(x, 24); }
1008 inline bool is_uint26(int x) { return is_uintn(x, 26); }
1009 inline bool is_uint28(int x) { return is_uintn(x, 28); }
1010
1011 inline int NumberOfBitsSet(uint32_t x) { 985 inline int NumberOfBitsSet(uint32_t x) {
1012 unsigned int num_bits_set; 986 unsigned int num_bits_set;
1013 for (num_bits_set = 0; x; x >>= 1) { 987 for (num_bits_set = 0; x; x >>= 1) {
1014 num_bits_set += x & 1; 988 num_bits_set += x & 1;
1015 } 989 }
1016 return num_bits_set; 990 return num_bits_set;
1017 } 991 }
1018 992
1019 bool EvalComparison(Token::Value op, double op1, double op2); 993 bool EvalComparison(Token::Value op, double op1, double op2);
1020 994
(...skipping 20 matching lines...) Expand all
1041 public: 1015 public:
1042 NullCallWrapper() { } 1016 NullCallWrapper() { }
1043 virtual ~NullCallWrapper() { } 1017 virtual ~NullCallWrapper() { }
1044 virtual void BeforeCall(int call_size) const { } 1018 virtual void BeforeCall(int call_size) const { }
1045 virtual void AfterCall() const { } 1019 virtual void AfterCall() const { }
1046 }; 1020 };
1047 1021
1048 } } // namespace v8::internal 1022 } } // namespace v8::internal
1049 1023
1050 #endif // V8_ASSEMBLER_H_ 1024 #endif // V8_ASSEMBLER_H_
OLDNEW
« no previous file with comments | « build/standalone.gypi ('k') | src/assembler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698