FixedPointBuilder.h 19 KB

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