<html>
<head>
<base href="http://llvm.org/bugs/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - Loops with xors aren't vectorized"
href="http://llvm.org/bugs/show_bug.cgi?id=17795">17795</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Loops with xors aren't vectorized
</td>
</tr>
<tr>
<th>Product</th>
<td>libraries
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>Macintosh
</td>
</tr>
<tr>
<th>OS</th>
<td>MacOS X
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>Backend: X86
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>alex.gaynor@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvmbugs@cs.uiuc.edu
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>Here is an example, I would expect the loop to be converted into a PXOR
instruction, or at least have a few iterations unrolled:
/tmp $ pygmentize t.c
#include <stdio.h>
void f(unsigned char *restrict a, unsigned char *restrict b) {
for (size_t i = 0; i < 128; i++) {
b[i] = 0x36 ^ a[i];
}
}
/tmp $ clang -O3 -S t.c
/tmp $ clang --version
Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn)
Target: x86_64-apple-darwin13.0.0
Thread model: posix
/tmp $ cat t.s
.section __TEXT,__text,regular,pure_instructions
.globl _f
.align 4, 0x90
_f: ## @f
.cfi_startproc
## BB#0:
pushq %rbp
Ltmp2:
.cfi_def_cfa_offset 16
Ltmp3:
.cfi_offset %rbp, -16
movq %rsp, %rbp
Ltmp4:
.cfi_def_cfa_register %rbp
xorl %eax, %eax
.align 4, 0x90
LBB0_1: ## =>This Inner Loop Header: Depth=1
movb (%rdi,%rax), %cl
xorb $54, %cl
movb %cl, (%rsi,%rax)
incq %rax
cmpq $128, %rax
jne LBB0_1
## BB#2:
popq %rbp
ret
.cfi_endproc
.subsections_via_symbols</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>