Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/hotspot/share/opto/convertnode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -987,8 +987,7 @@ int Float16NodeFactory::get_float16_binary_oper(int opc) {
return Op_MaxHF;
case Op_MinF:
return Op_MinHF;
default:
return false;
default: ShouldNotReachHere();
}
}

Expand Down
19 changes: 11 additions & 8 deletions src/hotspot/share/opto/library_call.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8654,14 +8654,17 @@ bool LibraryCallKit::inline_fp16_operations(vmIntrinsics::ID id, int num_args) {

Node* result = nullptr;
switch (id) {
// Unary operations
case vmIntrinsics::_sqrt_float16: result = _gvn.transform(new SqrtHFNode(C, control(), fld1)); break;

// Ternary operations
case vmIntrinsics::_fma_float16: result = _gvn.transform(new FmaHFNode(control(), fld1, fld2, fld3)); break;
default:
fatal_unexpected_iid(id);
break;
// Unary operations
case vmIntrinsics::_sqrt_float16:
result = _gvn.transform(new SqrtHFNode(C, control(), fld1));
break;
// Ternary operations
case vmIntrinsics::_fma_float16:
result = _gvn.transform(new FmaHFNode(control(), fld1, fld2, fld3));
break;
default:
fatal_unexpected_iid(id);
break;
}
set_result(_gvn.transform(new ReinterpretHF2SNode(result)));
return true;
Expand Down
4 changes: 3 additions & 1 deletion src/hotspot/share/opto/mulnode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,9 @@ Node* MulHFNode::Ideal(PhaseGVN* phase, bool can_reshape) {

// Compute the product type of two half float ranges into this node.
const Type* MulHFNode::mul_ring(const Type* t0, const Type* t1) const {
if(t0 == Type::HALF_FLOAT || t1 == Type::HALF_FLOAT) return Type::HALF_FLOAT;
if (t0 == Type::HALF_FLOAT || t1 == Type::HALF_FLOAT) {
return Type::HALF_FLOAT;
}
return TypeH::make(t0->getf() * t1->getf());
}

Expand Down
10 changes: 5 additions & 5 deletions src/hotspot/share/opto/type.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ void Type::Initialize_shared(Compile* current) {
ABIO = make(Abio); // State-of-machine only
RETURN_ADDRESS=make(Return_Address);
FLOAT = make(FloatBot); // All floats
HALF_FLOAT = make(HalfFloatBot); // All half floats
HALF_FLOAT = make(HalfFloatBot); // All half floats
DOUBLE = make(DoubleBot); // All doubles
BOTTOM = make(Bottom); // Everything
HALF = make(Half); // Placeholder half of doublewide type
Expand Down Expand Up @@ -1083,11 +1083,11 @@ const Type *Type::xmeet( const Type *t ) const {
return t;

case HalfFloatTop:
if (_base == HalfFloatTop) return this;
if (_base == HalfFloatTop) { return this; }
case HalfFloatBot: // Half Float
if (_base == HalfFloatBot || _base == HalfFloatTop) return HALF_FLOAT;
if (_base == FloatBot || _base == FloatTop) return Type::BOTTOM;
if (_base == DoubleTop || _base == DoubleBot) return Type::BOTTOM;
if (_base == HalfFloatBot || _base == HalfFloatTop) { return HALF_FLOAT; }
if (_base == FloatBot || _base == FloatTop) { return Type::BOTTOM; }
if (_base == DoubleTop || _base == DoubleBot) { return Type::BOTTOM; }
typerr(t);
return Type::BOTTOM;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use curly-braces even for single-line ifs


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
/**
* The class {@code Float16Math} constains intrinsic entry points corresponding
* to scalar numeric operations defined in Float16 class.
* @author
* @since 24
*/
public final class Float16Math {
Expand Down