From 89ade1d7e88ee005c3fd2136d84e298d94f9a67c Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Mon, 1 Nov 2021 12:30:43 +0000 Subject: [PATCH] 8273416: C2: assert(false) failed: bad AD file after JDK-8252372 with UseSSE={0,1} Reviewed-by: kvn, roland --- src/hotspot/cpu/x86/x86_32.ad | 20 ++++++++++++++++++++ src/hotspot/share/opto/castnode.hpp | 4 ++-- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/src/hotspot/cpu/x86/x86_32.ad b/src/hotspot/cpu/x86/x86_32.ad index 18d213cc31a..a8cdd981b76 100644 --- a/src/hotspot/cpu/x86/x86_32.ad +++ b/src/hotspot/cpu/x86/x86_32.ad @@ -7203,6 +7203,7 @@ instruct castLL( eRegL dst ) %{ %} instruct castFF( regF dst ) %{ + predicate(UseSSE >= 2); match(Set dst (CastFF dst)); format %{ "#castFF of $dst" %} ins_encode( /*empty encoding*/ ); @@ -7211,6 +7212,25 @@ instruct castFF( regF dst ) %{ %} instruct castDD( regD dst ) %{ + predicate(UseSSE >= 2); + match(Set dst (CastDD dst)); + format %{ "#castDD of $dst" %} + ins_encode( /*empty encoding*/ ); + ins_cost(0); + ins_pipe( empty ); +%} + +instruct castFF_PR( regFPR dst ) %{ + predicate(UseSSE < 2); + match(Set dst (CastFF dst)); + format %{ "#castFF of $dst" %} + ins_encode( /*empty encoding*/ ); + ins_cost(0); + ins_pipe( empty ); +%} + +instruct castDD_PR( regDPR dst ) %{ + predicate(UseSSE < 2); match(Set dst (CastDD dst)); format %{ "#castDD of $dst" %} ins_encode( /*empty encoding*/ ); diff --git a/src/hotspot/share/opto/castnode.hpp b/src/hotspot/share/opto/castnode.hpp index 95574e60457..2aa318c0e24 100644 --- a/src/hotspot/share/opto/castnode.hpp +++ b/src/hotspot/share/opto/castnode.hpp @@ -140,7 +140,7 @@ public: init_class_id(Class_CastFF); } virtual int Opcode() const; - virtual uint ideal_reg() const { return Op_RegF; } + virtual uint ideal_reg() const { return in(1)->ideal_reg(); } }; class CastDDNode: public ConstraintCastNode { @@ -150,7 +150,7 @@ public: init_class_id(Class_CastDD); } virtual int Opcode() const; - virtual uint ideal_reg() const { return Op_RegD; } + virtual uint ideal_reg() const { return in(1)->ideal_reg(); } }; class CastVVNode: public ConstraintCastNode {