Commit 03781232 authored by Santiago Aboy Solanes's avatar Santiago Aboy Solanes Committed by Commit Bot

[CSA][cleanup] TNodify CODE_ASSEMBLER_BINARY_OP macros

Bug: v8:6949
Change-Id: Ie8620ec5f3025cdf4f419c80db221d57698fd508
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2726514Reviewed-by: 's avatarMythri Alle <mythria@chromium.org>
Commit-Queue: Santiago Aboy Solanes <solanes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#73121}
parent 64ca87d8
......@@ -9981,8 +9981,11 @@ void CodeStubAssembler::StoreElementTypedArray(TNode<TArray> elements,
#endif
} else {
if (kind == UINT8_CLAMPED_ELEMENTS) {
// TODO(solanes, v8:6949): Remove these UncheckedCast once {value} has
// been TNodified.
CSA_ASSERT(this, Word32Equal(UncheckedCast<Word32T>(value),
Word32And(Int32Constant(0xFF), value)));
Word32And(Int32Constant(0xFF),
UncheckedCast<Word32T>(value))));
}
TNode<IntPtrT> offset = ElementOffsetFromIndex(index, kind, 0);
// TODO(cbruni): Add OOB check once typed.
......
......@@ -553,10 +553,9 @@ TNode<WordT> CodeAssembler::WordPoisonOnSpeculation(TNode<WordT> value) {
return UncheckedCast<WordT>(raw_assembler()->WordPoisonOnSpeculation(value));
}
#define DEFINE_CODE_ASSEMBLER_BINARY_OP(name, ResType, Arg1Type, Arg2Type) \
TNode<ResType> CodeAssembler::name(SloppyTNode<Arg1Type> a, \
SloppyTNode<Arg2Type> b) { \
return UncheckedCast<ResType>(raw_assembler()->name(a, b)); \
#define DEFINE_CODE_ASSEMBLER_BINARY_OP(name, ResType, Arg1Type, Arg2Type) \
TNode<ResType> CodeAssembler::name(TNode<Arg1Type> a, TNode<Arg2Type> b) { \
return UncheckedCast<ResType>(raw_assembler()->name(a, b)); \
}
CODE_ASSEMBLER_BINARY_OP_LIST(DEFINE_CODE_ASSEMBLER_BINARY_OP)
#undef DEFINE_CODE_ASSEMBLER_BINARY_OP
......
......@@ -866,66 +866,61 @@ class V8_EXPORT_PRIVATE CodeAssembler {
// Basic arithmetic operations.
#define DECLARE_CODE_ASSEMBLER_BINARY_OP(name, ResType, Arg1Type, Arg2Type) \
TNode<ResType> name(SloppyTNode<Arg1Type> a, SloppyTNode<Arg2Type> b);
TNode<ResType> name(TNode<Arg1Type> a, TNode<Arg2Type> b);
CODE_ASSEMBLER_BINARY_OP_LIST(DECLARE_CODE_ASSEMBLER_BINARY_OP)
#undef DECLARE_CODE_ASSEMBLER_BINARY_OP
TNode<UintPtrT> WordShr(TNode<UintPtrT> left, TNode<IntegralT> right) {
return Unsigned(
WordShr(static_cast<Node*>(left), static_cast<Node*>(right)));
return Unsigned(WordShr(static_cast<TNode<WordT>>(left), right));
}
TNode<IntPtrT> WordSar(TNode<IntPtrT> left, TNode<IntegralT> right) {
return Signed(WordSar(static_cast<Node*>(left), static_cast<Node*>(right)));
return Signed(WordSar(static_cast<TNode<WordT>>(left), right));
}
TNode<IntPtrT> WordShl(TNode<IntPtrT> left, TNode<IntegralT> right) {
return Signed(WordShl(static_cast<Node*>(left), static_cast<Node*>(right)));
return Signed(WordShl(static_cast<TNode<WordT>>(left), right));
}
TNode<UintPtrT> WordShl(TNode<UintPtrT> left, TNode<IntegralT> right) {
return Unsigned(
WordShl(static_cast<Node*>(left), static_cast<Node*>(right)));
return Unsigned(WordShl(static_cast<TNode<WordT>>(left), right));
}
TNode<Int32T> Word32Shl(TNode<Int32T> left, TNode<Int32T> right) {
return Signed(
Word32Shl(static_cast<Node*>(left), static_cast<Node*>(right)));
return Signed(Word32Shl(static_cast<TNode<Word32T>>(left), right));
}
TNode<Uint32T> Word32Shl(TNode<Uint32T> left, TNode<Uint32T> right) {
return Unsigned(
Word32Shl(static_cast<Node*>(left), static_cast<Node*>(right)));
return Unsigned(Word32Shl(static_cast<TNode<Word32T>>(left), right));
}
TNode<Uint32T> Word32Shr(TNode<Uint32T> left, TNode<Uint32T> right) {
return Unsigned(
Word32Shr(static_cast<Node*>(left), static_cast<Node*>(right)));
return Unsigned(Word32Shr(static_cast<TNode<Word32T>>(left), right));
}
TNode<Int32T> Word32Sar(TNode<Int32T> left, TNode<Int32T> right) {
return Signed(
Word32Sar(static_cast<Node*>(left), static_cast<Node*>(right)));
return Signed(Word32Sar(static_cast<TNode<Word32T>>(left), right));
}
TNode<IntPtrT> WordAnd(TNode<IntPtrT> left, TNode<IntPtrT> right) {
return Signed(WordAnd(static_cast<Node*>(left), static_cast<Node*>(right)));
return Signed(WordAnd(static_cast<TNode<WordT>>(left),
static_cast<TNode<WordT>>(right)));
}
TNode<UintPtrT> WordAnd(TNode<UintPtrT> left, TNode<UintPtrT> right) {
return Unsigned(
WordAnd(static_cast<Node*>(left), static_cast<Node*>(right)));
return Unsigned(WordAnd(static_cast<TNode<WordT>>(left),
static_cast<TNode<WordT>>(right)));
}
TNode<Int32T> Word32And(TNode<Int32T> left, TNode<Int32T> right) {
return Signed(
Word32And(static_cast<Node*>(left), static_cast<Node*>(right)));
return Signed(Word32And(static_cast<TNode<Word32T>>(left),
static_cast<TNode<Word32T>>(right)));
}
TNode<Uint32T> Word32And(TNode<Uint32T> left, TNode<Uint32T> right) {
return Unsigned(
Word32And(static_cast<Node*>(left), static_cast<Node*>(right)));
return Unsigned(Word32And(static_cast<TNode<Word32T>>(left),
static_cast<TNode<Word32T>>(right)));
}
TNode<Int32T> Word32Or(TNode<Int32T> left, TNode<Int32T> right) {
return Signed(
Word32Or(static_cast<Node*>(left), static_cast<Node*>(right)));
return Signed(Word32Or(static_cast<TNode<Word32T>>(left),
static_cast<TNode<Word32T>>(right)));
}
TNode<Uint32T> Word32Or(TNode<Uint32T> left, TNode<Uint32T> right) {
return Unsigned(
Word32Or(static_cast<Node*>(left), static_cast<Node*>(right)));
return Unsigned(Word32Or(static_cast<TNode<Word32T>>(left),
static_cast<TNode<Word32T>>(right)));
}
TNode<BoolT> IntPtrEqual(TNode<WordT> left, TNode<WordT> right);
......@@ -937,53 +932,53 @@ class V8_EXPORT_PRIVATE CodeAssembler {
TNode<BoolT> Word64NotEqual(TNode<Word64T> left, TNode<Word64T> right);
TNode<BoolT> Word32Or(TNode<BoolT> left, TNode<BoolT> right) {
return UncheckedCast<BoolT>(
Word32Or(static_cast<Node*>(left), static_cast<Node*>(right)));
return UncheckedCast<BoolT>(Word32Or(static_cast<TNode<Word32T>>(left),
static_cast<TNode<Word32T>>(right)));
}
TNode<BoolT> Word32And(TNode<BoolT> left, TNode<BoolT> right) {
return UncheckedCast<BoolT>(
Word32And(static_cast<Node*>(left), static_cast<Node*>(right)));
return UncheckedCast<BoolT>(Word32And(static_cast<TNode<Word32T>>(left),
static_cast<TNode<Word32T>>(right)));
}
TNode<Int32T> Int32Add(TNode<Int32T> left, TNode<Int32T> right) {
return Signed(
Int32Add(static_cast<Node*>(left), static_cast<Node*>(right)));
return Signed(Int32Add(static_cast<TNode<Word32T>>(left),
static_cast<TNode<Word32T>>(right)));
}
TNode<Uint32T> Uint32Add(TNode<Uint32T> left, TNode<Uint32T> right) {
return Unsigned(
Int32Add(static_cast<Node*>(left), static_cast<Node*>(right)));
return Unsigned(Int32Add(static_cast<TNode<Word32T>>(left),
static_cast<TNode<Word32T>>(right)));
}
TNode<Int32T> Int32Sub(TNode<Int32T> left, TNode<Int32T> right) {
return Signed(
Int32Sub(static_cast<Node*>(left), static_cast<Node*>(right)));
return Signed(Int32Sub(static_cast<TNode<Word32T>>(left),
static_cast<TNode<Word32T>>(right)));
}
TNode<Int32T> Int32Mul(TNode<Int32T> left, TNode<Int32T> right) {
return Signed(
Int32Mul(static_cast<Node*>(left), static_cast<Node*>(right)));
return Signed(Int32Mul(static_cast<TNode<Word32T>>(left),
static_cast<TNode<Word32T>>(right)));
}
TNode<IntPtrT> IntPtrAdd(TNode<IntPtrT> left, TNode<IntPtrT> right) {
return Signed(
IntPtrAdd(static_cast<Node*>(left), static_cast<Node*>(right)));
return Signed(IntPtrAdd(static_cast<TNode<WordT>>(left),
static_cast<TNode<WordT>>(right)));
}
TNode<IntPtrT> IntPtrSub(TNode<IntPtrT> left, TNode<IntPtrT> right) {
return Signed(
IntPtrSub(static_cast<Node*>(left), static_cast<Node*>(right)));
return Signed(IntPtrSub(static_cast<TNode<WordT>>(left),
static_cast<TNode<WordT>>(right)));
}
TNode<IntPtrT> IntPtrMul(TNode<IntPtrT> left, TNode<IntPtrT> right) {
return Signed(
IntPtrMul(static_cast<Node*>(left), static_cast<Node*>(right)));
return Signed(IntPtrMul(static_cast<TNode<WordT>>(left),
static_cast<TNode<WordT>>(right)));
}
TNode<UintPtrT> UintPtrAdd(TNode<UintPtrT> left, TNode<UintPtrT> right) {
return Unsigned(
IntPtrAdd(static_cast<Node*>(left), static_cast<Node*>(right)));
return Unsigned(IntPtrAdd(static_cast<TNode<WordT>>(left),
static_cast<TNode<WordT>>(right)));
}
TNode<UintPtrT> UintPtrSub(TNode<UintPtrT> left, TNode<UintPtrT> right) {
return Unsigned(
IntPtrSub(static_cast<Node*>(left), static_cast<Node*>(right)));
return Unsigned(IntPtrSub(static_cast<TNode<WordT>>(left),
static_cast<TNode<WordT>>(right)));
}
TNode<RawPtrT> RawPtrAdd(TNode<RawPtrT> left, TNode<IntPtrT> right) {
return ReinterpretCast<RawPtrT>(IntPtrAdd(left, right));
......@@ -992,8 +987,8 @@ class V8_EXPORT_PRIVATE CodeAssembler {
return ReinterpretCast<RawPtrT>(IntPtrSub(left, right));
}
TNode<IntPtrT> RawPtrSub(TNode<RawPtrT> left, TNode<RawPtrT> right) {
return Signed(
IntPtrSub(static_cast<Node*>(left), static_cast<Node*>(right)));
return Signed(IntPtrSub(static_cast<TNode<WordT>>(left),
static_cast<TNode<WordT>>(right)));
}
TNode<WordT> WordShl(TNode<WordT> value, int shift);
......
......@@ -3135,7 +3135,7 @@ TEST(DirectMemoryTest16BitWord32) {
for (size_t i = 0; i < element_count; ++i) {
for (size_t j = 0; j < element_count; ++j) {
Node* loaded = m.LoadBufferData<Uint16T>(
TNode<Uint16T> loaded = m.LoadBufferData<Uint16T>(
buffer_node1, static_cast<int>(i * sizeof(int16_t)));
TNode<Word32T> masked = m.Word32And(loaded, constants[j]);
if ((buffer[j] & buffer[i]) != 0) {
......
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