Closed Bug 1271977 Opened 9 years ago Closed 9 years ago

Lift bit shifting and bit counting into the macro-assembler

Categories

(Core :: JavaScript Engine: JIT, defect)

x86
Unspecified
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla49
Tracking Status
firefox49 --- fixed

People

(Reporter: lth, Assigned: lth)

References

Details

Attachments

(1 file)

This is code that the wasm baseline will need, I'm just factoring existing code and naming it.
Right now this is defined for x86_shared only because that's where the code comes from and that's what I have the ability to test, but the idea will be to evolve this to cover all platforms.
Attachment #8751265 - Flags: review?(bbouvier)
Comment on attachment 8751265 [details] [diff] [review] bug1271977-bit-stuff.patch Review of attachment 8751265 [details] [diff] [review]: ----------------------------------------------------------------- Thank you! I'm about to do the same for x64... ::: js/src/jit/x86-shared/CodeGenerator-x86-shared.cpp @@ +797,5 @@ > CodeGeneratorX86Shared::visitPopcntI(LPopcntI* ins) > { > Register input = ToRegister(ins->input()); > Register output = ToRegister(ins->output()); > + Register temp = ins->temp()->isBogusTemp() ? InvalidReg : ToRegister(ins->temp()); I think you also need to change Lowering.cpp (and extract the lowering of MPopcnt to the platform specific ones). ::: js/src/jit/x86-shared/MacroAssembler-x86-shared-inl.h @@ +86,5 @@ > + if (!knownNotZero) { > + // If the source is zero then bsrl leaves garbage in the destination. > + Label nonzero; > + j(Assembler::NonZero, &nonzero); > + movl(Imm32(0), dest); xor(0, 0x1F) is 0x1f, but Math.clz32(0) == 32 == 0x20, so this immediate should be 0x3f.
Attachment #8751265 - Flags: review?(bbouvier) → review+
(In reply to Benjamin Bouvier [:bbouvier] from comment #2) > ::: js/src/jit/x86-shared/MacroAssembler-x86-shared-inl.h > @@ +86,5 @@ > > + if (!knownNotZero) { > > + // If the source is zero then bsrl leaves garbage in the destination. > > + Label nonzero; > > + j(Assembler::NonZero, &nonzero); > > + movl(Imm32(0), dest); > > xor(0, 0x1F) is 0x1f, but Math.clz32(0) == 32 == 0x20, so this immediate > should be 0x3f. And I am adding some more test cases since the test suite does not cover this...
See Also: → 1271996
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla49
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: