Matt Ellis [Fri, 13 May 2016 02:48:23 +0000 (19:48 -0700)]
Merge pull request dotnet/coreclr#4945 from dotnet-bot/from-tfs
Merge changes from TFS
Commit migrated from https://github.com/dotnet/coreclr/commit/
50cf21d1091036c4cd8f82cd9987d0cbf4f1f29f
John Chen [Fri, 13 May 2016 00:39:03 +0000 (17:39 -0700)]
Merge pull request dotnet/coreclr#4932 from JohnChen0/r2r
Fix contract violations in Ready to Run code
Commit migrated from https://github.com/dotnet/coreclr/commit/
94171ab2c3cfd497ea6cf8cb9c923a9a8c1a17e9
Kyungwoo Lee [Fri, 13 May 2016 00:00:18 +0000 (17:00 -0700)]
Merge pull request dotnet/coreclr#4933 from dotnet-bot/from-tfs
Merge changes from TFS
Commit migrated from https://github.com/dotnet/coreclr/commit/
ba652ab045b14764888494bf0c2d5289b21b4959
Carol Eidt [Thu, 12 May 2016 23:34:00 +0000 (16:34 -0700)]
Update first-class-structs.md
Update some progress and fix some formatting
Commit migrated from https://github.com/dotnet/coreclr/commit/
b92d10d82e9553bd0b70e5e6a851cc82ad0bb11f
Russ Keldorph [Thu, 12 May 2016 23:07:27 +0000 (16:07 -0700)]
Small formatting fix
Commit migrated from https://github.com/dotnet/coreclr/commit/
e49e825fdce88ce24e287cdc71a37dac984339b8
Sean Gillespie [Thu, 12 May 2016 21:55:12 +0000 (14:55 -0700)]
Merge pull request dotnet/coreclr#4899 from swgillespie/gcsimulator-fixup
Enable the GCSimulator CI run to run on a regular basis
Commit migrated from https://github.com/dotnet/coreclr/commit/
97769611d228be9f042fae64390b34ed33d2fd5a
Tarek Mahmoud Sayed [Thu, 12 May 2016 20:17:40 +0000 (13:17 -0700)]
Merge pull request dotnet/coreclr#4915 from tarekgh/FixLowerAsciiCharChecks
Fix the optimization check to call ordinal
Commit migrated from https://github.com/dotnet/coreclr/commit/
1d2b39484385a6dd8b22eb45329f8dfd3389a180
John Chen (CLR) [Thu, 12 May 2016 17:02:33 +0000 (10:02 -0700)]
Fix contract violations in Ready to Run code
Commit migrated from https://github.com/dotnet/coreclr/commit/
e732c0a3fe1649995e62d577a067d4f066c79b22
Pat Gavlin [Thu, 12 May 2016 19:57:13 +0000 (12:57 -0700)]
Apply the JIT interface changes needed for Fadi's upcoming shared generics change.
[tfs-changeset: 1604316]
Commit migrated from https://github.com/dotnet/coreclr/commit/
8a972e65990b962613b474c11639245d90be5079
Aditya Mandaleeka [Thu, 12 May 2016 19:51:46 +0000 (12:51 -0700)]
Update unix-test-instructions.md
Add quotes around coreFxBinDir in unix-test-instructions document.
Commit migrated from https://github.com/dotnet/coreclr/commit/
c1181048d92afa49043cdd4ef50962eb2a949007
Brian Sullivan [Thu, 12 May 2016 18:21:17 +0000 (11:21 -0700)]
Fix trival build break, with warning treated as error for jmpDist usage
[tfs-changeset: 1604285]
Commit migrated from https://github.com/dotnet/coreclr/commit/
7100aeb91649f7f1f8cd552419a38d51c7402927
Bruce Forstall [Thu, 12 May 2016 17:59:50 +0000 (10:59 -0700)]
Merge pull request dotnet/coreclr#4931 from dotnet-bot/from-tfs
Merge changes from TFS
Commit migrated from https://github.com/dotnet/coreclr/commit/
33e581efe3ae54cd9fb8c832304b6f3b394c24dd
Matt Ellis [Thu, 12 May 2016 17:42:33 +0000 (10:42 -0700)]
Merge pull request dotnet/coreclr#4419 from ellismg/change-default-locale
Change how we detect the default locale
Commit migrated from https://github.com/dotnet/coreclr/commit/
82fe3afb8ad6431cd8c535ad2b857d6f7d16e8dc
Kyungwoo Lee [Thu, 12 May 2016 17:24:56 +0000 (10:24 -0700)]
Merge pull request dotnet/coreclr#4919 from kyulee1/switch
ARM64: Switch Expansion Using Jump Table
Commit migrated from https://github.com/dotnet/coreclr/commit/
6d550d74684f873f4dec17aa0d9e965e6850bd98
Kyungwoo Lee [Thu, 12 May 2016 04:48:40 +0000 (21:48 -0700)]
ARM64: Switch Expansion Using Jump Table
Fixes dotnet/coreclr#3332
To validate various addressing in dotnet/coreclr#4896, I just enable this.
Previously, we only allow a load operation to JIT data (`ldr` or
`IF_LARGELDC`).
For switch expansion, jump table is also recorded into JIT data.
In this case, we only get the address of jump table head, and
load the right entry after computing offset. So, basically `adr` or
`IF_LARGEADR` is used to not only load label within code but also refer to
the location of JIT data.
The typical code sequence for switch expansion is like this:
```
adr x8, [@RWD00] // load address of jump table head
ldr w8, [x8, x0, LSL dotnet/coreclr#2] // load jump entry from table addr + x0 * 4
adr x9, [G_M56320_IG02] // load address of current baisc block
add x8, x8, x9 // Add them to compute the final target
br x8 // Indirectly jump to the target
```
Commit migrated from https://github.com/dotnet/coreclr/commit/
a0c6144d406f29d70005fbf7ebd8ac3bdfe3cc0d
Jan Kotas [Thu, 12 May 2016 15:54:17 +0000 (08:54 -0700)]
Fix desktop build
[tfs-changeset: 1604234]
Commit migrated from https://github.com/dotnet/coreclr/commit/
a64342db509abbcce49b1a6e68c60fb550ef34b1
Kyungwoo Lee [Thu, 12 May 2016 15:46:53 +0000 (08:46 -0700)]
Merge pull request dotnet/coreclr#4926 from mylibero/issue4925
Fixed a build error on ARM
Commit migrated from https://github.com/dotnet/coreclr/commit/
4678ac883a8eafa45246fff978a4756483e0f067
Dongyun Jin [Thu, 12 May 2016 06:24:07 +0000 (15:24 +0900)]
Fixed a build error on ARM
The recent commit (61fe464) breaks ARM build.
It defines emitInsToJumpKind twice in src/jit/emit.h on ARM.
Signed-off-by: Dongyun Jin <dongyun.jin@samsung.com>
Signed-off-by: Jiyoung Yun <jy910.yun@samsung.com>
Commit migrated from https://github.com/dotnet/coreclr/commit/
ebe8f551bf59befc8925681f50e43d83e6823992
David Mason [Thu, 12 May 2016 04:45:31 +0000 (21:45 -0700)]
Merge pull request dotnet/coreclr#4872 from vancem/FixETWArgs
Fix problem getting arguments from ETW to an EventSource.
Commit migrated from https://github.com/dotnet/coreclr/commit/
ad317b984e82c1208d5e2dcec807192a24b881d7
Kyungwoo Lee [Thu, 12 May 2016 04:37:47 +0000 (21:37 -0700)]
Merge pull request dotnet/coreclr#4896 from kyulee1/longjmp
ARM64: Enable Long Address
Commit migrated from https://github.com/dotnet/coreclr/commit/
3e986665bf96e9acf7f07c3efd171cf98c9d0ca2
Pat Gavlin [Thu, 12 May 2016 04:21:47 +0000 (21:21 -0700)]
Merge pull request dotnet/coreclr#4920 from pgavlin/JitStandaloneDefs
Remove the use of `CROSSGEN_COMPILE` in jitconfigvalues.h.
Commit migrated from https://github.com/dotnet/coreclr/commit/
1c2d8a6f958907e7ba9ac1198124d6611494001e
Kyungwoo Lee [Fri, 6 May 2016 15:11:08 +0000 (08:11 -0700)]
ARM64: Enable Long Address
Fixes https://github.com/dotnet/coreclr/issues/3668
Currently ARM64 codegen can have reference within +/-1 MB due to encoding
restriction in `b<cond>/adr/ldr` instructions. This is normally okay
assuming each function is reasonably small, but certainly not working for large method which also
can be formed with an aggressive inlining probably like crossgen/corert scenarios.
In addition, for hot/cold code separation long address is a prerequisite
since reference can be across different regions which are arbitrary.
In fact, we need additional relocations which are not in this change yet.
In details, this supports long address for conditional jump/address loading/constant
loading operations by default while they can be shortened later by
`emitJumpDistBind()` if they can fit into the smaller encoding. Logically
those operations now can reach within +/-4GB address range.
Note I haven't extended unconditional jump in this change for simplicity
so it can reach within +/-128MB same as before.
`emitOutputLJ` is extended to finally encode these operations.
There are 3 pseudo instructions introduced. These can be expanded either
short/long form.
1. Conditional jump. See `emitIns_J()`
a. Short form(`IF_BI_0B`): `b<cond> rel_addr`
b. Long form(`IF_LARGEJMP`):
```
b<rev cond> $LABEL
b rel_addr (unconditional jump)
$LABEL:
```
2. Load label(address computation). See `emitIns_R_L()`
a. Short form(`IF_DI_1E`): `adr x, [rel_addr]`
b. Long form(`IF_LARGEADR`):
```
adrp x, [rel_page_addr]
add x, x, page_offs
```
3. Load constant (from JIT data). See `emitIns_R_C()`
a. Short form(`IF_LS_1A`): `ldr x, [rel_addr]`
b. Long form(`IF_LARGLDC`):
```
adrp x, [rel_page_addr]
ldr x, [x, page_offs]
(fmov v, x in case loading vector constant)
```
In addition, JIT data is aligned on 8 byte to be accessible from large
load. Replaced JitLargeBranches by JitLongAddress to test stress on these
operations.
Commit migrated from https://github.com/dotnet/coreclr/commit/
61fe4641665e84089dcceeabbea3e5faa0f693ce
Tarekm Mahmoud Sayed [Wed, 11 May 2016 17:38:21 +0000 (10:38 -0700)]
Fix the optimization check to call ordinal
we have some optimization to check if we can perform the string search as ordinal
operation instead of lingustic operation. we used to check if the string is Ascii
which check if all chars in the string are in range 0~7F.
This check was not enough because in Linux, ICU do some special handling for some
characters in the Ascii range. so we need to avoid calling the ordinal operation
when encountering such chracters.
The fix is to take the advantage of String.IsFastSort which do exactly what we need
Commit migrated from https://github.com/dotnet/coreclr/commit/
60c011b9eee1549b162a29edbb13e7e131b596a3
Lubomir Litchev [Thu, 12 May 2016 02:10:31 +0000 (19:10 -0700)]
Merge pull request dotnet/coreclr#4917 from LLITCHEV/Issue2329
Increase timeout for GCStress jobs. Set the gcstress15_pri1r2r to be a
Commit migrated from https://github.com/dotnet/coreclr/commit/
2528da7f84dd132b36890c4c8325846a0c7a2702
Pat Gavlin [Wed, 11 May 2016 22:18:54 +0000 (15:18 -0700)]
Remove the use of `CROSSGEN_COMPILE` in jitconfigvalues.h.
This symbol was previously used to ensure that noway failures did not trigger
debugger breaks when running non-release builds of the JIT in crossgen on the
desktop CLR. We believe that this behavior is no longer necessary nor desirable.
Commit migrated from https://github.com/dotnet/coreclr/commit/
ef8e636e01acaea4d70791f92c2e4d321f1259b8
Bruce Forstall [Wed, 11 May 2016 22:23:37 +0000 (15:23 -0700)]
Merge pull request dotnet/coreclr#4916 from BruceForstall/TweakLongs
Small tweaks to RyuJIT/x86 LONG handling
Commit migrated from https://github.com/dotnet/coreclr/commit/
c18fe80d0d43cccb1aa7214e9bc446711520d0c7
Lubomir Litchev [Wed, 11 May 2016 18:46:31 +0000 (11:46 -0700)]
Increase timeout for GCStress jobs. Set the gcstress15_pri1r2r to be a
GCStress job.
Commit migrated from https://github.com/dotnet/coreclr/commit/
2052eae800bd6a0f347586409fdda39d7584fb6f
Rama krishnan Raghupathy [Wed, 11 May 2016 21:15:11 +0000 (14:15 -0700)]
Merge pull request dotnet/coreclr#4809 from ramarag/ZapUnwindInfo
[Arm64]: Implement GetUnwindDataBlob
Commit migrated from https://github.com/dotnet/coreclr/commit/
48fa30ee5aa0b95a939934da40822f46b16ee807
Bruce Forstall [Wed, 11 May 2016 18:39:04 +0000 (11:39 -0700)]
Merge pull request dotnet/coreclr#1241 from mikedn/modopt
Extend the DIV/MOD dividend into RDX:RAX only if needed
Commit migrated from https://github.com/dotnet/coreclr/commit/
007551451453e83d1436ef8701bf8cd815a0ed57
Geoff Kizer [Wed, 11 May 2016 18:29:50 +0000 (11:29 -0700)]
Merge pull request dotnet/coreclr#4762 from geoffkizer/ecsopt
Optimize async invocation
Commit migrated from https://github.com/dotnet/coreclr/commit/
148b5621f026400c83e066ad3dfa0d55f82ffa23
Carol Eidt [Wed, 11 May 2016 18:21:07 +0000 (11:21 -0700)]
Merge pull request dotnet/coreclr#4848 from mikedn/lsra-counts
Remove unnecessary LSRA members
Commit migrated from https://github.com/dotnet/coreclr/commit/
ce6b084ef17cb96941115b48dc5f3c60cf114987
Bruce Forstall [Wed, 11 May 2016 17:35:47 +0000 (10:35 -0700)]
Small tweaks to RyuJIT/x86 LONG handling
1. Display GT_LONG trees in JitDump as gt_long, not just "long". This
helps distinguish them from the pervasive "long" type, making them easier
to see and search for.
2. Change the "hi" operator GT_* node definition to not include GTK_EXOP.
3. Dump the lva table after lvaPromoteLongVars().
Commit migrated from https://github.com/dotnet/coreclr/commit/
e1715220e9d00b0e3db3d9f3422d2a982b958a65
Wes Haggard [Wed, 11 May 2016 17:22:29 +0000 (10:22 -0700)]
Merge pull request dotnet/coreclr#4890 from AlexGhiondea/BuildRefAssemblyPerTargetOS
Fix the reference assembly for mscorlib to match the surface area of the OS
Commit migrated from https://github.com/dotnet/coreclr/commit/
b59a6045bca5e4c11b4078fede0fd567a2c8d873
Bruce Forstall [Wed, 11 May 2016 17:13:06 +0000 (10:13 -0700)]
Merge pull request dotnet/coreclr#4903 from BruceForstall/MoveToLegacy
Move some LEGACY_BACKEND code to codegenlegacy.cpp
Commit migrated from https://github.com/dotnet/coreclr/commit/
12aadb8ff959b2e923e456916be3b5b2282a9374
Bruce Forstall [Wed, 11 May 2016 17:12:39 +0000 (10:12 -0700)]
Merge pull request dotnet/coreclr#4900 from BruceForstall/PartialFix4817c
Fix kill set of rep stos to include ECX
Commit migrated from https://github.com/dotnet/coreclr/commit/
483efe7d186828d51444756328398995e5527149
tijoytom [Wed, 11 May 2016 16:57:46 +0000 (09:57 -0700)]
Merge pull request dotnet/coreclr#4895 from tijoytom/master
Cleaning up a bunch of warnings.
Commit migrated from https://github.com/dotnet/coreclr/commit/
57c091cbd043b2597f1824b468f11e0ca6df8325
Jan Kotas [Wed, 11 May 2016 11:17:04 +0000 (04:17 -0700)]
Merge pull request dotnet/coreclr#4898 from dotnet-bot/from-tfs
Merge changes from TFS
Commit migrated from https://github.com/dotnet/coreclr/commit/
3eb2a48ed579e6324399548131d0351d99839a88
Geunsik Lim [Wed, 11 May 2016 08:44:36 +0000 (17:44 +0900)]
Linux/ARM: Use -O1 level to avoid segfault in release-build for Linux/ARM (dotnet/coreclr#4904)
We cannot still run 'hello world' console application even though
the cross compilation of CoreCLR is successfully completed.
In release-build, the segmentation fault of 'hello world'
is made by the misalignment of thread local storage (TLS) section
because of the aggressive optimization level of clang compiler for
code optimization(e.g., file size and execution speed).
It means that Clang/LLVM has a bug in case of the usage of O2/O3 flag.
Below is the major difference among the optimization levels of Clang.
* -O2 is based on -O1:
.adding: -gvn -constmerge -globaldce -slp-vectorizer -mldst-motion -inline
.removing: -always-inline
* -O3 is based on -O2:
.adding: -argpromotion
ver2:
- Corerun is loading 'libcoreclr.so' using dlopen() library call. So, we can not
use initial-exec TLS model (ver1) because of the thread-safe issue of
the multi-threaded. (Reported by @janvorli)
- In the release-build, Let's replace -O3 with -O1 to avoid the segmentation
fault due to the aggressive optimization level of the Clang until fixing
the bug of the Clang/LLVM.
ver1:
- The default value of clang is "global-dynamic". However, the thread-local
storage (TLS) model of Clang/LLVM does not guarantee the normal execution
of TLS's symbol relocation due to the misaligned __tls_get_addr symbol in
case of the aggressive optimizations of Clang on Linux/ARM.
- Let's enable initial-exec TLS model instead of the dynamic TLS model.
Signed-off-by: Geunsik Lim <geunsik.lim@samsung.com>
CC: Jan Kotas <jkotas@microsoft.com>
CC: Jan Vorlicek <janvorli@microsoft.com>
Commit migrated from https://github.com/dotnet/coreclr/commit/
ee28eca285fc71acad093eb5e34101d2ab9e2018
geoffkizer [Thu, 11 Feb 2016 19:44:19 +0000 (11:44 -0800)]
Improve performance of ExecutionContextSwitcher to help async invocation perf
Commit migrated from https://github.com/dotnet/coreclr/commit/
5ede820db415f083a0086d9f3e5e5cdd64ccce61
Rama Krishnan Raghupathy [Thu, 5 May 2016 22:45:22 +0000 (15:45 -0700)]
[Arm64]: Implement GetUnwindDataBlob
Commit migrated from https://github.com/dotnet/coreclr/commit/
b8ec1f8f7fb462aba23faf6daefeee8a5e037d3b
Bruce Forstall [Wed, 11 May 2016 00:33:09 +0000 (17:33 -0700)]
Move some LEGACY_BACKEND code from codegencommon.cpp to codegenlegacy.cpp
And, move some header file changes from codegen.h to codegenclassic.h.
The code moved were whole functions with no apparent tight coupling with
other code already in codegencommon.cpp.
The code moved had some #ifndef LEGACY_BACKEND portions, no longer
needed, removed.
Commit migrated from https://github.com/dotnet/coreclr/commit/
fa74a694fe525847e8833613e2b31edc813b30b3
Jan Vorlicek [Wed, 11 May 2016 00:15:45 +0000 (02:15 +0200)]
Change hosting API string encoding to UTF-8 on Windows (dotnet/coreclr#4894)
This change fixes a problem with the string encoding in the hosting API
using CP_ACP, which causes problem when the input is a string in other
language than the current Windows one. In such case, it loses some
characters.
The fix is to use UTF-8 encoding (which is what CP_ACP means on Unix
PAL too).
Commit migrated from https://github.com/dotnet/coreclr/commit/
5c3d1efea4a8673086df4ba36267d7f580ba9c8c
Bruce Forstall [Tue, 10 May 2016 23:43:55 +0000 (16:43 -0700)]
Fix kill set of rep stos to include ECX
There was a very strange condition in the existing code to only
conditionally include ECX in the kill set. I convinced myself that
for AMD64, this condition always holds in this code path (which
makes a lot more sense anyway), so I removed the condition, and
also made all this code execute for x86 as well.
Fixes dotnet/coreclr#4817
Commit migrated from https://github.com/dotnet/coreclr/commit/
6e05fb4c01eeb133aa8683a581e5becab8d20b62
Sean Gillespie [Tue, 10 May 2016 19:03:16 +0000 (12:03 -0700)]
Enable the GCSimulator CI run to run on a regular basis
Commit migrated from https://github.com/dotnet/coreclr/commit/
46ba7777d233c3b3787ea02b8226e340f09d574c
Jan Kotas [Tue, 10 May 2016 23:26:42 +0000 (16:26 -0700)]
Fix razzle build breaks
[tfs-changeset: 1603547]
Commit migrated from https://github.com/dotnet/coreclr/commit/
5045b02082847646ee673b0c4d8ba07b6fc5beec
Alex Ghiondea [Tue, 10 May 2016 21:53:35 +0000 (14:53 -0700)]
Build the reference assembly and the facade for mscorlib.
Make sure that the facade projects generates pdbs when possible.
Commit migrated from https://github.com/dotnet/coreclr/commit/
b451522dd3c012e78ceae772fc1fb8cf87c35083
Alex Ghiondea [Tue, 10 May 2016 19:46:55 +0000 (12:46 -0700)]
Create a Nuget package that will contain the reference assembly for mscorlib.
Commit migrated from https://github.com/dotnet/coreclr/commit/
a5ba6fa7ff153c239d1e37939e8a320f3c13acf9
tijoytk [Tue, 10 May 2016 22:19:24 +0000 (15:19 -0700)]
Cleaning up a bunch of warnings.
Commit migrated from https://github.com/dotnet/coreclr/commit/
9dc0fd926d34ccb4fc9a50e1fa4d684682e777d6
Alex Ghiondea [Tue, 10 May 2016 18:21:17 +0000 (11:21 -0700)]
Fix the reference assembly for mscorlib to match the surface area of the OS on which it builds.
Commit migrated from https://github.com/dotnet/coreclr/commit/
295566490dc2c6c01f9e5e1db215d005def2d42e
Bruce Forstall [Tue, 10 May 2016 21:51:44 +0000 (14:51 -0700)]
Merge pull request dotnet/coreclr#4891 from BruceForstall/PartialFix4817
Block ops using rep on x86 need to kill edi/esi/ecx, same as x64
Commit migrated from https://github.com/dotnet/coreclr/commit/
99c79ff3703439126a31216d056b44d6ef877ab7
Andy Ayers [Tue, 10 May 2016 20:54:13 +0000 (13:54 -0700)]
Merge pull request dotnet/coreclr#4878 from AndyAyersMS/AddMissingBenchmarkAttrs
Add missing xunit performance attributes
Commit migrated from https://github.com/dotnet/coreclr/commit/
5383f6bc8daecb66db16d27439b8d1be499454d4
Vance Morrison [Tue, 10 May 2016 19:32:13 +0000 (12:32 -0700)]
One for fix for non-windows platforms
Commit migrated from https://github.com/dotnet/coreclr/commit/
b76d77fc52adc5936a6c1a0950e298488b6dfa5a
Bruce Forstall [Tue, 10 May 2016 18:52:30 +0000 (11:52 -0700)]
Block ops using rep on x86 need to kill edi/esi/ecx, same as x64
Commit migrated from https://github.com/dotnet/coreclr/commit/
3d3bebe396d1563d965093064829d63f66a885dd
AlexGhiondea [Tue, 10 May 2016 18:36:05 +0000 (11:36 -0700)]
Merge pull request dotnet/coreclr#4833 from AlexGhiondea/StringBuilderFixes
Improve detection of error condition when using StringBuilder
Commit migrated from https://github.com/dotnet/coreclr/commit/
fa4d5f15797acba17ff6b204fe1fe310c40d750e
Mike Danes [Mon, 9 May 2016 22:01:12 +0000 (01:01 +0300)]
Optimize integer div/mod by const power of 2 in lowering
Optimizing GT_DIV/GT_UDIV/GT_MOD/GT_UMOD by power of 2 in codegen is problematic because the xarch DIV instruction has special register requirements. By the time codegen decides to perform the optimization the rax and rdx registers have been already allocated by LSRA even though they're not always needed (as it happens in the case of unsigned division where CDQ isn't used).
Since the JIT can't represent a CDQ instruction in its IR an arithmetic shift (GT_RSH) has been instead to extract the dividend sign. xarch's SAR is larger than CDQ but it has the advantage that it doesn't require specific registers. Also, arithmetic shifts are available on architectures other than xarch.
Example: method "static int foo(int x) => x / 8;" is now compiled to
mov eax, ecx
mov edx, eax
sar edx, 31
and edx, 7
add edx, eax
mov eax, edx
sar eax, 3
instead of
mov eax, ecx
cdq
and edx, 7
add eax, edx
sar eax, 3
As a side-effect of this change the optimization now also works when the divisor is too large to be contained. Previously this wasn't possible because the divisor constant needed to be modified during codegen but the constant was already loaded into a register.
Example: method "static ulong foo(ulong x) => x /
4294967296;" is now compiled to
mov rax, rcx
shr rax, 32
whereas before a DIV instruction was used.
This change also fixes an issue in fgShouldUseMagicNumberDivide. The optimization that is done in lower can handle negative power of 2 divisors but fgShouldUseMagicNumberDivide handled those cases because it didn't check the absolute value of the divisor.
Example: method "static int foo(int x) => return x / -2;" is now compiled to
mov eax, ecx
mov edx, eax
shr edx, 31
add edx, eax
sar edx, 1
mov eax, edx
neg eax
instead of
mov eax, 0x7FFFFFFF
imul edx:eax, ecx
mov eax, edx
sub eax, ecx
mov edx, eax
shr edx, 31
add eax, edx
Commit migrated from https://github.com/dotnet/coreclr/commit/
d3647c10d7f01daa1f6b38fd601cd9606a08b687
tijoytom [Tue, 10 May 2016 17:33:36 +0000 (10:33 -0700)]
Merge pull request dotnet/coreclr#4793 from tijoytom/master
UTF8 Marshaling support(UnmanagedType.LPUTF8Str)
Commit migrated from https://github.com/dotnet/coreclr/commit/
72b1ea011f28c1897fa2a668f0676a075bdb6b6e
Vance Morrison [Tue, 10 May 2016 16:38:55 +0000 (09:38 -0700)]
Fix non-widows builds.
Commit migrated from https://github.com/dotnet/coreclr/commit/
e7496075c4dab4e029d0cb52edbc01ed253868d1
Hugh Bellamy [Tue, 10 May 2016 14:52:05 +0000 (15:52 +0100)]
Fix ArgumentNullException messages passed as parameter names (dotnet/coreclr#2889)
Fixed several ArgumentNullExceptions that throw with the message as the parameter name, leading to potential confusion for developers.
Commit migrated from https://github.com/dotnet/coreclr/commit/
ad2485b93ce14437c0dc8b4fb69b0a54177fe09f
Jonghyun Park [Tue, 10 May 2016 14:51:26 +0000 (23:51 +0900)]
Adjust relative offsets in UMThunkStub (dotnet/coreclr#4888)
* Adjust relative offsets in UMThunkStub
This commit updates the relative offsets inside UMThunkStub according to the recent changes in
UMThunkStub (for stack unwinding).
* Uses 'UMThunkStub_StackArgsSize' instead of 'UMThunkStub_StackArgsOffset'
This commit revises 'UM2MThunk_WrapperHelper' to use 'UMThunkStub_StackArgsSize'
instead of 'UMThunkStub_StackArgsOffset'.
Commit migrated from https://github.com/dotnet/coreclr/commit/
7fe0fef10a3c9654673aff5366d97f3dc74a68e5
Jan Kotas [Tue, 10 May 2016 13:34:17 +0000 (06:34 -0700)]
Merge pull request dotnet/coreclr#4713 from myungjoo/fix/4712
Match Inconsistent CMake/MSBuild Compiler Definitions 2
Commit migrated from https://github.com/dotnet/coreclr/commit/
37ecae6b728a2673854aebc2c7737e90e53e70e0
Jan Kotas [Tue, 10 May 2016 13:15:00 +0000 (06:15 -0700)]
Merge pull request dotnet/coreclr#4870 from RussKeldorph/illicense
Update license header in most .il files.
Commit migrated from https://github.com/dotnet/coreclr/commit/
e3b5e14a65ffb20be986e540ba46da6b07440171
Jan Kotas [Tue, 10 May 2016 13:10:55 +0000 (06:10 -0700)]
Merge pull request dotnet/coreclr#4886 from dotnet-bot/from-tfs
Merge changes from TFS
Commit migrated from https://github.com/dotnet/coreclr/commit/
c90cc5bb715f1c0a63fb460469c75dcfa9716529
Valery [Tue, 10 May 2016 12:57:47 +0000 (15:57 +0300)]
Fixed typo in jitinterface.cpp (dotnet/coreclr#4889)
Commit migrated from https://github.com/dotnet/coreclr/commit/
d8c283a1187b22438da781b44a9d76a9b4fa2493
John Chen [Tue, 10 May 2016 06:20:49 +0000 (23:20 -0700)]
Merge pull request dotnet/coreclr#4883 from JohnChen0/r2r
Fix CrossGen to skip some methods that require generic dictionary
Commit migrated from https://github.com/dotnet/coreclr/commit/
171f7133287ebbee24d6a7f193b13a9f959e9297
John Chen [Tue, 10 May 2016 06:19:56 +0000 (23:19 -0700)]
Merge pull request dotnet/coreclr#4829 from JohnChen0/master
Increase a test timeout
Commit migrated from https://github.com/dotnet/coreclr/commit/
72d3f75684002eaf5f7b6df97d6e09c804aaa265
Jan Kotas [Tue, 10 May 2016 05:58:01 +0000 (22:58 -0700)]
JIT-EE interface changes to support CoreRT
- Add flags and constants for reverse PInvoke transitions (https://github.com/dotnet/corert/issues/611)
- Add new multi-dim array constructor that does not use varargs
[tfs-changeset: 1603336]
Commit migrated from https://github.com/dotnet/coreclr/commit/
3371367a399b87d637e52dba94eb252dcc3c6eb1
Matt Ellis [Tue, 10 May 2016 05:33:20 +0000 (22:33 -0700)]
Fix call to GetSortHandle (dotnet/coreclr#4882)
GlobalizationNatvie_GetSortHandle takes a UTF8 encoded string for the
locale name we want to construct a handle to, which is passed to ICU to
open some locale data.
We converted the UTF-16 encoded locale name to UTF8 in managed code, but
neglected to actually ensure the resulting value was null terminated.
Fixes dotnet/coreclr#4784
Commit migrated from https://github.com/dotnet/coreclr/commit/
12b3b54bcc1bfa08c53a3e760ef39916a978ec93
Bruce Forstall [Tue, 10 May 2016 04:05:35 +0000 (21:05 -0700)]
Merge pull request dotnet/coreclr#4865 from BruceForstall/JitDumpAssertPtrs
Don't print pointers to the JitDump
Commit migrated from https://github.com/dotnet/coreclr/commit/
9eba7d3493796a6994264d27d4b82536d6eeb464
Andy Ayers [Tue, 10 May 2016 01:44:14 +0000 (18:44 -0700)]
Add missing xunit performance attributes
We were not getting instructions retired data for these benchmarks
because the attribute to trigger measurement was missing.
Commit migrated from https://github.com/dotnet/coreclr/commit/
218788facc4228dbda56c593fc2d2a23d395a0d5
AlexGhiondea [Tue, 10 May 2016 01:33:32 +0000 (18:33 -0700)]
Merge pull request dotnet/coreclr#4866 from AlexGhiondea/mscorlibUpdates
Create facade and reference assembly for mscorlib.
Commit migrated from https://github.com/dotnet/coreclr/commit/
96b82198d8217b9b2c12f4e97e7085bd32805ace
Andy Ayers [Tue, 10 May 2016 01:05:36 +0000 (18:05 -0700)]
Merge pull request dotnet/coreclr#4867 from AndyAyersMS/FixBenchmarkNames
Fix class names for benchmarks
Commit migrated from https://github.com/dotnet/coreclr/commit/
7de0e76ac9aed89ff7c9b677bc368b2e3dcf1452
Rahul Kumar [Tue, 10 May 2016 01:04:29 +0000 (18:04 -0700)]
Merge pull request dotnet/coreclr#4864 from dotnet-bot/from-tfs
Merge changes from TFS
Commit migrated from https://github.com/dotnet/coreclr/commit/
9ee4304bc172316c7c55b013e134c8dfd30b3929
John Chen (CLR) [Mon, 9 May 2016 23:38:54 +0000 (16:38 -0700)]
Fix CrossGen to skip some methods that require generic dictionary
Resolves issue dotnet/coreclr#4801.
Commit migrated from https://github.com/dotnet/coreclr/commit/
9f5d9d4f925db0cf7793322921007f6c4ccc45ad
tijoytk [Mon, 9 May 2016 23:23:52 +0000 (16:23 -0700)]
Taking care of review comments.
Let out some of the review comments
since they are optimizations.
Commit migrated from https://github.com/dotnet/coreclr/commit/
515a28b8ab33675011af9923bb5b6dfedf5e3935
Vance Morrison [Mon, 9 May 2016 22:34:53 +0000 (15:34 -0700)]
Fix problem gettign arguments from ETW to an EventSource.
There was a problem where some #ifdefs were incorrect making us simply not have some code in CoreCLR.
This change syncronizes this with the Nuget package version which has the correct #ifdefs.
Commit migrated from https://github.com/dotnet/coreclr/commit/
7cb2f3b225a94f405d2a1e69dc97869c2c67604f
Mike Danes [Sat, 14 Nov 2015 08:46:20 +0000 (10:46 +0200)]
Add tests for integer div/mod by const
Commit migrated from https://github.com/dotnet/coreclr/commit/
ade68f00f0dff0d0727bb65bae5cf9db8dbb5db5
Russ Keldorph [Mon, 9 May 2016 21:25:36 +0000 (14:25 -0700)]
Update license header in most .il files.
Commit migrated from https://github.com/dotnet/coreclr/commit/
32832c1b23205e06c11262b21f0d0c3c2031642e
Andy Ayers [Mon, 9 May 2016 20:21:07 +0000 (13:21 -0700)]
Fix class names for benchmarks
Fix a couple of class names for benchmarks so they more accurately
describe the benchmark.
Commit migrated from https://github.com/dotnet/coreclr/commit/
9b5b198b3b1dda78b56ba3558b365d6e86ed0fce
Russ Keldorph [Mon, 9 May 2016 20:19:32 +0000 (13:19 -0700)]
Merge pull request dotnet/coreclr#4862 from RussKeldorph/pending3
Fix conv_ovf_i8_i test
Commit migrated from https://github.com/dotnet/coreclr/commit/
530acab950de31fb58e41c33be80dc2664791b31
Alex Ghiondea [Mon, 9 May 2016 20:03:14 +0000 (13:03 -0700)]
Create the project that will generate the facade project
Commit migrated from https://github.com/dotnet/coreclr/commit/
76db478df55b14179bc32eee781c42e6d3bef1bd
Alex Ghiondea [Fri, 6 May 2016 20:35:15 +0000 (13:35 -0700)]
Create a reference assembly for mscorlib
Commit migrated from https://github.com/dotnet/coreclr/commit/
bf91aa9bba4df84d6cf39f117ac8ae01aeecc041
Bruce Forstall [Mon, 9 May 2016 20:03:50 +0000 (13:03 -0700)]
Don't print pointers to the JitDump; output the assertion bitvector as a string.
Commit migrated from https://github.com/dotnet/coreclr/commit/
f8d07e361e640593ec9286a724a184b9cac12085
Carol Eidt [Mon, 9 May 2016 19:50:51 +0000 (12:50 -0700)]
Merge pull request dotnet/coreclr#4852 from mikedn/lsra-reftype
Define LSRA's RefType enum via macros
Commit migrated from https://github.com/dotnet/coreclr/commit/
0f444338415b9f92bde9b3658803fbac318f504f
Jan Vorlicek [Mon, 9 May 2016 19:09:55 +0000 (21:09 +0200)]
Let all signals be unblocked on Unix (dotnet/coreclr#4863)
This change removes blocking of all of the 17 signals that we were
blocking. I have looked at the default behavior of their handlers
and we should be fine with it.
Commit migrated from https://github.com/dotnet/coreclr/commit/
2edd715867b82ba73c9db4192986104ffc6a936d
Jeremy Kuhne [Mon, 9 May 2016 18:50:47 +0000 (11:50 -0700)]
Fix desktop build break.
[tfs-changeset: 1603043]
Commit migrated from https://github.com/dotnet/coreclr/commit/
8f602a4f297caa0f4b9e25c5d814a1ed22b1fbee
John Chen (CLR) [Fri, 6 May 2016 17:26:46 +0000 (10:26 -0700)]
Increase a test timeout
Test case tests/src/GC/Regressions/v2.0-beta2/462651 occasionally fails
due to time out (see issue dotnet/coreclr#3691). Mark it with IsLongRunningGCTest.
Commit migrated from https://github.com/dotnet/coreclr/commit/
1ec4df87d931ccaf7e054aefd4d0192325264041
AlexGhiondea [Mon, 9 May 2016 17:28:44 +0000 (10:28 -0700)]
Merge pull request dotnet/coreclr#4828 from AlexGhiondea/systemprivatecorelib
Create System.Private.CoreLib assembly
Commit migrated from https://github.com/dotnet/coreclr/commit/
ff6b48c1c5a6572944659209a06ccca0e82d2154
Rahul Kumar [Mon, 9 May 2016 17:26:50 +0000 (10:26 -0700)]
Merge pull request dotnet/coreclr#4837 from rahku/crossgen
Helpers for ReadyToRun
Commit migrated from https://github.com/dotnet/coreclr/commit/
b3597a00be5cfb6a6a40a4c07e9eb14604fb489e
Rahul Kumar [Thu, 5 May 2016 22:53:07 +0000 (15:53 -0700)]
[Arm64] Helpers for ReadyToRun
Commit migrated from https://github.com/dotnet/coreclr/commit/
559719a62aa7134da929d22f40c3c772e5d06348
Mike Danes [Sun, 8 May 2016 17:41:31 +0000 (20:41 +0300)]
Define LSRA's RefType enum via macros
Commit migrated from https://github.com/dotnet/coreclr/commit/
ffc45dd5754e87bcd3c78380bac10ae7a10f66dd
Russ Keldorph [Fri, 6 May 2016 23:27:37 +0000 (16:27 -0700)]
Fix conv_ovf_i8_i test
Test has at least four problems:
- It assumes native int = int32, so disable it for 64-bit
- It is just wrong in a couple of its assumptions about when overflow
happens during unsigned conversions.
- On success, it returns 0xAAAA instead of the commonly accepted 100
- It has no copyright header
Also piggybacking a copyright fix for rem_r4.il that I missed earlier
Commit migrated from https://github.com/dotnet/coreclr/commit/
d496eb2dc41c895a855bc216fafa81f30f5e8ee2
Gaurav Khanna [Mon, 9 May 2016 14:36:36 +0000 (07:36 -0700)]
Merge pull request dotnet/coreclr#4834 from gkhanna79/RemoveSxSJIT
Cleanup sxsJitStartup from codemanager
Commit migrated from https://github.com/dotnet/coreclr/commit/
d3ff29a3e359b60c4c2fc0e21c1d6c99999157ea
Davis Goodin [Mon, 9 May 2016 13:20:55 +0000 (08:20 -0500)]
Fix incremental build restore: move generated test_runtime project.json to bin (dotnet/coreclr#4764)
* Move generated test_runtime project.json to bin.
* Update helix tasks to point to moved test_runtime files.
* Remove unnecessary TestRuntimeDependenciesJson property.
Commit migrated from https://github.com/dotnet/coreclr/commit/
388d58c3ff5e0792d6a4f7b7d00474f3f9b513df
Jonghyun Park [Mon, 9 May 2016 09:46:10 +0000 (18:46 +0900)]
Do NOT overwrite the stack frame pointer (dotnet/coreclr#4857)
CallEHFunclet currently overwrite the stack frame pointer (R7) while
recovering the registers.
This commit revises CallEHFunclet not to overwrite R7 when recoverint
the registers.
Commit migrated from https://github.com/dotnet/coreclr/commit/
c55a8bd0b5949d5ed70c54a41aaab7d7b95fd8e5
MyungJoo Ham [Mon, 9 May 2016 06:55:46 +0000 (15:55 +0900)]
Linux/ARM: fix stack alignment breaks (dotnet/coreclr#4858)
ehhelper.S: the function no more requires dummy stack add.
memcpy.S: C_FUNC(memcpy) has misaligned stack.
(memcpy.S is not directly related with the issue dotnet/coreclr#4779.
However, this requires the same fix with ehhelper.S)
Fix dotnet/coreclr#4779
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Commit migrated from https://github.com/dotnet/coreclr/commit/
6acc1053342b308ab8f6e6f3c979d82a60641bdc
Russ Keldorph [Mon, 9 May 2016 04:44:05 +0000 (21:44 -0700)]
Merge pull request dotnet/coreclr#4845 from RussKeldorph/pending
Fix some tests where the only problem was incorrect retval
Commit migrated from https://github.com/dotnet/coreclr/commit/
8ac5753f1bc07a0ee7daf6951d700261b6c23247
Lubomir Litchev [Mon, 9 May 2016 01:08:08 +0000 (18:08 -0700)]
Update unix-test-instructions.md
Updated run coreclr tests instructions for Linux. Included the new semicolon separated paths for the coreFxBinDir.
Commit migrated from https://github.com/dotnet/coreclr/commit/
6b92cff66f26c98bb3be88562626faaa54646118
Russ Keldorph [Fri, 6 May 2016 23:27:37 +0000 (16:27 -0700)]
Fix some tests where the only problem was incorrect retval
The following tests return values other than 100 on success. Modify the
harness to expect the values that they return:
```
JIT\jit64\regress\vsw\102754\test1\test1.cmd
JIT\Regression\CLR-x86-JIT\V1-M09\b16102\b16102\b16102.cmd
```
The following test is identical to `test1` in the same directory. Delete
it.
```
JIT\jit64\regress\vsw\102754\test2\test2.cmd
```
`rem_r4` returns a non-Unix-compatible 0xAAAA (>255). Change it to the
standard 100.
```
JIT\IL_Conformance\Old\Conformance_Base\rem_r4\rem_r4.cmd
```
The following were using the non-functional Environment.ExitCode.
Switched to Environment.Exit(Environment.ExitCode):
```
JIT\Methodical\switch\switch1\switch1.cmd
JIT\Methodical\switch\switch10\switch10.cmd
JIT\Methodical\switch\switch11\switch11.cmd
JIT\Methodical\switch\switch2\switch2.cmd
JIT\Methodical\switch\switch3\switch3.cmd
JIT\Methodical\switch\switch4\switch4.cmd
JIT\Methodical\switch\switch5\switch5.cmd
JIT\Methodical\switch\switch6\switch6.cmd
JIT\Methodical\switch\switch7\switch7.cmd
JIT\Methodical\switch\switch8\switch8.cmd
JIT\Methodical\switch\switch9\switch9.cmd
JIT\Methodical\tailcall\_il_dbgrecurse_ep_void\_il_dbgrecurse_ep_void.cmd
JIT\Methodical\tailcall\_il_dbgtest_void\_il_dbgtest_void.cmd
JIT\Methodical\tailcall\_il_relrecurse_ep_void\_il_relrecurse_ep_void.cmd
JIT\Methodical\tailcall\_il_reltest_void\_il_reltest_void.cmd
JIT\Regression\CLR-x86-JIT\V1-M12-Beta2\b65423\b65423\b65423.cmd
JIT\Regression\CLR-x86-JIT\V1.2-M01\b08046\b08046\b08046.cmd
```
Note that `b08046.cmd` is left disabled because it is still failing.
Commit migrated from https://github.com/dotnet/coreclr/commit/
fc4497b4679c4282b9e30bedf2c20060033cf437
Koundinya Veluri [Sun, 8 May 2016 18:45:14 +0000 (11:45 -0700)]
Merge pull request dotnet/coreclr#4773 from kouvel/CardTableGrowFix3
Fix recently introduced timing issue when growing the card table
Commit migrated from https://github.com/dotnet/coreclr/commit/
74798b5b95aca1b27050038202034448a523c9f9
SaeHie Park [Sun, 8 May 2016 18:24:26 +0000 (03:24 +0900)]
ARM: Fix SOS stack dump command failure (dotnet/coreclr#4774)
Dumping address pointer for 32bit system needs adjusting for current implementation
while it assumes %p argument is 64bit. This patch changes (ULONG64) casting to SOS_PTR()
so that it will be safe for both 64 and 32bit.
This will fix DumpStack and EEStack segmentation fault problem.
Related issue: dotnet/coreclr#4672
Commit migrated from https://github.com/dotnet/coreclr/commit/
70cfa355947ed82f7de8a56cac3bd38571cebfa5