Commit c57c661d authored by Dan Elphick's avatar Dan Elphick Committed by Commit Bot

[cleanup] TNodify RoundIntPtrToFloat64

Makes RoundIntPtrToFloat64 return TNode<Float64T> instead of Node*.

Bug: v8:10155
Change-Id: I1edd5456b2b86b264b66eeab5e46ceb2a1f0170f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2064978
Commit-Queue: Dan Elphick <delphick@chromium.org>
Reviewed-by: 's avatarTobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66421}
parent 300c139b
...@@ -7701,7 +7701,7 @@ void CodeStubAssembler::NumberDictionaryLookup( ...@@ -7701,7 +7701,7 @@ void CodeStubAssembler::NumberDictionaryLookup(
TNode<IntPtrT> mask = IntPtrSub(capacity, IntPtrConstant(1)); TNode<IntPtrT> mask = IntPtrSub(capacity, IntPtrConstant(1));
TNode<UintPtrT> hash = ChangeUint32ToWord(ComputeSeededHash(intptr_index)); TNode<UintPtrT> hash = ChangeUint32ToWord(ComputeSeededHash(intptr_index));
Node* key_as_float64 = RoundIntPtrToFloat64(intptr_index); TNode<Float64T> key_as_float64 = RoundIntPtrToFloat64(intptr_index);
// See Dictionary::FirstProbe(). // See Dictionary::FirstProbe().
TNode<IntPtrT> count = IntPtrConstant(0); TNode<IntPtrT> count = IntPtrConstant(0);
......
...@@ -564,44 +564,41 @@ TNode<UintPtrT> CodeAssembler::ChangeUint32ToWord(TNode<Word32T> value) { ...@@ -564,44 +564,41 @@ TNode<UintPtrT> CodeAssembler::ChangeUint32ToWord(TNode<Word32T> value) {
TNode<IntPtrT> CodeAssembler::ChangeInt32ToIntPtr(TNode<Word32T> value) { TNode<IntPtrT> CodeAssembler::ChangeInt32ToIntPtr(TNode<Word32T> value) {
if (raw_assembler()->machine()->Is64()) { if (raw_assembler()->machine()->Is64()) {
return ReinterpretCast<IntPtrT>(raw_assembler()->ChangeInt32ToInt64(value)); return UncheckedCast<IntPtrT>(raw_assembler()->ChangeInt32ToInt64(value));
} }
return ReinterpretCast<IntPtrT>(value); return ReinterpretCast<IntPtrT>(value);
} }
TNode<IntPtrT> CodeAssembler::ChangeFloat64ToIntPtr(TNode<Float64T> value) { TNode<IntPtrT> CodeAssembler::ChangeFloat64ToIntPtr(TNode<Float64T> value) {
if (raw_assembler()->machine()->Is64()) { if (raw_assembler()->machine()->Is64()) {
return ReinterpretCast<IntPtrT>( return UncheckedCast<IntPtrT>(raw_assembler()->ChangeFloat64ToInt64(value));
raw_assembler()->ChangeFloat64ToInt64(value));
} }
return ReinterpretCast<IntPtrT>(raw_assembler()->ChangeFloat64ToInt32(value)); return UncheckedCast<IntPtrT>(raw_assembler()->ChangeFloat64ToInt32(value));
} }
TNode<UintPtrT> CodeAssembler::ChangeFloat64ToUintPtr(TNode<Float64T> value) { TNode<UintPtrT> CodeAssembler::ChangeFloat64ToUintPtr(TNode<Float64T> value) {
if (raw_assembler()->machine()->Is64()) { if (raw_assembler()->machine()->Is64()) {
return ReinterpretCast<UintPtrT>( return UncheckedCast<UintPtrT>(
raw_assembler()->ChangeFloat64ToUint64(value)); raw_assembler()->ChangeFloat64ToUint64(value));
} }
return ReinterpretCast<UintPtrT>( return UncheckedCast<UintPtrT>(raw_assembler()->ChangeFloat64ToUint32(value));
raw_assembler()->ChangeFloat64ToUint32(value));
} }
TNode<Float64T> CodeAssembler::ChangeUintPtrToFloat64(TNode<UintPtrT> value) { TNode<Float64T> CodeAssembler::ChangeUintPtrToFloat64(TNode<UintPtrT> value) {
if (raw_assembler()->machine()->Is64()) { if (raw_assembler()->machine()->Is64()) {
// TODO(turbofan): Maybe we should introduce a ChangeUint64ToFloat64 // TODO(turbofan): Maybe we should introduce a ChangeUint64ToFloat64
// machine operator to TurboFan here? // machine operator to TurboFan here?
return ReinterpretCast<Float64T>( return UncheckedCast<Float64T>(
raw_assembler()->RoundUint64ToFloat64(value)); raw_assembler()->RoundUint64ToFloat64(value));
} }
return ReinterpretCast<Float64T>( return UncheckedCast<Float64T>(raw_assembler()->ChangeUint32ToFloat64(value));
raw_assembler()->ChangeUint32ToFloat64(value));
} }
Node* CodeAssembler::RoundIntPtrToFloat64(Node* value) { TNode<Float64T> CodeAssembler::RoundIntPtrToFloat64(Node* value) {
if (raw_assembler()->machine()->Is64()) { if (raw_assembler()->machine()->Is64()) {
return raw_assembler()->RoundInt64ToFloat64(value); return UncheckedCast<Float64T>(raw_assembler()->RoundInt64ToFloat64(value));
} }
return raw_assembler()->ChangeInt32ToFloat64(value); return UncheckedCast<Float64T>(raw_assembler()->ChangeInt32ToFloat64(value));
} }
#define DEFINE_CODE_ASSEMBLER_UNARY_OP(name, ResType, ArgType) \ #define DEFINE_CODE_ASSEMBLER_UNARY_OP(name, ResType, ArgType) \
......
...@@ -932,7 +932,7 @@ class V8_EXPORT_PRIVATE CodeAssembler { ...@@ -932,7 +932,7 @@ class V8_EXPORT_PRIVATE CodeAssembler {
// Changes an intptr_t to a double, e.g. for storing an element index // Changes an intptr_t to a double, e.g. for storing an element index
// outside Smi range in a HeapNumber. Lossless on 32-bit, // outside Smi range in a HeapNumber. Lossless on 32-bit,
// rounds on 64-bit (which doesn't affect valid element indices). // rounds on 64-bit (which doesn't affect valid element indices).
Node* RoundIntPtrToFloat64(Node* value); TNode<Float64T> RoundIntPtrToFloat64(Node* value);
// No-op on 32-bit, otherwise zero extend. // No-op on 32-bit, otherwise zero extend.
TNode<UintPtrT> ChangeUint32ToWord(TNode<Word32T> value); TNode<UintPtrT> ChangeUint32ToWord(TNode<Word32T> value);
// No-op on 32-bit, otherwise sign extend. // No-op on 32-bit, otherwise sign extend.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment