Skip to content

Commit

Permalink
Remove use of -fno-operator-names
Browse files Browse the repository at this point in the history
Summary:
- and and not are reserved words so don't use them. If you don't specify `-fno-operator-names`.
- To be able to use C++ modules described in https://fb.workplace.com/groups/fbcode.fyi/posts/8644101325625592 to hopefully speed up build time we can't use `-fno-operator-names`.

Reviewed By: mdko

Differential Revision: D65721404

fbshipit-source-id: 12d16a2c6b5a286928d51a4935f54d6df0a038e7
  • Loading branch information
WizKid authored and facebook-github-bot committed Dec 5, 2024
1 parent 34372c8 commit ea9aa37
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions hphp/runtime/base/bespoke/layout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ Optional<LayoutTest> compute2ByteTest(
for (auto const live : liveVec) {
imm &= ~live;
}
auto const and = LayoutTest { imm, LayoutTest::And2Byte };
if (checkLayoutTest(liveVec, deadVec, and)) return and;
auto const and_ = LayoutTest { imm, LayoutTest::And2Byte };
if (checkLayoutTest(liveVec, deadVec, and_)) return and_;

return std::nullopt;
}
Expand Down
4 changes: 2 additions & 2 deletions hphp/runtime/test/vasm-fold-test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ TEST(Vasm, FoldImms) {
"B0 main (1)\n"
"movl %133(42l) => %128\n"
"xorqi -1, %128 => %129, %131\n"
"not %128 => %130\n"
"not_ %128 => %130\n"
"movl %131 => %135\n"
"ret {}\n",
genTestCode<xorq>(0, -1) // xorq -1,r
Expand All @@ -242,7 +242,7 @@ TEST(Vasm, FoldImms) {
"B0 main (1)\n"
"movl %133(42l) => %128\n"
"xorqi -1, %128 => %129, %131\n"
"not %128 => %130\n"
"not_ %128 => %130\n"
"movl %131 => %135\n"
"ret {}\n",
genTestCode<xorq>(1, -1) // xorq r,-1
Expand Down
2 changes: 1 addition & 1 deletion hphp/runtime/vm/jit/vasm-arm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ struct Vgen {
void emit(const neg& i) { a->Neg(X(i.d), X(i.s), UF(i.fl)); }
void emit(const nop& /*i*/) { a->Nop(); }
void emit(const notb& i) { a->Mvn(W(i.d), W(i.s)); }
void emit(const not& i) { a->Mvn(X(i.d), X(i.s)); }
void emit(const not_& i) { a->Mvn(X(i.d), X(i.s)); }
void emit(const orbi& i);
void emit(const orq& i);
void emit(const orwi& i);
Expand Down
4 changes: 2 additions & 2 deletions hphp/runtime/vm/jit/vasm-fold-imms.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -304,15 +304,15 @@ struct ImmFolder {
if (val == 0 && !uses[in.sf]) { // copy doesn't set any flags
out = copy{in.s1, in.d};
} else if (val == -1 && !uses[in.sf]) { // not doesn't set any flags
out = not{in.s1, in.d};
out = not_{in.s1, in.d};
} else {
out = xorqi{val, in.s1, in.d, in.sf};
}
} else if (match_int(in.s1, val)) {
if (val == 0 && !uses[in.sf]) { // copy doesn't set any flags
out = copy{in.s0, in.d};
} else if (val == -1 && !uses[in.sf]) { // not doesn't set any flags
out = not{in.s0, in.d};
out = not_{in.s0, in.d};
} else {
out = xorqi{val, in.s0, in.d, in.sf};
}
Expand Down
2 changes: 1 addition & 1 deletion hphp/runtime/vm/jit/vasm-info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ bool effectsImpl(const Vinstr& inst, bool pure) {
case Vinstr::mulsd:
case Vinstr::neg:
case Vinstr::nop:
case Vinstr::not:
case Vinstr::not_:
case Vinstr::notb:
case Vinstr::orbi:
case Vinstr::orwi:
Expand Down
2 changes: 1 addition & 1 deletion hphp/runtime/vm/jit/vasm-instr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ Width width(Vinstr::Opcode op) {
case Vinstr::divint:
case Vinstr::srem:
case Vinstr::neg:
case Vinstr::not:
case Vinstr::not_:
case Vinstr::orwi:
case Vinstr::orli:
case Vinstr::orq:
Expand Down
4 changes: 2 additions & 2 deletions hphp/runtime/vm/jit/vasm-instr.h
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ struct Vunit;
O(srem, Inone, U(s0) U(s1), D(d))\
O(neg, I(fl), UH(s,d), DH(d,s) D(sf))\
O(notb, Inone, UH(s,d), DH(d,s))\
O(not, Inone, UH(s,d), DH(d,s))\
O(not_, Inone, UH(s,d), DH(d,s))\
O(orbi, I(s0) I(fl), UH(s1,d), DH(d,s1) D(sf)) \
O(orbim, I(s0) I(fl), UM(m), D(sf))\
O(orwim, I(s0) I(fl), UM(m), D(sf))\
Expand Down Expand Up @@ -1053,7 +1053,7 @@ struct srem { Vreg64 s0, s1, d; };
struct neg { Vreg64 s, d; VregSF sf; Vflags fl; };
// not: ~s => d
struct notb { Vreg8 s, d; };
struct not { Vreg64 s, d; };
struct not_ { Vreg64 s, d; };
// or: s0 | {s1|m} => {d|m}, sf
struct orbi { Immed s0; Vreg8 s1, d; VregSF sf; Vflags fl; };
struct orbim { Immed s0; Vptr8 m; VregSF sf; Vflags fl; };
Expand Down
2 changes: 1 addition & 1 deletion hphp/runtime/vm/jit/vasm-x64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ struct Vgen {
void emit(mulsd i) { commute(i); a.mulsd(i.s0, i.d); }
void emit(neg i) { unary(i); a.neg(i.d); }
void emit(const nop& /*i*/) { a.nop(); }
void emit(not i) { unary(i); a.not(i.d); }
void emit(not_ i) { unary(i); a.not_(i.d); }
void emit(notb i) { unary(i); a.notb(i.d); }
void emit(orbi i) { binary(i); a.orb(i.s0, i.d); }
void emit(const orbim& i) { a.prefix(i.m.mr()).orb(i.s0, i.m); }
Expand Down
2 changes: 1 addition & 1 deletion hphp/util/asm-x64.h
Original file line number Diff line number Diff line change
Expand Up @@ -886,7 +886,7 @@ struct X64Assembler {
void decl(Reg32 r) { instrR(instr_dec, r); }
void decw(Reg16 r) { instrR(instr_dec, r); }
void notb(Reg8 r) { instrR(instr_notb, r); }
void not(Reg64 r) { instrR(instr_not, r); }
void not_(Reg64 r) { instrR(instr_not, r); }
void neg(Reg64 r) { instrR(instr_neg, r); }
void negb(Reg8 r) { instrR(instr_negb, r); }
void ret() { emit(instr_ret); }
Expand Down

0 comments on commit ea9aa37

Please sign in to comment.