summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/X86/clz.ll
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2011-12-24 12:12:34 +0000
committerChandler Carruth <chandlerc@gmail.com>2011-12-24 12:12:34 +0000
commita3d54fe0aefb21fda70fece3b7a61ad0b1fc9fdf (patch)
tree096e469d8fab02000d1733caa2429abb0279d59f /llvm/test/CodeGen/X86/clz.ll
parent38ce24455df1800496d11f6d809c56a8f1feb307 (diff)
downloadbcm5719-llvm-a3d54fe0aefb21fda70fece3b7a61ad0b1fc9fdf.tar.gz
bcm5719-llvm-a3d54fe0aefb21fda70fece3b7a61ad0b1fc9fdf.zip
Use standard promotion for i8 CTTZ nodes and i8 CTLZ nodes when the
LZCNT instructions are available. Force promotion to i32 to get a smaller encoding since the fix-ups necessary are just as complex for either promoted type We can't do standard promotion for CTLZ when lowering through BSR because it results in poor code surrounding the 'xor' at the end of this instruction. Essentially, if we promote the entire CTLZ node to i32, we end up doing the xor on a 32-bit CTLZ implementation, and then subtracting appropriately to get back to an i8 value. Instead, our custom logic just uses the knowledge of the incoming size to compute a perfect xor. I'd love to know of a way to fix this, but so far I'm drawing a blank. I suspect the legalizer could be more clever and/or it could collude with the DAG combiner, but how... ;] llvm-svn: 147251
Diffstat (limited to 'llvm/test/CodeGen/X86/clz.ll')
-rw-r--r--llvm/test/CodeGen/X86/clz.ll2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/test/CodeGen/X86/clz.ll b/llvm/test/CodeGen/X86/clz.ll
index 6f4d305385b..763079f3446 100644
--- a/llvm/test/CodeGen/X86/clz.ll
+++ b/llvm/test/CodeGen/X86/clz.ll
@@ -13,7 +13,7 @@ define i8 @cttz_i8(i8 %x) {
%tmp = call i8 @llvm.cttz.i8( i8 %x, i1 true )
ret i8 %tmp
; CHECK: cttz_i8:
-; CHECK: bsfw
+; CHECK: bsfl
; CHECK-NOT: cmov
; CHECK: ret
}
OpenPOWER on IntegriCloud