| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
| 2 // | 2 // |
| 3 // Redistribution and use in source and binary forms, with or without | 3 // Redistribution and use in source and binary forms, with or without |
| 4 // modification, are permitted provided that the following conditions are | 4 // modification, are permitted provided that the following conditions are |
| 5 // met: | 5 // met: |
| 6 // | 6 // |
| 7 // * Redistributions of source code must retain the above copyright | 7 // * Redistributions of source code must retain the above copyright |
| 8 // notice, this list of conditions and the following disclaimer. | 8 // notice, this list of conditions and the following disclaimer. |
| 9 // * Redistributions in binary form must reproduce the above | 9 // * Redistributions in binary form must reproduce the above |
| 10 // copyright notice, this list of conditions and the following | 10 // copyright notice, this list of conditions and the following |
| (...skipping 4411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4422 bool Assembler::IsImmLSPair(int64_t offset, unsigned size) { | 4422 bool Assembler::IsImmLSPair(int64_t offset, unsigned size) { |
| 4423 bool offset_is_size_multiple = (((offset >> size) << size) == offset); | 4423 bool offset_is_size_multiple = (((offset >> size) << size) == offset); |
| 4424 return offset_is_size_multiple && is_int7(offset >> size); | 4424 return offset_is_size_multiple && is_int7(offset >> size); |
| 4425 } | 4425 } |
| 4426 | 4426 |
| 4427 | 4427 |
| 4428 bool Assembler::IsImmLLiteral(int64_t offset) { | 4428 bool Assembler::IsImmLLiteral(int64_t offset) { |
| 4429 int inst_size = static_cast<int>(kInstructionSizeLog2); | 4429 int inst_size = static_cast<int>(kInstructionSizeLog2); |
| 4430 bool offset_is_inst_multiple = | 4430 bool offset_is_inst_multiple = |
| 4431 (((offset >> inst_size) << inst_size) == offset); | 4431 (((offset >> inst_size) << inst_size) == offset); |
| 4432 DCHECK_GT(offset, 0); |
| 4433 offset >>= kLoadLiteralScaleLog2; |
| 4432 return offset_is_inst_multiple && is_intn(offset, ImmLLiteral_width); | 4434 return offset_is_inst_multiple && is_intn(offset, ImmLLiteral_width); |
| 4433 } | 4435 } |
| 4434 | 4436 |
| 4435 | 4437 |
| 4436 // Test if a given value can be encoded in the immediate field of a logical | 4438 // Test if a given value can be encoded in the immediate field of a logical |
| 4437 // instruction. | 4439 // instruction. |
| 4438 // If it can be encoded, the function returns true, and values pointed to by n, | 4440 // If it can be encoded, the function returns true, and values pointed to by n, |
| 4439 // imm_s and imm_r are updated with immediates encoded in the format required | 4441 // imm_s and imm_r are updated with immediates encoded in the format required |
| 4440 // by the corresponding fields in the logical instruction. | 4442 // by the corresponding fields in the logical instruction. |
| 4441 // If it can not be encoded, the function returns false, and the values pointed | 4443 // If it can not be encoded, the function returns false, and the values pointed |
| (...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5026 movk(scratch, (target_offset >> 32) & 0xFFFF, 32); | 5028 movk(scratch, (target_offset >> 32) & 0xFFFF, 32); |
| 5027 DCHECK((target_offset >> 48) == 0); | 5029 DCHECK((target_offset >> 48) == 0); |
| 5028 add(rd, rd, scratch); | 5030 add(rd, rd, scratch); |
| 5029 } | 5031 } |
| 5030 | 5032 |
| 5031 | 5033 |
| 5032 } // namespace internal | 5034 } // namespace internal |
| 5033 } // namespace v8 | 5035 } // namespace v8 |
| 5034 | 5036 |
| 5035 #endif // V8_TARGET_ARCH_ARM64 | 5037 #endif // V8_TARGET_ARCH_ARM64 |
| OLD | NEW |