Add HVX IEEE floating-point compare instructions:
- V6_vgthf, V6_vgtsf: greater-than compare
- V6_vgthf_and, V6_vgtsf_and: greater-than with predicate-and
- V6_vgthf_or, V6_vgtsf_or: greater-than with predicate-or
- V6_vgthf_xor, V6_vgtsf_xor: greater-than with predicate-xor
Signed-off-by: Matheus Tavares Bernardino <matheus.bernardino@oss.qualcomm.com>
---
target/hexagon/mmvec/macros.h | 10 ++++
target/hexagon/attribs_def.h.inc | 2 +
target/hexagon/hex_common.py | 1 +
target/hexagon/imported/mmvec/encode_ext.def | 10 ++++
target/hexagon/imported/mmvec/ext.idef | 61 ++++++++++++++++++++
5 files changed, 84 insertions(+)
diff --git a/target/hexagon/mmvec/macros.h b/target/hexagon/mmvec/macros.h
index 2af3d2d747..c342507d1a 100644
--- a/target/hexagon/mmvec/macros.h
+++ b/target/hexagon/mmvec/macros.h
@@ -356,4 +356,14 @@
extract32(VAL, POS * 8, 8); \
} while (0);
+#define fCMPGT_SF(A, B) \
+ (float32_is_any_nan(A) || float32_is_any_nan(B) ? \
+ (int32_t)(A) > (int32_t)(B) : \
Seems odd to do an integer comparison of two NaN's
+ float32_compare((A), (B), &env->fp_status) == float_relation_greater)
+
+#define fCMPGT_HF(A, B) \
+ (float16_is_any_nan(A) || float16_is_any_nan(B) ? \
+ (int16_t)(A) > (int16_t)(B) : \
Ditto
+ float16_compare((A), (B), &env->fp_status) == float_relation_greater)
+
#endif
Thanks,
Taylor