[PATCH] D57553: [Fixed Point Arithmetic] Check against source value when converting during saturation

Bevin Hansson via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 1 00:50:34 PST 2019


ebevhan added a comment.

This doesn't seem to address the particular case in the integer conversion patch. In fact, I don't see those conversions at all.



================
Comment at: clang/test/Frontend/fixed_point_add.c:382
+  // CHECK-NEXT: [[USE_MIN:%[0-9]+]] = icmp slt i39 [[SUM]], -32768
+  // CHECK-NEXT: [[RES3:%[a-z0-9]+]] = select i1 [[USE_MIN]], i16 -32768, i16 [[RES2]]
   // CHECK-NEXT: store i16 [[RES3]], i16* %sa_sat, align 2
----------------
Hm, there's a weakness with this emission. This is no longer a min-max pattern, which means it will be a lot harder to generate code for.


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D57553/new/

https://reviews.llvm.org/D57553





More information about the cfe-commits mailing list