This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[HSA] Add support for unordered comparions codes
- From: Martin Jambor <mjambor at suse dot cz>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 28 Aug 2015 16:46:39 +0200
- Subject: [HSA] Add support for unordered comparions codes
- Authentication-results: sourceware.org; auth=none
Hi,
I've committed the following simple patch to the branch to add missing
support for unordered compariosn codes.
Martin
2015-08-28 Martin Jambor <mjambor@suse.cz>
* hsa-gen.c (gen_hsa_cmp_insn_from_gimple): Add unordered
comparison codes.
(gen_hsa_insns_for_operation_assignment): Likewise.
diff --git a/gcc/hsa-gen.c b/gcc/hsa-gen.c
index 213b564..92df7e4 100644
--- a/gcc/hsa-gen.c
+++ b/gcc/hsa-gen.c
@@ -2236,6 +2236,31 @@ gen_hsa_cmp_insn_from_gimple (enum tree_code code, tree lhs, tree rhs,
case NE_EXPR:
compare = BRIG_COMPARE_NE;
break;
+ case UNORDERED_EXPR:
+ compare = BRIG_COMPARE_NAN;
+ break;
+ case ORDERED_EXPR:
+ compare = BRIG_COMPARE_NUM;
+ break;
+ case UNLT_EXPR:
+ compare = BRIG_COMPARE_LTU;
+ break;
+ case UNLE_EXPR:
+ compare = BRIG_COMPARE_LEU;
+ break;
+ case UNGT_EXPR:
+ compare = BRIG_COMPARE_GTU;
+ break;
+ case UNGE_EXPR:
+ compare = BRIG_COMPARE_GEU;
+ break;
+ case UNEQ_EXPR:
+ compare = BRIG_COMPARE_EQU;
+ break;
+ case LTGT_EXPR:
+ compare = BRIG_COMPARE_NEU;
+ break;
+
default:
sorry ("Support for HSA does not implement comparison tree code %s\n",
get_tree_code_name (code));
@@ -2494,6 +2519,14 @@ gen_hsa_insns_for_operation_assignment (gimple assign, hsa_bb *hbb,
case GE_EXPR:
case EQ_EXPR:
case NE_EXPR:
+ case UNORDERED_EXPR:
+ case ORDERED_EXPR:
+ case UNLT_EXPR:
+ case UNLE_EXPR:
+ case UNGT_EXPR:
+ case UNGE_EXPR:
+ case UNEQ_EXPR:
+ case LTGT_EXPR:
{
hsa_op_reg *dest = hsa_reg_for_gimple_ssa (gimple_assign_lhs (assign),
ssa_map);