[PATCH RFC 4/4] R600: optimize the UDIVREM 64 algorithm

Jan Vesely jan.vesely at rutgers.edu
Fri Apr 25 13:08:05 PDT 2014

On Fri, 2014-04-25 at 12:27 -0700, Matt Arsenault wrote:
> On 04/25/2014 12:08 PM, Jan Vesely wrote:
> > +        HBit = DAG.getNode(AMDGPUISD::BFE_U32, DL, HalfVT, LHS_Lo, POS, one);
> This might want a check for a subtarget with BFE instructions. 
> Alternatively, I've been thinking it might be easier for places that 
> want to use BFE to just use it, and to handle expanding BFE nodes for 
> the old GPUs that don't support it somewhere else.

Or it can be dropped entirely. I used the attached file for testing.
counting asm total lines and lines with '*'

Linecount with BFE is 700 and 202 (lines with '*'), without BFE, it is
743/201. I'm not sure which one is expected to perform better.


Jan Vesely <jan.vesely at rutgers.edu>
-------------- next part --------------
;RUN: llc < %s -march=r600 -mcpu=redwood | FileCheck --check-prefix=EG-CHECK %s

define void @test2(i64 addrspace(1)* %out, i64 %x, i64 %y) {
  %result = udiv i64 %x, %y
  store i64 %result, i64 addrspace(1)* %out
  ret void
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140425/6a98a48c/attachment.sig>

More information about the llvm-commits mailing list