/* * Copyright (c) 2021 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef PANDA_RUNTIME_INTERPRETER_VREGISTER_INL_H_ #define PANDA_RUNTIME_INTERPRETER_VREGISTER_INL_H_ #include "runtime/interpreter/vregister.h" namespace panda::interpreter { template template struct VRegisterIface::ValueAccessor { ALWAYS_INLINE static inline int32_t Get(const VRegisterIface &vreg) { return vreg.Get(); } }; template template struct VRegisterIface::ValueAccessor { ALWAYS_INLINE static inline uint32_t Get(const VRegisterIface &vreg) { return vreg.Get(); } }; template template struct VRegisterIface::ValueAccessor { ALWAYS_INLINE static inline int8_t Get(const VRegisterIface &vreg) { return static_cast(vreg.Get()); } }; template template struct VRegisterIface::ValueAccessor { ALWAYS_INLINE static inline uint8_t Get(const VRegisterIface &vreg) { return static_cast(vreg.Get()); } }; template template struct VRegisterIface::ValueAccessor { ALWAYS_INLINE static inline int16_t Get(const VRegisterIface &vreg) { return static_cast(vreg.Get()); } }; template template struct VRegisterIface::ValueAccessor { ALWAYS_INLINE static inline uint16_t Get(const VRegisterIface &vreg) { return static_cast(vreg.Get()); } }; template template struct VRegisterIface::ValueAccessor { ALWAYS_INLINE static inline int64_t Get(const VRegisterIface &vreg) { return vreg.GetLong(); } }; template template struct VRegisterIface::ValueAccessor { ALWAYS_INLINE static inline uint64_t Get(const VRegisterIface &vreg) { return vreg.GetLong(); } }; template template struct VRegisterIface::ValueAccessor { ALWAYS_INLINE static inline float Get(const VRegisterIface &vreg) { return vreg.GetFloat(); } }; template template struct VRegisterIface::ValueAccessor { ALWAYS_INLINE static inline double Get(const VRegisterIface &vreg) { return vreg.GetDouble(); } }; template template struct VRegisterIface::ValueAccessor { ALWAYS_INLINE static inline ObjectHeader *Get(const VRegisterIface &vreg) { return vreg.GetReference(); } }; } // namespace panda::interpreter #endif // PANDA_RUNTIME_INTERPRETER_VREGISTER_INL_H_