diff options
Diffstat (limited to 'packaging/0001-ARM-Linux-Support-unaligned-struct-read-write-11290.patch')
-rw-r--r-- | packaging/0001-ARM-Linux-Support-unaligned-struct-read-write-11290.patch | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/packaging/0001-ARM-Linux-Support-unaligned-struct-read-write-11290.patch b/packaging/0001-ARM-Linux-Support-unaligned-struct-read-write-11290.patch new file mode 100644 index 0000000000..70f948b4eb --- /dev/null +++ b/packaging/0001-ARM-Linux-Support-unaligned-struct-read-write-11290.patch @@ -0,0 +1,84 @@ +From 233bb0c8341079163acc12bea195e649f54ec5fb Mon Sep 17 00:00:00 2001 +From: Jonghyun Park <parjong@gmail.com> +Date: Sat, 20 May 2017 06:26:27 +0900 +Subject: [PATCH 01/23] [ARM/Linux] Support unaligned struct read/write + (#11290) + +* [ARM/Linux] Support unaligned struct read + +* Fix format error + +* Support unaligned struct write +--- + src/jit/importer.cpp | 15 ++++++++++----- + src/jit/morph.cpp | 14 ++++++++++++++ + 2 files changed, 24 insertions(+), 5 deletions(-) + +diff --git a/src/jit/importer.cpp b/src/jit/importer.cpp +index 74018c4..2d50741 100644 +--- a/src/jit/importer.cpp ++++ b/src/jit/importer.cpp +@@ -14710,6 +14710,11 @@ void Compiler::impImportBlockCode(BasicBlock* block) + assertImp(varTypeIsStruct(op2)); + + op1 = impAssignStructPtr(op1, op2, resolvedToken.hClass, (unsigned)CHECK_SPILL_ALL); ++ ++ if (op1->OperIsBlkOp() && (prefixFlags & PREFIX_UNALIGNED)) ++ { ++ op1->gtFlags |= GTF_BLK_UNALIGNED; ++ } + goto SPILL_APPEND; + } + +@@ -14822,11 +14827,6 @@ void Compiler::impImportBlockCode(BasicBlock* block) + // Could point anywhere, example a boxed class static int + op1->gtFlags |= GTF_IND_TGTANYWHERE | GTF_GLOB_REF; + assertImp(varTypeIsArithmetic(op1->gtType)); +- +- if (prefixFlags & PREFIX_UNALIGNED) +- { +- op1->gtFlags |= GTF_IND_UNALIGNED; +- } + } + else + { +@@ -14836,6 +14836,11 @@ void Compiler::impImportBlockCode(BasicBlock* block) + } + op1->gtFlags |= GTF_EXCEPT; + ++ if (prefixFlags & PREFIX_UNALIGNED) ++ { ++ op1->gtFlags |= GTF_IND_UNALIGNED; ++ } ++ + impPushOnStack(op1, tiRetVal); + break; + } +diff --git a/src/jit/morph.cpp b/src/jit/morph.cpp +index 9404469..27a1dae 100644 +--- a/src/jit/morph.cpp ++++ b/src/jit/morph.cpp +@@ -9960,6 +9960,20 @@ GenTreePtr Compiler::fgMorphCopyBlock(GenTreePtr tree) + requiresCopyBlock = true; + } + ++#if defined(_TARGET_ARM_) ++ if ((rhs->OperIsIndir()) && (rhs->gtFlags & GTF_IND_UNALIGNED)) ++ { ++ JITDUMP(" rhs is unaligned"); ++ requiresCopyBlock = true; ++ } ++ ++ if (asg->gtFlags & GTF_BLK_UNALIGNED) ++ { ++ JITDUMP(" asg is unaligned"); ++ requiresCopyBlock = true; ++ } ++#endif // _TARGET_ARM_ ++ + if (dest->OperGet() == GT_OBJ && dest->AsBlk()->gtBlkOpGcUnsafe) + { + requiresCopyBlock = true; +-- +1.9.1 + |