| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 | 31 |
| 32 #define A64_DEFINE_FP_STATICS | 32 #define A64_DEFINE_FP_STATICS |
| 33 | 33 |
| 34 #include "a64/instructions-a64.h" | 34 #include "a64/instructions-a64.h" |
| 35 #include "a64/assembler-a64-inl.h" | 35 #include "a64/assembler-a64-inl.h" |
| 36 | 36 |
| 37 namespace v8 { | 37 namespace v8 { |
| 38 namespace internal { | 38 namespace internal { |
| 39 | 39 |
| 40 | 40 |
| 41 bool Instruction::IsLoad() const { |
| 42 if (Mask(LoadStoreAnyFMask) != LoadStoreAnyFixed) { |
| 43 return false; |
| 44 } |
| 45 |
| 46 if (Mask(LoadStorePairAnyFMask) == LoadStorePairAnyFixed) { |
| 47 return Mask(LoadStorePairLBit) != 0; |
| 48 } else { |
| 49 LoadStoreOp op = static_cast<LoadStoreOp>(Mask(LoadStoreOpMask)); |
| 50 switch (op) { |
| 51 case LDRB_w: |
| 52 case LDRH_w: |
| 53 case LDR_w: |
| 54 case LDR_x: |
| 55 case LDRSB_w: |
| 56 case LDRSB_x: |
| 57 case LDRSH_w: |
| 58 case LDRSH_x: |
| 59 case LDRSW_x: |
| 60 case LDR_s: |
| 61 case LDR_d: return true; |
| 62 default: return false; |
| 63 } |
| 64 } |
| 65 } |
| 66 |
| 67 |
| 68 bool Instruction::IsStore() const { |
| 69 if (Mask(LoadStoreAnyFMask) != LoadStoreAnyFixed) { |
| 70 return false; |
| 71 } |
| 72 |
| 73 if (Mask(LoadStorePairAnyFMask) == LoadStorePairAnyFixed) { |
| 74 return Mask(LoadStorePairLBit) == 0; |
| 75 } else { |
| 76 LoadStoreOp op = static_cast<LoadStoreOp>(Mask(LoadStoreOpMask)); |
| 77 switch (op) { |
| 78 case STRB_w: |
| 79 case STRH_w: |
| 80 case STR_w: |
| 81 case STR_x: |
| 82 case STR_s: |
| 83 case STR_d: return true; |
| 84 default: return false; |
| 85 } |
| 86 } |
| 87 } |
| 88 |
| 89 |
| 41 static uint64_t RotateRight(uint64_t value, | 90 static uint64_t RotateRight(uint64_t value, |
| 42 unsigned int rotate, | 91 unsigned int rotate, |
| 43 unsigned int width) { | 92 unsigned int width) { |
| 44 ASSERT(width <= 64); | 93 ASSERT(width <= 64); |
| 45 rotate &= 63; | 94 rotate &= 63; |
| 46 return ((value & ((1UL << rotate) - 1UL)) << (width - rotate)) | | 95 return ((value & ((1UL << rotate) - 1UL)) << (width - rotate)) | |
| 47 (value >> rotate); | 96 (value >> rotate); |
| 48 } | 97 } |
| 49 | 98 |
| 50 | 99 |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 uint64_t payload = ImmMoveWide(); | 313 uint64_t payload = ImmMoveWide(); |
| 265 // TODO(all): If we extend ::InlineData() to support bigger data, we need | 314 // TODO(all): If we extend ::InlineData() to support bigger data, we need |
| 266 // to update this method too. | 315 // to update this method too. |
| 267 return payload; | 316 return payload; |
| 268 } | 317 } |
| 269 | 318 |
| 270 | 319 |
| 271 } } // namespace v8::internal | 320 } } // namespace v8::internal |
| 272 | 321 |
| 273 #endif // V8_TARGET_ARCH_A64 | 322 #endif // V8_TARGET_ARCH_A64 |
| OLD | NEW |