on master help sign in
Integers of fixed width should use unsigned comparisons
1945adfBenjamin Saunders
src/IRTS/CodegenLLVM.hs+4−4
@@ -895,11 +895,11 @@ cgOp (LZExt (ITFixed from) (ITFixed to)) [x]
895cgOp (LSExt (ITFixed from) (ITFixed to)) [x]
895cgOp (LSExt (ITFixed from) (ITFixed to)) [x]
896 | nativeTyWidth from < nativeTyWidth to = iCoerce SExt from to x
896 | nativeTyWidth from < nativeTyWidth to = iCoerce SExt from to x
897
897
898−cgOp (LLt (ATInt ity)) [x,y] = iCmp ity IPred.SLT x y
898+cgOp (LLt (ATInt ity)) [x,y] = iCmp ity IPred.ULT x y
899−cgOp (LLe (ATInt ity)) [x,y] = iCmp ity IPred.SLE x y
899+cgOp (LLe (ATInt ity)) [x,y] = iCmp ity IPred.ULE x y
900cgOp (LEq (ATInt ity)) [x,y] = iCmp ity IPred.EQ x y
900cgOp (LEq (ATInt ity)) [x,y] = iCmp ity IPred.EQ x y
901−cgOp (LGe (ATInt ity)) [x,y] = iCmp ity IPred.SGE x y
901+cgOp (LGe (ATInt ity)) [x,y] = iCmp ity IPred.UGE x y
902−cgOp (LGt (ATInt ity)) [x,y] = iCmp ity IPred.SGT x y
902+cgOp (LGt (ATInt ity)) [x,y] = iCmp ity IPred.UGT x y
903cgOp (LPlus (ATInt ity)) [x,y] = ibin ity x y (Add False False)
903cgOp (LPlus (ATInt ity)) [x,y] = ibin ity x y (Add False False)
904cgOp (LMinus (ATInt ity)) [x,y] = ibin ity x y (Sub False False)
904cgOp (LMinus (ATInt ity)) [x,y] = ibin ity x y (Sub False False)
905cgOp (LTimes (ATInt ity)) [x,y] = ibin ity x y (Mul False False)
905cgOp (LTimes (ATInt ity)) [x,y] = ibin ity x y (Mul False False)