cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

s23ba32
Journeyman III

LLVM error when compiling kernel

I am getting this error message:

LLVM ERROR: Cannot select: 0xb1e670: i8 = setcc 0xa94230, 0xf72f00, 0xae22a0 [ID=25]

  0xa94230: i32 = AMDILISD::ADD 0xf72f00, 0xf6f7d0 [ID=22]

    0xf72f00: i32 = mul 0xb30210, 0xf99250 [ORD=831] [ID=19]

      0xb30210: i32,ch = CopyFromReg 0xbbea30, 0xb71800 [ORD=830] [ID=14]

        0xb71800: i32 = Register %vreg41 [ORD=830] [ID=1]

      0xf99250: i32 = Constant<-83941> [ORD=831] [ID=3]

    0xf6f7d0: i32,ch = CopyFromReg 0xbbea30, 0xae37b0 [ORD=830] [ID=15]

      0xae37b0: i32 = Register %vreg42 [ORD=830] [ID=2]

  0xf72f00: i32 = mul 0xb30210, 0xf99250 [ORD=831] [ID=19]

    0xb30210: i32,ch = CopyFromReg 0xbbea30, 0xb71800 [ORD=830] [ID=14]

      0xb71800: i32 = Register %vreg41 [ORD=830] [ID=1]

    0xf99250: i32 = Constant<-83941> [ORD=831] [ID=3]

This is the code that is triggering the error:

typedef struct{ uint x; uint c; } mwc64x_state_t;

enum{ MWC64X_A = 4294883355U };

enum{ MWC64X_M = 18446383549859758079UL };

void MWC64X_Step(mwc64x_state_t *s)

{

    uint X=s->x, C=s->c;

    uint Xn=MWC64X_A*X+C;

    uint carry=(uint)(Xn<C);

                     

    // Replacing this line with a constant makes the error go away.  

    uint Cn=mad_hi(MWC64X_A,X,carry);

    s->x=Xn;

    // As does replacing this assignment with a constant.

    s->c=Cn;

}

0 Likes
13 Replies