8282162: [vector] Optimize integral vector negation API

Reviewed-by: jiefu, psandoz, njian
This commit is contained in:
Xiaohong Gong 2022-03-30 01:36:51 +00:00 committed by Jie Fu
parent bfd9c2b30f
commit d06685680c
15 changed files with 301 additions and 51 deletions

View file

@ -573,9 +573,6 @@ public abstract class ByteVector extends AbstractVector<Byte> {
}
if (op == NOT) {
return broadcast(-1).lanewise(XOR, this);
} else if (op == NEG) {
// FIXME: Support this in the JIT.
return broadcast(0).lanewise(SUB, this);
}
}
int opc = opCode(op);
@ -604,8 +601,6 @@ public abstract class ByteVector extends AbstractVector<Byte> {
}
if (op == NOT) {
return lanewise(XOR, broadcast(-1), m);
} else if (op == NEG) {
return lanewise(NOT, m).lanewise(ADD, broadcast(1), m);
}
}
int opc = opCode(op);

View file

@ -573,9 +573,6 @@ public abstract class IntVector extends AbstractVector<Integer> {
}
if (op == NOT) {
return broadcast(-1).lanewise(XOR, this);
} else if (op == NEG) {
// FIXME: Support this in the JIT.
return broadcast(0).lanewise(SUB, this);
}
}
int opc = opCode(op);
@ -604,8 +601,6 @@ public abstract class IntVector extends AbstractVector<Integer> {
}
if (op == NOT) {
return lanewise(XOR, broadcast(-1), m);
} else if (op == NEG) {
return lanewise(NOT, m).lanewise(ADD, broadcast(1), m);
}
}
int opc = opCode(op);

View file

@ -531,9 +531,6 @@ public abstract class LongVector extends AbstractVector<Long> {
}
if (op == NOT) {
return broadcast(-1).lanewise(XOR, this);
} else if (op == NEG) {
// FIXME: Support this in the JIT.
return broadcast(0).lanewise(SUB, this);
}
}
int opc = opCode(op);
@ -562,8 +559,6 @@ public abstract class LongVector extends AbstractVector<Long> {
}
if (op == NOT) {
return lanewise(XOR, broadcast(-1), m);
} else if (op == NEG) {
return lanewise(NOT, m).lanewise(ADD, broadcast(1), m);
}
}
int opc = opCode(op);

View file

@ -573,9 +573,6 @@ public abstract class ShortVector extends AbstractVector<Short> {
}
if (op == NOT) {
return broadcast(-1).lanewise(XOR, this);
} else if (op == NEG) {
// FIXME: Support this in the JIT.
return broadcast(0).lanewise(SUB, this);
}
}
int opc = opCode(op);
@ -604,8 +601,6 @@ public abstract class ShortVector extends AbstractVector<Short> {
}
if (op == NOT) {
return lanewise(XOR, broadcast(-1), m);
} else if (op == NEG) {
return lanewise(NOT, m).lanewise(ADD, broadcast(1), m);
}
}
int opc = opCode(op);

View file

@ -596,9 +596,6 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> {
#if[BITWISE]
if (op == NOT) {
return broadcast(-1).lanewise(XOR, this);
} else if (op == NEG) {
// FIXME: Support this in the JIT.
return broadcast(0).lanewise(SUB, this);
}
#end[BITWISE]
}
@ -629,8 +626,6 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> {
#if[BITWISE]
if (op == NOT) {
return lanewise(XOR, broadcast(-1), m);
} else if (op == NEG) {
return lanewise(NOT, m).lanewise(ADD, broadcast(1), m);
}
#end[BITWISE]
}