[mips] clz is defined to give 32 for zero. Similarly, dclz gives 64.
authorDaniel Sanders <daniel.sanders@imgtec.com>
Wed, 9 Jul 2014 13:43:19 +0000 (13:43 +0000)
committerDaniel Sanders <daniel.sanders@imgtec.com>
Wed, 9 Jul 2014 13:43:19 +0000 (13:43 +0000)
commit51435da41b3af9ac3bad4a6bf30950de3d9f2c67
treef0782f2cf01dee0d877edba533159d8c5d2e064b
parentfa308e31e827e1079248b123c9810f096a785a4e
[mips] clz is defined to give 32 for zero. Similarly, dclz gives 64.

Summary:
While debugging another issue, I noticed that Mips currently specifies that the
count leading zero builtins are undefined when the input is zero. The
architecture specifications say that the clz and dclz instructions write 32 or
64 respectively when given zero.

This doesn't fix any bugs that I'm aware of but it may improve optimisation in
some cases.

Differential Revision: http://reviews.llvm.org/D4431

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212618 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Basic/Targets.cpp
test/CodeGen/mips-count-builtins.c [new file with mode: 0644]