mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-03-03 16:13:44 +00:00

Summary: This patch changes speficic extremum functions rewrite to generic MIN/MAX. It applies to AMAX0, AMIN0, AMAX1, AMIN1, MAX0, MIN0, MAX1, MIN1, DMAX1, and DMIN1. - Do not re-write specific extremums to MAX/MIN in intrinsic Probe and let folding rewrite it and introduc the conversion on the MIN/MAX result. - Also make operand promotion explicit in MIN/MAX folding. For instance, after this patch: AMAX0(int8, int4) is rewritten to REAL(MAX(int8, INT(int4, 8))) All this care is to avoid rewritting it to MAX(REAL(int8), REAL(int4)) that may not always be numerically equivalent to the first rewrite. Reviewers: klausler, schweitz, sscalpone, jdoerfert, DavidTruby Reviewed By: klausler, schweitz Subscribers: llvm-commits, flang-commits Tags: #flang, #llvm Differential Revision: https://reviews.llvm.org/D81940