[LLVMbugs] [Bug 3401] New: Wrong code for i288 addition

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Sun Jan 25 02:51:37 PST 2009


http://llvm.org/bugs/show_bug.cgi?id=3401

           Summary: Wrong code for i288 addition
           Product: new-bugs
           Version: unspecified
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: lennart at augustsson.net
                CC: llvmbugs at cs.uiuc.edu


LLVM 2.6svn, x86 code generation.

Here's a small test program:
-------
define void @add(i288, i288, i288*) {
_L1:
        %3 = add i288 %0, %1
        store i288 %3, i288* %2
        ret void
}
-------

And some C code to test it:
-------
#include <stdio.h>

#define N 9

struct big { unsigned int x[N]; };

void add(struct big, struct big, struct big *);

main()
{
  struct big a, b, c;
  int i;
  for (i = 0; i < N; i++) {
    a.x[i] = 0x11111111;
    b.x[i] = 0x22222222;
    c.x[i] = 0x5a5a5a5a;
  }
  add(a,b,&c);
  for (i = N-1; i >= 0; i--)
    printf("%08x ", c.x[i]);
  printf("\n");
}
-------

This prints
fffffffe 00000000 00000001 ffffffff ffffffff ffffffff ffffffff fffffffe
33333333 
which is clearly wrong.  Changing i288 to i256 (and N to 8) makes it work.


-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list