on master help sign in
Integers of fixed width should use unsigned comparisons
commit1945adf26dc45ac1f9e415670d9281b41137d39d authorBenjamin Saunders <besaunde@sfu.ca> dateThu 25 Jul 2013, 11:18 (13 years ago) parent61d39da
1 file changed+4−4
src/IRTS/CodegenLLVM.hs+4−4
src/IRTS/CodegenLLVM.hs+4−4
@@ -895,11 +895,11 @@ cgOp (LZExt (ITFixed from) (ITFixed to)) [x]
895895cgOp (LSExt (ITFixed from) (ITFixed to)) [x]
896896 | nativeTyWidth from < nativeTyWidth to = iCoerce SExt from to x
897897
898−cgOp (LLt (ATInt ity)) [x,y] = iCmp ity IPred.SLT x y
899−cgOp (LLe (ATInt ity)) [x,y] = iCmp ity IPred.SLE 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.ULE x y
900900cgOp (LEq (ATInt ity)) [x,y] = iCmp ity IPred.EQ x y
901−cgOp (LGe (ATInt ity)) [x,y] = iCmp ity IPred.SGE x y
902−cgOp (LGt (ATInt ity)) [x,y] = iCmp ity IPred.SGT 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.UGT x y
903903cgOp (LPlus (ATInt ity)) [x,y] = ibin ity x y (Add False False)
904904cgOp (LMinus (ATInt ity)) [x,y] = ibin ity x y (Sub False False)
905905cgOp (LTimes (ATInt ity)) [x,y] = ibin ity x y (Mul False False)