R600: optimize the UDIVREM 64 algorithm
authorTom Stellard <thomas.stellard@amd.com>
Tue, 29 Apr 2014 23:12:46 +0000 (23:12 +0000)
committerTom Stellard <thomas.stellard@amd.com>
Tue, 29 Apr 2014 23:12:46 +0000 (23:12 +0000)
commit19a970b2dafdfaca4263557db69a70e072e0a130
treefbd885a7557e9b28a3d162c79ab626d7e14f81ff
parentea89cd8b523756e9e7730e305ae64256251848c3
R600: optimize the UDIVREM 64 algorithm

This is a squash of several optimization commits:
 - calculate DIV_Lo and DIV_Hi separately
 - use BFE_U32 if we are operating on 32bit values
 - use precomputed constants instead of shifting in UDVIREM
 - skip the first 32 iterations of udivrem

v2: Check whether BFE is supported before using it

Patch by: Jan Vesely

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207589 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/R600/AMDGPUISelLowering.cpp
test/CodeGen/R600/udivrem64.ll [new file with mode: 0644]