leonardchan added inline comments.
================ Comment at: clang/test/Frontend/fixed_point_add.c:269 + // UNSIGNED-NEXT: [[SUM:%[0-9]+]] = call i15 @llvm.uadd.sat.i15(i15 [[USA_TRUNC]], i15 [[USA_SAT_TRUNC]]) + // UNSIGNED-NEXT: [[SUM_EXT:%[a-z0-9]+]] = zext i15 [[SUM]] to i16 + // UNSIGNED-NEXT: store i16 [[SUM_EXT]], i16* %usa_sat, align 2 ---------------- ebevhan wrote: > This is probably a candidate for an isel optimization. This operation also > works as an `i16 ssat.add` with a negative-clamp-to-zero afterwards, and if > the target supports `i16 ssat.add` natively then it will likely be a lot more > efficient than whatever an `i15 uadd.sat` produces. Do you think it would be more efficient for now then if instead we did SHL by 1, saturate, then [AL]SHR by 1? This way we could use `i16 ssat.add` instead of `i15 ssat.add`? Repository: rC Clang https://reviews.llvm.org/D53738 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits