| Anton Kirilov | 5ec6218 | 2016-10-13 20:16:02 +0100 | [diff] [blame] | 1 | /* | 
 | 2 |  * Copyright (C) 2016 The Android Open Source Project | 
 | 3 |  * | 
 | 4 |  * Licensed under the Apache License, Version 2.0 (the "License"); | 
 | 5 |  * you may not use this file except in compliance with the License. | 
 | 6 |  * You may obtain a copy of the License at | 
 | 7 |  * | 
 | 8 |  *      http://www.apache.org/licenses/LICENSE-2.0 | 
 | 9 |  * | 
 | 10 |  * Unless required by applicable law or agreed to in writing, software | 
 | 11 |  * distributed under the License is distributed on an "AS IS" BASIS, | 
 | 12 |  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 
 | 13 |  * See the License for the specific language governing permissions and | 
 | 14 |  * limitations under the License. | 
 | 15 |  */ | 
 | 16 |  | 
 | 17 | #ifndef ART_COMPILER_OPTIMIZING_INTRINSICS_ARM_VIXL_H_ | 
 | 18 | #define ART_COMPILER_OPTIMIZING_INTRINSICS_ARM_VIXL_H_ | 
 | 19 |  | 
 | 20 | #include "intrinsics.h" | 
 | 21 | #include "utils/arm/assembler_arm_vixl.h" | 
 | 22 |  | 
 | 23 | namespace art { | 
 | 24 |  | 
 | 25 | namespace arm { | 
 | 26 |  | 
 | 27 | class ArmVIXLAssembler; | 
 | 28 | class CodeGeneratorARMVIXL; | 
 | 29 |  | 
 | 30 | class IntrinsicLocationsBuilderARMVIXL FINAL : public IntrinsicVisitor { | 
 | 31 |  public: | 
 | 32 |   explicit IntrinsicLocationsBuilderARMVIXL(CodeGeneratorARMVIXL* codegen); | 
 | 33 |  | 
 | 34 |   // Define visitor methods. | 
 | 35 |  | 
 | 36 | #define OPTIMIZING_INTRINSICS(Name, IsStatic, NeedsEnvironmentOrCache, SideEffects, Exceptions, ...) \ | 
 | 37 |   void Visit ## Name(HInvoke* invoke) OVERRIDE; | 
 | 38 | #include "intrinsics_list.h" | 
| Andreas Gampe | 8cf9cb3 | 2017-07-19 09:28:38 -0700 | [diff] [blame] | 39 |   INTRINSICS_LIST(OPTIMIZING_INTRINSICS) | 
| Anton Kirilov | 5ec6218 | 2016-10-13 20:16:02 +0100 | [diff] [blame] | 40 | #undef INTRINSICS_LIST | 
 | 41 | #undef OPTIMIZING_INTRINSICS | 
 | 42 |  | 
 | 43 |   // Check whether an invoke is an intrinsic, and if so, create a location summary. Returns whether | 
 | 44 |   // a corresponding LocationSummary with the intrinsified_ flag set was generated and attached to | 
 | 45 |   // the invoke. | 
 | 46 |   bool TryDispatch(HInvoke* invoke); | 
 | 47 |  | 
 | 48 |  private: | 
| Vladimir Marko | 69d310e | 2017-10-09 14:12:23 +0100 | [diff] [blame] | 49 |   ArenaAllocator* const allocator_; | 
 | 50 |   CodeGenerator* const codegen_; | 
 | 51 |   ArmVIXLAssembler* const assembler_; | 
| Anton Kirilov | 5ec6218 | 2016-10-13 20:16:02 +0100 | [diff] [blame] | 52 |   const ArmInstructionSetFeatures& features_; | 
 | 53 |  | 
 | 54 |   DISALLOW_COPY_AND_ASSIGN(IntrinsicLocationsBuilderARMVIXL); | 
 | 55 | }; | 
 | 56 |  | 
 | 57 | class IntrinsicCodeGeneratorARMVIXL FINAL : public IntrinsicVisitor { | 
 | 58 |  public: | 
 | 59 |   explicit IntrinsicCodeGeneratorARMVIXL(CodeGeneratorARMVIXL* codegen) : codegen_(codegen) {} | 
 | 60 |  | 
 | 61 |   // Define visitor methods. | 
 | 62 |  | 
 | 63 | #define OPTIMIZING_INTRINSICS(Name, IsStatic, NeedsEnvironmentOrCache, SideEffects, Exceptions, ...) \ | 
 | 64 |   void Visit ## Name(HInvoke* invoke) OVERRIDE; | 
 | 65 | #include "intrinsics_list.h" | 
| Andreas Gampe | 8cf9cb3 | 2017-07-19 09:28:38 -0700 | [diff] [blame] | 66 |   INTRINSICS_LIST(OPTIMIZING_INTRINSICS) | 
| Anton Kirilov | 5ec6218 | 2016-10-13 20:16:02 +0100 | [diff] [blame] | 67 | #undef INTRINSICS_LIST | 
 | 68 | #undef OPTIMIZING_INTRINSICS | 
 | 69 |  | 
 | 70 |  private: | 
 | 71 |   ArenaAllocator* GetAllocator(); | 
 | 72 |   ArmVIXLAssembler* GetAssembler(); | 
 | 73 |  | 
| Vladimir Marko | 69d310e | 2017-10-09 14:12:23 +0100 | [diff] [blame] | 74 |   CodeGeneratorARMVIXL* const codegen_; | 
| Anton Kirilov | 5ec6218 | 2016-10-13 20:16:02 +0100 | [diff] [blame] | 75 |  | 
 | 76 |   DISALLOW_COPY_AND_ASSIGN(IntrinsicCodeGeneratorARMVIXL); | 
 | 77 | }; | 
 | 78 |  | 
 | 79 | }  // namespace arm | 
 | 80 | }  // namespace art | 
 | 81 |  | 
 | 82 | #endif  // ART_COMPILER_OPTIMIZING_INTRINSICS_ARM_VIXL_H_ |