| 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 2090 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2101 break; | 2101 break; |
| 2102 default: | 2102 default: |
| 2103 UNIMPLEMENTED(); | 2103 UNIMPLEMENTED(); |
| 2104 } | 2104 } |
| 2105 | 2105 |
| 2106 int64_t dst = inzero ? 0 : reg(reg_size, instr->Rd()); | 2106 int64_t dst = inzero ? 0 : reg(reg_size, instr->Rd()); |
| 2107 int64_t src = reg(reg_size, instr->Rn()); | 2107 int64_t src = reg(reg_size, instr->Rn()); |
| 2108 // Rotate source bitfield into place. | 2108 // Rotate source bitfield into place. |
| 2109 int64_t result = (static_cast<uint64_t>(src) >> R) | (src << (reg_size - R)); | 2109 int64_t result = (static_cast<uint64_t>(src) >> R) | (src << (reg_size - R)); |
| 2110 // Determine the sign extension. | 2110 // Determine the sign extension. |
| 2111 int64_t topbits = ((1L << (reg_size - diff - 1)) - 1) << (diff + 1); | 2111 int64_t topbits_preshift = (1L << (reg_size - diff - 1)) - 1; |
| 2112 int64_t signbits = extend && ((src >> S) & 1) ? topbits : 0; | 2112 int64_t signbits = (extend && ((src >> S) & 1) ? topbits_preshift : 0) |
| 2113 << (diff + 1); |
| 2113 | 2114 |
| 2114 // Merge sign extension, dest/zero and bitfield. | 2115 // Merge sign extension, dest/zero and bitfield. |
| 2115 result = signbits | (result & mask) | (dst & ~mask); | 2116 result = signbits | (result & mask) | (dst & ~mask); |
| 2116 | 2117 |
| 2117 set_reg(reg_size, instr->Rd(), result); | 2118 set_reg(reg_size, instr->Rd(), result); |
| 2118 } | 2119 } |
| 2119 | 2120 |
| 2120 | 2121 |
| 2121 void Simulator::VisitExtract(Instruction* instr) { | 2122 void Simulator::VisitExtract(Instruction* instr) { |
| 2122 unsigned lsb = instr->ImmS(); | 2123 unsigned lsb = instr->ImmS(); |
| (...skipping 1513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3636 default: | 3637 default: |
| 3637 UNIMPLEMENTED(); | 3638 UNIMPLEMENTED(); |
| 3638 } | 3639 } |
| 3639 } | 3640 } |
| 3640 | 3641 |
| 3641 #endif // USE_SIMULATOR | 3642 #endif // USE_SIMULATOR |
| 3642 | 3643 |
| 3643 } } // namespace v8::internal | 3644 } } // namespace v8::internal |
| 3644 | 3645 |
| 3645 #endif // V8_TARGET_ARCH_ARM64 | 3646 #endif // V8_TARGET_ARCH_ARM64 |
| OLD | NEW |