Navigation Menu

Skip to content

Commit

Permalink
- update asmjit
Browse files Browse the repository at this point in the history
  • Loading branch information
dpjudas committed Aug 7, 2019
1 parent e1d5a17 commit ef72e91
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
6 changes: 3 additions & 3 deletions libraries/asmjit/asmjit/core/globals.h
Expand Up @@ -21,7 +21,7 @@ ASMJIT_BEGIN_NAMESPACE
namespace Support {
//! Cast designed to cast between function and void* pointers.
template<typename Dst, typename Src>
static constexpr Dst ptr_cast_impl(Src p) noexcept { return (Dst)p; }
static inline Dst ptr_cast_impl(Src p) noexcept { return (Dst)p; }
} // {Support}

#if defined(ASMJIT_NO_STDCXX)
Expand Down Expand Up @@ -342,9 +342,9 @@ namespace ByteOrder {
// ============================================================================

template<typename Func>
static constexpr Func ptr_as_func(void* func) noexcept { return Support::ptr_cast_impl<Func, void*>(func); }
static inline Func ptr_as_func(void* func) noexcept { return Support::ptr_cast_impl<Func, void*>(func); }
template<typename Func>
static constexpr void* func_as_ptr(Func func) noexcept { return Support::ptr_cast_impl<void*, Func>(func); }
static inline void* func_as_ptr(Func func) noexcept { return Support::ptr_cast_impl<void*, Func>(func); }

// ============================================================================
// [asmjit::DebugUtils]
Expand Down
8 changes: 8 additions & 0 deletions libraries/asmjit/asmjit/x86/x86internal.cpp
Expand Up @@ -824,6 +824,7 @@ ASMJIT_FAVOR_SIZE Error X86Internal::emitRegMove(Emitter* emitter,

uint32_t instId = Inst::kIdNone;
uint32_t memFlags = 0;
uint32_t overrideMemSize = 0;

enum MemFlags : uint32_t {
kDstMem = 0x1,
Expand Down Expand Up @@ -876,6 +877,7 @@ ASMJIT_FAVOR_SIZE Error X86Internal::emitRegMove(Emitter* emitter,
default: {
uint32_t elementTypeId = Type::baseOf(typeId);
if (Type::isVec32(typeId) && memFlags) {
overrideMemSize = 4;
if (elementTypeId == Type::kIdF32)
instId = avxEnabled ? Inst::kIdVmovss : Inst::kIdMovss;
else
Expand All @@ -884,6 +886,7 @@ ASMJIT_FAVOR_SIZE Error X86Internal::emitRegMove(Emitter* emitter,
}

if (Type::isVec64(typeId) && memFlags) {
overrideMemSize = 8;
if (elementTypeId == Type::kIdF64)
instId = avxEnabled ? Inst::kIdVmovsd : Inst::kIdMovsd;
else
Expand All @@ -908,6 +911,11 @@ ASMJIT_FAVOR_SIZE Error X86Internal::emitRegMove(Emitter* emitter,
if (!instId)
return DebugUtils::errored(kErrorInvalidState);

if (overrideMemSize) {
if (dst.isMem()) dst.as<Mem>().setSize(overrideMemSize);
if (src.isMem()) src.as<Mem>().setSize(overrideMemSize);
}

emitter->setInlineComment(comment);
return emitter->emit(instId, dst, src);
}
Expand Down
2 changes: 1 addition & 1 deletion libraries/asmjit/asmjit/x86/x86rapass.cpp
Expand Up @@ -175,7 +175,7 @@ Error X86RACFGBuilder::onInst(InstNode* inst, uint32_t& controlType, RAInstBuild
}
}

// Do not use RegMem flag if chaning Reg to Mem requires additional
// Do not use RegMem flag if changing Reg to Mem requires additional
// CPU feature that may not be enabled.
if (rwInfo.rmFeature() && (flags & (RATiedReg::kUseRM | RATiedReg::kOutRM))) {
flags &= ~(RATiedReg::kUseRM | RATiedReg::kOutRM);
Expand Down

0 comments on commit ef72e91

Please sign in to comment.