<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/src/libcore, branch 1.25.0</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=1.25.0</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=1.25.0'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2018-02-14T16:04:18+00:00</updated>
<entry>
<title>Partially revert #47333.</title>
<updated>2018-02-14T16:04:18+00:00</updated>
<author>
<name>kennytm</name>
<email>kennytm@gmail.com</email>
</author>
<published>2018-02-14T15:18:18+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=ec36e7e972e8036fe7bd428458462a2aacd40927'/>
<id>urn:sha1:ec36e7e972e8036fe7bd428458462a2aacd40927</id>
<content type='text'>
Removed the `assume()` which we assumed is the cause of misoptimization in
issue #48116.
</content>
</entry>
<entry>
<title>Rollup merge of #47547 - varkor:infinite-iterators-warning-doc, r=frewsxcv</title>
<updated>2018-02-10T19:39:53+00:00</updated>
<author>
<name>kennytm</name>
<email>kennytm@gmail.com</email>
</author>
<published>2018-02-10T19:39:53+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=4a827188cc46d47f75c72dba3a268d5c9f206582'/>
<id>urn:sha1:4a827188cc46d47f75c72dba3a268d5c9f206582</id>
<content type='text'>
Document the behaviour of infinite iterators on potentially-computable methods

It’s not entirely clear from the current documentation what behaviour
calling a method such as `min` on an infinite iterator like `RangeFrom`
is. One might expect this to terminate, but in fact, for infinite
iterators, `min` is always nonterminating (at least in the standard
library). This adds a quick note about this behaviour for clarification.
</content>
</entry>
<entry>
<title>Rollup merge of #48120 - matthiaskrgr:typos_src_1, r=alexcrichton</title>
<updated>2018-02-10T16:53:05+00:00</updated>
<author>
<name>kennytm</name>
<email>kennytm@gmail.com</email>
</author>
<published>2018-02-10T16:53:05+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=18d7be33819158c87c84fac5d9984634e202aac7'/>
<id>urn:sha1:18d7be33819158c87c84fac5d9984634e202aac7</id>
<content type='text'>
fix typos in src/{bootstrap,ci,etc,lib{backtrace,core,fmt_macros}}

via codespell
</content>
</entry>
<entry>
<title>fix typos in src/{bootstrap,ci,etc,lib{backtrace,core,fmt_macros}}</title>
<updated>2018-02-10T11:22:57+00:00</updated>
<author>
<name>Matthias Krüger</name>
<email>matthias.krueger@famsik.de</email>
</author>
<published>2018-02-10T11:22:57+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=7ee3e39f640a9532842e1441bf6bc98893b6a3ba'/>
<id>urn:sha1:7ee3e39f640a9532842e1441bf6bc98893b6a3ba</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Rollup merge of #48100 - Mark-Simulacrum:fetch-nand, r=alexcrichton</title>
<updated>2018-02-10T06:26:57+00:00</updated>
<author>
<name>kennytm</name>
<email>kennytm@gmail.com</email>
</author>
<published>2018-02-10T06:26:57+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=8550ac8015b775fd2746381c81ec86eba592523e'/>
<id>urn:sha1:8550ac8015b775fd2746381c81ec86eba592523e</id>
<content type='text'>
Add fetch_nand to atomics

I think this is all fine but I have little familiarity with the atomic code (or libcore in general) so I may have accidentally done something wrong here...

cc #13226 (the tracking issue)
</content>
</entry>
<entry>
<title>Rollup merge of #48107 - matthiaskrgr:typo__substract_to_subtract, r=kennytm</title>
<updated>2018-02-10T06:24:10+00:00</updated>
<author>
<name>kennytm</name>
<email>kennytm@gmail.com</email>
</author>
<published>2018-02-10T06:24:10+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=6605d0354996b1301d69c55ad4fa114f7437f7cf'/>
<id>urn:sha1:6605d0354996b1301d69c55ad4fa114f7437f7cf</id>
<content type='text'>
fix typo: substract -&gt; subtract
</content>
</entry>
<entry>
<title>Rollup merge of #47790 - tinaun:patch-1, r=sfackler</title>
<updated>2018-02-10T06:23:53+00:00</updated>
<author>
<name>kennytm</name>
<email>kennytm@gmail.com</email>
</author>
<published>2018-02-10T06:23:53+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=6bbee8de86b54b9e3ea45f60477e994934c84187'/>
<id>urn:sha1:6bbee8de86b54b9e3ea45f60477e994934c84187</id>
<content type='text'>
derive PartialEq and Eq for `ParseCharError`

unlike the other Parse*Error types, ParseCharError didn't have these implemented for whatever reason
</content>
</entry>
<entry>
<title>fix typo: substract -&gt; subtract.</title>
<updated>2018-02-09T23:56:33+00:00</updated>
<author>
<name>Matthias Krüger</name>
<email>matthias.krueger@famsik.de</email>
</author>
<published>2018-02-09T21:18:06+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=e6f910e31e578301cc8608f049f1763172569ca8'/>
<id>urn:sha1:e6f910e31e578301cc8608f049f1763172569ca8</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Add fetch_nand.</title>
<updated>2018-02-09T23:04:41+00:00</updated>
<author>
<name>Mark Simulacrum</name>
<email>mark.simulacrum@gmail.com</email>
</author>
<published>2018-02-09T18:19:52+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=1335b3da5a80fa4b74b25642e1bb651388bac3a8'/>
<id>urn:sha1:1335b3da5a80fa4b74b25642e1bb651388bac3a8</id>
<content type='text'>
cc #13226 (the tracking issue)
</content>
</entry>
<entry>
<title>Auto merge of #48057 - scottmcm:less-match-more-compare, r=dtolnay</title>
<updated>2018-02-08T06:38:30+00:00</updated>
<author>
<name>bors</name>
<email>bors@rust-lang.org</email>
</author>
<published>2018-02-08T06:38:30+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=932c736479f43dc8893a924946e4335d8e308c2e'/>
<id>urn:sha1:932c736479f43dc8893a924946e4335d8e308c2e</id>
<content type='text'>
Simplify RangeInclusive::next[_back]

`match`ing on an `Option&lt;Ordering&gt;` seems cause some confusion for LLVM; switching to just using comparison operators removes a few jumps from the simple `for` loops I was trying.

cc https://github.com/rust-lang/rust/issues/45222 https://github.com/rust-lang/rust/issues/28237#issuecomment-363706510

Example:
```rust
#[no_mangle]
pub fn coresum(x: std::ops::RangeInclusive&lt;u64&gt;) -&gt; u64 {
    let mut sum = 0;
    for i in x {
        sum += i ^ (i-1);
    }
    sum
}
```
Today:
```asm
coresum:
    xor r8d, r8d
    mov r9, -1
    xor eax, eax
    jmp .LBB0_1
.LBB0_4:
    lea rcx, [rdi - 1]
    xor rcx, rdi
    add rax, rcx
    mov rsi, rdx
    mov rdi, r10
.LBB0_1:
    cmp rdi, rsi
    mov ecx, 1
    cmovb   rcx, r9
    cmove   rcx, r8
    test    rcx, rcx
    mov edx, 0
    mov r10d, 1
    je  .LBB0_4         // 1
    cmp rcx, -1
    jne .LBB0_5         // 2
    lea r10, [rdi + 1]
    mov rdx, rsi
    jmp .LBB0_4         // 3
.LBB0_5:
    ret
```
With this PR:
```asm
coresum:
	cmp	rcx, rdx
	jbe	.LBB0_2
	xor	eax, eax
	ret
.LBB0_2:
	xor	r8d, r8d
	mov	r9d, 1
	xor	eax, eax
	.p2align	4, 0x90
.LBB0_3:
	lea	r10, [rcx + 1]
	cmp	rcx, rdx
	cmovae	rdx, r8
	cmovae	r10, r9
	lea	r11, [rcx - 1]
	xor	r11, rcx
	add	rax, r11
	mov	rcx, r10
	cmp	r10, rdx
	jbe	.LBB0_3         // Just this
	ret
```

&lt;details&gt;&lt;summary&gt;Though using internal iteration (`.map(|i| i ^ (i-1)).sum()`) is still shorter to type, and lets the compiler unroll it&lt;/summary&gt;

```asm
coresum_inner:
.Lcfi0:
.seh_proc coresum_inner
	sub	rsp, 168
.Lcfi1:
	.seh_stackalloc 168
	vmovdqa	xmmword ptr [rsp + 144], xmm15
.Lcfi2:
	.seh_savexmm 15, 144
	vmovdqa	xmmword ptr [rsp + 128], xmm14
.Lcfi3:
	.seh_savexmm 14, 128
	vmovdqa	xmmword ptr [rsp + 112], xmm13
.Lcfi4:
	.seh_savexmm 13, 112
	vmovdqa	xmmword ptr [rsp + 96], xmm12
.Lcfi5:
	.seh_savexmm 12, 96
	vmovdqa	xmmword ptr [rsp + 80], xmm11
.Lcfi6:
	.seh_savexmm 11, 80
	vmovdqa	xmmword ptr [rsp + 64], xmm10
.Lcfi7:
	.seh_savexmm 10, 64
	vmovdqa	xmmword ptr [rsp + 48], xmm9
.Lcfi8:
	.seh_savexmm 9, 48
	vmovdqa	xmmword ptr [rsp + 32], xmm8
.Lcfi9:
	.seh_savexmm 8, 32
	vmovdqa	xmmword ptr [rsp + 16], xmm7
.Lcfi10:
	.seh_savexmm 7, 16
	vmovdqa	xmmword ptr [rsp], xmm6
.Lcfi11:
	.seh_savexmm 6, 0
.Lcfi12:
	.seh_endprologue
	cmp	rdx, rcx
	jae	.LBB1_2
	xor	eax, eax
	jmp	.LBB1_13
.LBB1_2:
	mov	r8, rdx
	sub	r8, rcx
	jbe	.LBB1_3
	cmp	r8, 7
	jbe	.LBB1_5
	mov	rax, r8
	and	rax, -8
	mov	r9, r8
	and	r9, -8
	je	.LBB1_5
	add	rax, rcx
	vmovq	xmm0, rcx
	vpshufd	xmm0, xmm0, 68
	mov	ecx, 1
	vmovq	xmm1, rcx
	vpslldq	xmm1, xmm1, 8
	vpaddq	xmm1, xmm0, xmm1
	vpxor	xmm0, xmm0, xmm0
	vpcmpeqd	xmm11, xmm11, xmm11
	vmovdqa	xmm12, xmmword ptr [rip + __xmm@00000000000000010000000000000001]
	vmovdqa	xmm13, xmmword ptr [rip + __xmm@00000000000000030000000000000003]
	vmovdqa	xmm14, xmmword ptr [rip + __xmm@00000000000000050000000000000005]
	vmovdqa	xmm15, xmmword ptr [rip + __xmm@00000000000000080000000000000008]
	mov	rcx, r9
	vpxor	xmm4, xmm4, xmm4
	vpxor	xmm5, xmm5, xmm5
	vpxor	xmm6, xmm6, xmm6
	.p2align	4, 0x90
.LBB1_9:
	vpaddq	xmm7, xmm1, xmmword ptr [rip + __xmm@00000000000000020000000000000002]
	vpaddq	xmm9, xmm1, xmmword ptr [rip + __xmm@00000000000000040000000000000004]
	vpaddq	xmm10, xmm1, xmmword ptr [rip + __xmm@00000000000000060000000000000006]
	vpaddq	xmm8, xmm1, xmm12
	vpxor	xmm7, xmm8, xmm7
	vpaddq	xmm2, xmm1, xmm13
	vpxor	xmm8, xmm2, xmm9
	vpaddq	xmm3, xmm1, xmm14
	vpxor	xmm3, xmm3, xmm10
	vpaddq	xmm2, xmm1, xmm11
	vpxor	xmm2, xmm2, xmm1
	vpaddq	xmm0, xmm2, xmm0
	vpaddq	xmm4, xmm7, xmm4
	vpaddq	xmm5, xmm8, xmm5
	vpaddq	xmm6, xmm3, xmm6
	vpaddq	xmm1, xmm1, xmm15
	add	rcx, -8
	jne	.LBB1_9
	vpaddq	xmm0, xmm4, xmm0
	vpaddq	xmm0, xmm5, xmm0
	vpaddq	xmm0, xmm6, xmm0
	vpshufd	xmm1, xmm0, 78
	vpaddq	xmm0, xmm0, xmm1
	vmovq	r10, xmm0
	cmp	r8, r9
	jne	.LBB1_6
	jmp	.LBB1_11
.LBB1_3:
	xor	r10d, r10d
	jmp	.LBB1_12
.LBB1_5:
	xor	r10d, r10d
	mov	rax, rcx
	.p2align	4, 0x90
.LBB1_6:
	lea	rcx, [rax - 1]
	xor	rcx, rax
	inc	rax
	add	r10, rcx
	cmp	rdx, rax
	jne	.LBB1_6
.LBB1_11:
	mov	rcx, rdx
.LBB1_12:
	lea	rax, [rcx - 1]
	xor	rax, rcx
	add	rax, r10
.LBB1_13:
	vmovaps	xmm6, xmmword ptr [rsp]
	vmovaps	xmm7, xmmword ptr [rsp + 16]
	vmovaps	xmm8, xmmword ptr [rsp + 32]
	vmovaps	xmm9, xmmword ptr [rsp + 48]
	vmovaps	xmm10, xmmword ptr [rsp + 64]
	vmovaps	xmm11, xmmword ptr [rsp + 80]
	vmovaps	xmm12, xmmword ptr [rsp + 96]
	vmovaps	xmm13, xmmword ptr [rsp + 112]
	vmovaps	xmm14, xmmword ptr [rsp + 128]
	vmovaps	xmm15, xmmword ptr [rsp + 144]
	add	rsp, 168
	ret
	.seh_handlerdata
	.section	.text,"xr",one_only,coresum_inner
.Lcfi13:
	.seh_endproc
```

&lt;/details&gt;
</content>
</entry>
</feed>
