FixedPointBuilder.h 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. //===- llvm/FixedPointBuilder.h - Builder for fixed-point ops ---*- C++ -*-===//
  7. //
  8. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  9. // See https://llvm.org/LICENSE.txt for license information.
  10. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  11. //
  12. //===----------------------------------------------------------------------===//
  13. //
  14. // This file defines the FixedPointBuilder class, which is used as a convenient
  15. // way to lower fixed-point arithmetic operations to LLVM IR.
  16. //
  17. //===----------------------------------------------------------------------===//
  18. #ifndef LLVM_IR_FIXEDPOINTBUILDER_H
  19. #define LLVM_IR_FIXEDPOINTBUILDER_H
  20. #include "llvm/ADT/APFixedPoint.h"
  21. #include "llvm/IR/Constant.h"
  22. #include "llvm/IR/Constants.h"
  23. #include "llvm/IR/IRBuilder.h"
  24. #include "llvm/IR/InstrTypes.h"
  25. #include "llvm/IR/Instruction.h"
  26. #include "llvm/IR/IntrinsicInst.h"
  27. #include "llvm/IR/Intrinsics.h"
  28. #include "llvm/IR/Type.h"
  29. #include "llvm/IR/Value.h"
  30. #include <cmath>
  31. namespace llvm {
  32. template <class IRBuilderTy> class FixedPointBuilder {
  33. IRBuilderTy &B;
  34. Value *Convert(Value *Src, const FixedPointSemantics &SrcSema,
  35. const FixedPointSemantics &DstSema, bool DstIsInteger) {
  36. unsigned SrcWidth = SrcSema.getWidth();
  37. unsigned DstWidth = DstSema.getWidth();
  38. unsigned SrcScale = SrcSema.getScale();
  39. unsigned DstScale = DstSema.getScale();
  40. bool SrcIsSigned = SrcSema.isSigned();
  41. bool DstIsSigned = DstSema.isSigned();
  42. Type *DstIntTy = B.getIntNTy(DstWidth);
  43. Value *Result = Src;
  44. unsigned ResultWidth = SrcWidth;
  45. // Downscale.
  46. if (DstScale < SrcScale) {
  47. // When converting to integers, we round towards zero. For negative
  48. // numbers, right shifting rounds towards negative infinity. In this case,
  49. // we can just round up before shifting.
  50. if (DstIsInteger && SrcIsSigned) {
  51. Value *Zero = Constant::getNullValue(Result->getType());
  52. Value *IsNegative = B.CreateICmpSLT(Result, Zero);
  53. Value *LowBits = ConstantInt::get(
  54. B.getContext(), APInt::getLowBitsSet(ResultWidth, SrcScale));
  55. Value *Rounded = B.CreateAdd(Result, LowBits);
  56. Result = B.CreateSelect(IsNegative, Rounded, Result);
  57. }
  58. Result = SrcIsSigned
  59. ? B.CreateAShr(Result, SrcScale - DstScale, "downscale")
  60. : B.CreateLShr(Result, SrcScale - DstScale, "downscale");
  61. }
  62. if (!DstSema.isSaturated()) {
  63. // Resize.
  64. Result = B.CreateIntCast(Result, DstIntTy, SrcIsSigned, "resize");
  65. // Upscale.
  66. if (DstScale > SrcScale)
  67. Result = B.CreateShl(Result, DstScale - SrcScale, "upscale");
  68. } else {
  69. // Adjust the number of fractional bits.
  70. if (DstScale > SrcScale) {
  71. // Compare to DstWidth to prevent resizing twice.
  72. ResultWidth = std::max(SrcWidth + DstScale - SrcScale, DstWidth);
  73. Type *UpscaledTy = B.getIntNTy(ResultWidth);
  74. Result = B.CreateIntCast(Result, UpscaledTy, SrcIsSigned, "resize");
  75. Result = B.CreateShl(Result, DstScale - SrcScale, "upscale");
  76. }
  77. // Handle saturation.
  78. bool LessIntBits = DstSema.getIntegralBits() < SrcSema.getIntegralBits();
  79. if (LessIntBits) {
  80. Value *Max = ConstantInt::get(
  81. B.getContext(),
  82. APFixedPoint::getMax(DstSema).getValue().extOrTrunc(ResultWidth));
  83. Value *TooHigh = SrcIsSigned ? B.CreateICmpSGT(Result, Max)
  84. : B.CreateICmpUGT(Result, Max);
  85. Result = B.CreateSelect(TooHigh, Max, Result, "satmax");
  86. }
  87. // Cannot overflow min to dest type if src is unsigned since all fixed
  88. // point types can cover the unsigned min of 0.
  89. if (SrcIsSigned && (LessIntBits || !DstIsSigned)) {
  90. Value *Min = ConstantInt::get(
  91. B.getContext(),
  92. APFixedPoint::getMin(DstSema).getValue().extOrTrunc(ResultWidth));
  93. Value *TooLow = B.CreateICmpSLT(Result, Min);
  94. Result = B.CreateSelect(TooLow, Min, Result, "satmin");
  95. }
  96. // Resize the integer part to get the final destination size.
  97. if (ResultWidth != DstWidth)
  98. Result = B.CreateIntCast(Result, DstIntTy, SrcIsSigned, "resize");
  99. }
  100. return Result;
  101. }
  102. /// Get the common semantic for two semantics, with the added imposition that
  103. /// saturated padded types retain the padding bit.
  104. FixedPointSemantics
  105. getCommonBinopSemantic(const FixedPointSemantics &LHSSema,
  106. const FixedPointSemantics &RHSSema) {
  107. auto C = LHSSema.getCommonSemantics(RHSSema);
  108. bool BothPadded =
  109. LHSSema.hasUnsignedPadding() && RHSSema.hasUnsignedPadding();
  110. return FixedPointSemantics(
  111. C.getWidth() + (unsigned)(BothPadded && C.isSaturated()), C.getScale(),
  112. C.isSigned(), C.isSaturated(), BothPadded);
  113. }
  114. /// Given a floating point type and a fixed-point semantic, return a floating
  115. /// point type which can accommodate the fixed-point semantic. This is either
  116. /// \p Ty, or a floating point type with a larger exponent than Ty.
  117. Type *getAccommodatingFloatType(Type *Ty, const FixedPointSemantics &Sema) {
  118. const fltSemantics *FloatSema = &Ty->getFltSemantics();
  119. while (!Sema.fitsInFloatSemantics(*FloatSema))
  120. FloatSema = APFixedPoint::promoteFloatSemantics(FloatSema);
  121. return Type::getFloatingPointTy(Ty->getContext(), *FloatSema);
  122. }
  123. public:
  124. FixedPointBuilder(IRBuilderTy &Builder) : B(Builder) {}
  125. /// Convert an integer value representing a fixed-point number from one
  126. /// fixed-point semantic to another fixed-point semantic.
  127. /// \p Src - The source value
  128. /// \p SrcSema - The fixed-point semantic of the source value
  129. /// \p DstSema - The resulting fixed-point semantic
  130. Value *CreateFixedToFixed(Value *Src, const FixedPointSemantics &SrcSema,
  131. const FixedPointSemantics &DstSema) {
  132. return Convert(Src, SrcSema, DstSema, false);
  133. }
  134. /// Convert an integer value representing a fixed-point number to an integer
  135. /// with the given bit width and signedness.
  136. /// \p Src - The source value
  137. /// \p SrcSema - The fixed-point semantic of the source value
  138. /// \p DstWidth - The bit width of the result value
  139. /// \p DstIsSigned - The signedness of the result value
  140. Value *CreateFixedToInteger(Value *Src, const FixedPointSemantics &SrcSema,
  141. unsigned DstWidth, bool DstIsSigned) {
  142. return Convert(
  143. Src, SrcSema,
  144. FixedPointSemantics::GetIntegerSemantics(DstWidth, DstIsSigned), true);
  145. }
  146. /// Convert an integer value with the given signedness to an integer value
  147. /// representing the given fixed-point semantic.
  148. /// \p Src - The source value
  149. /// \p SrcIsSigned - The signedness of the source value
  150. /// \p DstSema - The resulting fixed-point semantic
  151. Value *CreateIntegerToFixed(Value *Src, unsigned SrcIsSigned,
  152. const FixedPointSemantics &DstSema) {
  153. return Convert(Src,
  154. FixedPointSemantics::GetIntegerSemantics(
  155. Src->getType()->getScalarSizeInBits(), SrcIsSigned),
  156. DstSema, false);
  157. }
  158. Value *CreateFixedToFloating(Value *Src, const FixedPointSemantics &SrcSema,
  159. Type *DstTy) {
  160. Value *Result;
  161. Type *OpTy = getAccommodatingFloatType(DstTy, SrcSema);
  162. // Convert the raw fixed-point value directly to floating point. If the
  163. // value is too large to fit, it will be rounded, not truncated.
  164. Result = SrcSema.isSigned() ? B.CreateSIToFP(Src, OpTy)
  165. : B.CreateUIToFP(Src, OpTy);
  166. // Rescale the integral-in-floating point by the scaling factor. This is
  167. // lossless, except for overflow to infinity which is unlikely.
  168. Result = B.CreateFMul(Result,
  169. ConstantFP::get(OpTy, std::pow(2, -(int)SrcSema.getScale())));
  170. if (OpTy != DstTy)
  171. Result = B.CreateFPTrunc(Result, DstTy);
  172. return Result;
  173. }
  174. Value *CreateFloatingToFixed(Value *Src, const FixedPointSemantics &DstSema) {
  175. bool UseSigned = DstSema.isSigned() || DstSema.hasUnsignedPadding();
  176. Value *Result = Src;
  177. Type *OpTy = getAccommodatingFloatType(Src->getType(), DstSema);
  178. if (OpTy != Src->getType())
  179. Result = B.CreateFPExt(Result, OpTy);
  180. // Rescale the floating point value so that its significant bits (for the
  181. // purposes of the conversion) are in the integral range.
  182. Result = B.CreateFMul(Result,
  183. ConstantFP::get(OpTy, std::pow(2, DstSema.getScale())));
  184. Type *ResultTy = B.getIntNTy(DstSema.getWidth());
  185. if (DstSema.isSaturated()) {
  186. Intrinsic::ID IID =
  187. UseSigned ? Intrinsic::fptosi_sat : Intrinsic::fptoui_sat;
  188. Result = B.CreateIntrinsic(IID, {ResultTy, OpTy}, {Result});
  189. } else {
  190. Result = UseSigned ? B.CreateFPToSI(Result, ResultTy)
  191. : B.CreateFPToUI(Result, ResultTy);
  192. }
  193. // When saturating unsigned-with-padding using signed operations, we may
  194. // get negative values. Emit an extra clamp to zero.
  195. if (DstSema.isSaturated() && DstSema.hasUnsignedPadding()) {
  196. Constant *Zero = Constant::getNullValue(Result->getType());
  197. Result =
  198. B.CreateSelect(B.CreateICmpSLT(Result, Zero), Zero, Result, "satmin");
  199. }
  200. return Result;
  201. }
  202. /// Add two fixed-point values and return the result in their common semantic.
  203. /// \p LHS - The left hand side
  204. /// \p LHSSema - The semantic of the left hand side
  205. /// \p RHS - The right hand side
  206. /// \p RHSSema - The semantic of the right hand side
  207. Value *CreateAdd(Value *LHS, const FixedPointSemantics &LHSSema,
  208. Value *RHS, const FixedPointSemantics &RHSSema) {
  209. auto CommonSema = getCommonBinopSemantic(LHSSema, RHSSema);
  210. bool UseSigned = CommonSema.isSigned() || CommonSema.hasUnsignedPadding();
  211. Value *WideLHS = CreateFixedToFixed(LHS, LHSSema, CommonSema);
  212. Value *WideRHS = CreateFixedToFixed(RHS, RHSSema, CommonSema);
  213. Value *Result;
  214. if (CommonSema.isSaturated()) {
  215. Intrinsic::ID IID = UseSigned ? Intrinsic::sadd_sat : Intrinsic::uadd_sat;
  216. Result = B.CreateBinaryIntrinsic(IID, WideLHS, WideRHS);
  217. } else {
  218. Result = B.CreateAdd(WideLHS, WideRHS);
  219. }
  220. return CreateFixedToFixed(Result, CommonSema,
  221. LHSSema.getCommonSemantics(RHSSema));
  222. }
  223. /// Subtract two fixed-point values and return the result in their common
  224. /// semantic.
  225. /// \p LHS - The left hand side
  226. /// \p LHSSema - The semantic of the left hand side
  227. /// \p RHS - The right hand side
  228. /// \p RHSSema - The semantic of the right hand side
  229. Value *CreateSub(Value *LHS, const FixedPointSemantics &LHSSema,
  230. Value *RHS, const FixedPointSemantics &RHSSema) {
  231. auto CommonSema = getCommonBinopSemantic(LHSSema, RHSSema);
  232. bool UseSigned = CommonSema.isSigned() || CommonSema.hasUnsignedPadding();
  233. Value *WideLHS = CreateFixedToFixed(LHS, LHSSema, CommonSema);
  234. Value *WideRHS = CreateFixedToFixed(RHS, RHSSema, CommonSema);
  235. Value *Result;
  236. if (CommonSema.isSaturated()) {
  237. Intrinsic::ID IID = UseSigned ? Intrinsic::ssub_sat : Intrinsic::usub_sat;
  238. Result = B.CreateBinaryIntrinsic(IID, WideLHS, WideRHS);
  239. } else {
  240. Result = B.CreateSub(WideLHS, WideRHS);
  241. }
  242. // Subtraction can end up below 0 for padded unsigned operations, so emit
  243. // an extra clamp in that case.
  244. if (CommonSema.isSaturated() && CommonSema.hasUnsignedPadding()) {
  245. Constant *Zero = Constant::getNullValue(Result->getType());
  246. Result =
  247. B.CreateSelect(B.CreateICmpSLT(Result, Zero), Zero, Result, "satmin");
  248. }
  249. return CreateFixedToFixed(Result, CommonSema,
  250. LHSSema.getCommonSemantics(RHSSema));
  251. }
  252. /// Multiply two fixed-point values and return the result in their common
  253. /// semantic.
  254. /// \p LHS - The left hand side
  255. /// \p LHSSema - The semantic of the left hand side
  256. /// \p RHS - The right hand side
  257. /// \p RHSSema - The semantic of the right hand side
  258. Value *CreateMul(Value *LHS, const FixedPointSemantics &LHSSema,
  259. Value *RHS, const FixedPointSemantics &RHSSema) {
  260. auto CommonSema = getCommonBinopSemantic(LHSSema, RHSSema);
  261. bool UseSigned = CommonSema.isSigned() || CommonSema.hasUnsignedPadding();
  262. Value *WideLHS = CreateFixedToFixed(LHS, LHSSema, CommonSema);
  263. Value *WideRHS = CreateFixedToFixed(RHS, RHSSema, CommonSema);
  264. Intrinsic::ID IID;
  265. if (CommonSema.isSaturated()) {
  266. IID = UseSigned ? Intrinsic::smul_fix_sat : Intrinsic::umul_fix_sat;
  267. } else {
  268. IID = UseSigned ? Intrinsic::smul_fix : Intrinsic::umul_fix;
  269. }
  270. Value *Result = B.CreateIntrinsic(
  271. IID, {WideLHS->getType()},
  272. {WideLHS, WideRHS, B.getInt32(CommonSema.getScale())});
  273. return CreateFixedToFixed(Result, CommonSema,
  274. LHSSema.getCommonSemantics(RHSSema));
  275. }
  276. /// Divide two fixed-point values and return the result in their common
  277. /// semantic.
  278. /// \p LHS - The left hand side
  279. /// \p LHSSema - The semantic of the left hand side
  280. /// \p RHS - The right hand side
  281. /// \p RHSSema - The semantic of the right hand side
  282. Value *CreateDiv(Value *LHS, const FixedPointSemantics &LHSSema,
  283. Value *RHS, const FixedPointSemantics &RHSSema) {
  284. auto CommonSema = getCommonBinopSemantic(LHSSema, RHSSema);
  285. bool UseSigned = CommonSema.isSigned() || CommonSema.hasUnsignedPadding();
  286. Value *WideLHS = CreateFixedToFixed(LHS, LHSSema, CommonSema);
  287. Value *WideRHS = CreateFixedToFixed(RHS, RHSSema, CommonSema);
  288. Intrinsic::ID IID;
  289. if (CommonSema.isSaturated()) {
  290. IID = UseSigned ? Intrinsic::sdiv_fix_sat : Intrinsic::udiv_fix_sat;
  291. } else {
  292. IID = UseSigned ? Intrinsic::sdiv_fix : Intrinsic::udiv_fix;
  293. }
  294. Value *Result = B.CreateIntrinsic(
  295. IID, {WideLHS->getType()},
  296. {WideLHS, WideRHS, B.getInt32(CommonSema.getScale())});
  297. return CreateFixedToFixed(Result, CommonSema,
  298. LHSSema.getCommonSemantics(RHSSema));
  299. }
  300. /// Left shift a fixed-point value by an unsigned integer value. The integer
  301. /// value can be any bit width.
  302. /// \p LHS - The left hand side
  303. /// \p LHSSema - The semantic of the left hand side
  304. /// \p RHS - The right hand side
  305. Value *CreateShl(Value *LHS, const FixedPointSemantics &LHSSema, Value *RHS) {
  306. bool UseSigned = LHSSema.isSigned() || LHSSema.hasUnsignedPadding();
  307. RHS = B.CreateIntCast(RHS, LHS->getType(), /*IsSigned=*/false);
  308. Value *Result;
  309. if (LHSSema.isSaturated()) {
  310. Intrinsic::ID IID = UseSigned ? Intrinsic::sshl_sat : Intrinsic::ushl_sat;
  311. Result = B.CreateBinaryIntrinsic(IID, LHS, RHS);
  312. } else {
  313. Result = B.CreateShl(LHS, RHS);
  314. }
  315. return Result;
  316. }
  317. /// Right shift a fixed-point value by an unsigned integer value. The integer
  318. /// value can be any bit width.
  319. /// \p LHS - The left hand side
  320. /// \p LHSSema - The semantic of the left hand side
  321. /// \p RHS - The right hand side
  322. Value *CreateShr(Value *LHS, const FixedPointSemantics &LHSSema, Value *RHS) {
  323. RHS = B.CreateIntCast(RHS, LHS->getType(), false);
  324. return LHSSema.isSigned() ? B.CreateAShr(LHS, RHS) : B.CreateLShr(LHS, RHS);
  325. }
  326. /// Compare two fixed-point values for equality.
  327. /// \p LHS - The left hand side
  328. /// \p LHSSema - The semantic of the left hand side
  329. /// \p RHS - The right hand side
  330. /// \p RHSSema - The semantic of the right hand side
  331. Value *CreateEQ(Value *LHS, const FixedPointSemantics &LHSSema,
  332. Value *RHS, const FixedPointSemantics &RHSSema) {
  333. auto CommonSema = getCommonBinopSemantic(LHSSema, RHSSema);
  334. Value *WideLHS = CreateFixedToFixed(LHS, LHSSema, CommonSema);
  335. Value *WideRHS = CreateFixedToFixed(RHS, RHSSema, CommonSema);
  336. return B.CreateICmpEQ(WideLHS, WideRHS);
  337. }
  338. /// Compare two fixed-point values for inequality.
  339. /// \p LHS - The left hand side
  340. /// \p LHSSema - The semantic of the left hand side
  341. /// \p RHS - The right hand side
  342. /// \p RHSSema - The semantic of the right hand side
  343. Value *CreateNE(Value *LHS, const FixedPointSemantics &LHSSema,
  344. Value *RHS, const FixedPointSemantics &RHSSema) {
  345. auto CommonSema = getCommonBinopSemantic(LHSSema, RHSSema);
  346. Value *WideLHS = CreateFixedToFixed(LHS, LHSSema, CommonSema);
  347. Value *WideRHS = CreateFixedToFixed(RHS, RHSSema, CommonSema);
  348. return B.CreateICmpNE(WideLHS, WideRHS);
  349. }
  350. /// Compare two fixed-point values as LHS < RHS.
  351. /// \p LHS - The left hand side
  352. /// \p LHSSema - The semantic of the left hand side
  353. /// \p RHS - The right hand side
  354. /// \p RHSSema - The semantic of the right hand side
  355. Value *CreateLT(Value *LHS, const FixedPointSemantics &LHSSema,
  356. Value *RHS, const FixedPointSemantics &RHSSema) {
  357. auto CommonSema = getCommonBinopSemantic(LHSSema, RHSSema);
  358. Value *WideLHS = CreateFixedToFixed(LHS, LHSSema, CommonSema);
  359. Value *WideRHS = CreateFixedToFixed(RHS, RHSSema, CommonSema);
  360. return CommonSema.isSigned() ? B.CreateICmpSLT(WideLHS, WideRHS)
  361. : B.CreateICmpULT(WideLHS, WideRHS);
  362. }
  363. /// Compare two fixed-point values as LHS <= RHS.
  364. /// \p LHS - The left hand side
  365. /// \p LHSSema - The semantic of the left hand side
  366. /// \p RHS - The right hand side
  367. /// \p RHSSema - The semantic of the right hand side
  368. Value *CreateLE(Value *LHS, const FixedPointSemantics &LHSSema,
  369. Value *RHS, const FixedPointSemantics &RHSSema) {
  370. auto CommonSema = getCommonBinopSemantic(LHSSema, RHSSema);
  371. Value *WideLHS = CreateFixedToFixed(LHS, LHSSema, CommonSema);
  372. Value *WideRHS = CreateFixedToFixed(RHS, RHSSema, CommonSema);
  373. return CommonSema.isSigned() ? B.CreateICmpSLE(WideLHS, WideRHS)
  374. : B.CreateICmpULE(WideLHS, WideRHS);
  375. }
  376. /// Compare two fixed-point values as LHS > RHS.
  377. /// \p LHS - The left hand side
  378. /// \p LHSSema - The semantic of the left hand side
  379. /// \p RHS - The right hand side
  380. /// \p RHSSema - The semantic of the right hand side
  381. Value *CreateGT(Value *LHS, const FixedPointSemantics &LHSSema,
  382. Value *RHS, const FixedPointSemantics &RHSSema) {
  383. auto CommonSema = getCommonBinopSemantic(LHSSema, RHSSema);
  384. Value *WideLHS = CreateFixedToFixed(LHS, LHSSema, CommonSema);
  385. Value *WideRHS = CreateFixedToFixed(RHS, RHSSema, CommonSema);
  386. return CommonSema.isSigned() ? B.CreateICmpSGT(WideLHS, WideRHS)
  387. : B.CreateICmpUGT(WideLHS, WideRHS);
  388. }
  389. /// Compare two fixed-point values as LHS >= RHS.
  390. /// \p LHS - The left hand side
  391. /// \p LHSSema - The semantic of the left hand side
  392. /// \p RHS - The right hand side
  393. /// \p RHSSema - The semantic of the right hand side
  394. Value *CreateGE(Value *LHS, const FixedPointSemantics &LHSSema,
  395. Value *RHS, const FixedPointSemantics &RHSSema) {
  396. auto CommonSema = getCommonBinopSemantic(LHSSema, RHSSema);
  397. Value *WideLHS = CreateFixedToFixed(LHS, LHSSema, CommonSema);
  398. Value *WideRHS = CreateFixedToFixed(RHS, RHSSema, CommonSema);
  399. return CommonSema.isSigned() ? B.CreateICmpSGE(WideLHS, WideRHS)
  400. : B.CreateICmpUGE(WideLHS, WideRHS);
  401. }
  402. };
  403. } // end namespace llvm
  404. #endif // LLVM_IR_FIXEDPOINTBUILDER_H
  405. #ifdef __GNUC__
  406. #pragma GCC diagnostic pop
  407. #endif