Revert "add operator "" _mask() to make Assembler clearer"

This reverts commit 076e5d3a4c.

Reason for revert: breaking google3. "literal operators are an unapproved C++11 feature"

Original change's description:
> add operator "" _mask() to make Assembler clearer
> 
> Change-Id: I145f0f60288eef368fc7648b25661356cb6e9f12
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/223980
> Commit-Queue: Mike Klein <mtklein@google.com>
> Reviewed-by: Herb Derby <herb@google.com>

TBR=mtklein@google.com,herb@google.com

Change-Id: Ib41aa871c2e8b9b27fb75b73e538729c9ab24112
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/224076
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
This commit is contained in:
Greg Daniel 2019-06-27 03:06:55 +00:00 committed by Skia Commit-Bot
parent 15500644c7
commit 6188af3c3d

View File

@ -710,14 +710,12 @@ namespace skvm {
// https://static.docs.arm.com/ddi0596/a/DDI_0596_ARM_a64_instruction_set_architecture.pdf
static int operator"" _mask(unsigned long long bits) { return (1<<(int)bits)-1; }
void Assembler::op(uint32_t hi, V m, uint32_t lo, V n, V d) {
this->word( (hi & 11_mask) << 21
| (m & 5_mask) << 16
| (lo & 6_mask) << 10
| (n & 5_mask) << 5
| (d & 5_mask) << 0);
this->word( (hi & 2047) << 21
| (m & 31) << 16
| (lo & 63) << 10
| (n & 31) << 5
| (d & 31) << 0 );
}
void Assembler::and16b(V d, V n, V m) { this->op(0b0'1'0'01110'00'1, m, 0b00011'1, n, d); }
@ -740,10 +738,10 @@ namespace skvm {
void Assembler::fmla4s(V d, V n, V m) { this->op(0b0'1'0'01110'0'0'1, m, 0b11001'1, n, d); }
void Assembler::shift(uint32_t op, int imm, V n, V d) {
this->word( (op & 22_mask) << 10
| imm << 16 // imm is embedded inside op, bit size depends on op
| (n & 5_mask) << 5
| (d & 5_mask) << 0);
this->word( (op & 4194303) << 10
| (imm ) << 16 // imm is embedded inside op, bit size depends on op
| (n & 31) << 5
| (d & 31) << 0);
}
void Assembler::shl4s(V d, V n, int imm) {
@ -761,51 +759,51 @@ namespace skvm {
void Assembler::scvtf4s(V d, V n) {
this->word(0b0'1'0'01110'0'0'10000'11101'10 << 10
| (n & 5_mask) << 5
| (d & 5_mask) << 0);
| (n & 31) << 5
| (d & 31) << 0);
}
void Assembler::fcvtzs4s(V d, V n) {
this->word(0b0'1'0'01110'1'0'10000'1101'1'10 << 10
| (n & 5_mask) << 5
| (d & 5_mask) << 0);
| (n & 31) << 5
| (d & 31) << 0);
}
void Assembler::ret(X n) {
this->word(0b1101011'0'0'10'11111'0000'0'0 << 10
| (n & 5_mask) << 5);
| (n & 31) << 5);
}
void Assembler::add(X d, X n, int imm12) {
this->word(0b1'0'0'10001'00 << 22
| (imm12 & 12_mask) << 10
| (n & 5_mask) << 5
| (d & 5_mask) << 0);
this->word(0b1'0'0'10001'00 << 22
| (imm12 & 4095) << 10
| (n & 31) << 5
| (d & 31) << 0);
}
void Assembler::subs(X d, X n, int imm12) {
this->word( 0b1'1'1'10001'00 << 22
| (imm12 & 12_mask) << 10
| (n & 5_mask) << 5
| (d & 5_mask) << 0);
this->word( 0b1'1'1'10001'00 << 22
| (imm12 & 4095) << 10
| (n & 31) << 5
| (d & 31) << 0);
}
void Assembler::bne(Label l) {
// Jump in insts from before this one.
const int imm19 = (l.offset - here().offset) / 4;
this->word( 0b0101010'0 << 24
| (imm19 & 19_mask) << 5
| 0b0'0001 << 0);
this->word( 0b0101010'0 << 24
| (imm19 & 524287) << 5
| 0b0'0001 << 0);
}
void Assembler::ldrq(V dst, X src) {
this->word( 0b00'111'1'01'11'000000000000 << 10
| (src & 5_mask) << 5
| (dst & 5_mask) << 0);
| (src & 31) << 5
| (dst & 31) << 0);
}
void Assembler::strq(V src, X dst) {
this->word( 0b00'111'1'01'10'000000000000 << 10
| (dst & 5_mask) << 5
| (src & 5_mask) << 0);
| (dst & 31) << 5
| (src & 31) << 0);
}
#if defined(SKVM_JIT)