[Vm-dev] VM Maker: VMMaker.oscog-eem.1462.mcz
commits at source.squeak.org
commits at source.squeak.org
Tue Sep 22 19:29:31 UTC 2015
Eliot Miranda uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-eem.1462.mcz
==================== Summary ====================
Name: VMMaker.oscog-eem.1462
Author: eem
Time: 22 September 2015, 12:27:16.045 pm
UUID: c70fedfe-dca4-4f7a-83ac-40c7f6e818b5
Ancestors: VMMaker.oscog-eem.1461
More fixes for X64. 18 erroring tests remain.
=============== Diff against VMMaker.oscog-eem.1461 ===============
Item was changed:
+ ----- Method: CogIA32CompilerTests>>methodLabel (in category 'accessing') -----
- ----- Method: CogIA32CompilerTests>>methodLabel (in category 'generating machine code') -----
methodLabel
"There is no methodLabel in test code."
^nil!
Item was added:
+ ----- Method: CogX64Compiler>>codeGranularity (in category 'accessing') -----
+ codeGranularity
+ ^1!
Item was added:
+ ----- Method: CogX64Compiler>>concretizeTstCqR (in category 'generate machine code') -----
+ concretizeTstCqR
+ "Will get inlined into concretizeAt: switch."
+ <inline: true>
+ | value reg |
+ value := operands at: 0.
+ reg := self concreteRegister: (operands at: 1).
+ machineCode
+ at: 0 put: (self rexR: 0 x: 0 b: reg).
+ (self isQuick: value) ifTrue:
+ [machineCode
+ at: 1 put: 16rF6;
+ at: 2 put: (self mod: ModReg RM: reg RO: 0);
+ at: 3 put: (value bitAnd: 16rFF).
+ ^machineCodeSize := 4].
+ self assert: value >> 32 = 0.
+ reg = RAX ifTrue:
+ [machineCode
+ at: 1 put: 16rA9;
+ at: 2 put: (value bitAnd: 16rFF);
+ at: 3 put: (value >> 8 bitAnd: 16rFF);
+ at: 4 put: (value >> 16 bitAnd: 16rFF);
+ at: 5 put: (value >> 24 bitAnd: 16rFF).
+ ^machineCodeSize := 6].
+ machineCode
+ at: 1 put: 16rF7;
+ at: 2 put: (self mod: ModReg RM: reg RO: 0);
+ at: 3 put: (value bitAnd: 16rFF);
+ at: 4 put: (value >> 8 bitAnd: 16rFF);
+ at: 5 put: (value >> 16 bitAnd: 16rFF);
+ at: 6 put: (value >> 24 bitAnd: 16rFF).
+ ^machineCodeSize := 7!
Item was added:
+ ----- Method: CogX64Compiler>>jmpTarget: (in category 'accessing') -----
+ jmpTarget: anAbstractInstruction
+ "Set the target of a jump instruction. These all have the target in the first operand.
+ Override to cope with JumpFPNotEqual where because of IEEE NaN conformance and
+ the behaviour of COMISD/UCOMISD we generate two jumps to the same target."
+ | aDependent |
+ <var: #aDependent type: #'AbstractInstruction *'>
+ aDependent := dependent.
+ [aDependent notNil] whileTrue:
+ [aDependent jmpTarget: anAbstractInstruction.
+ aDependent := aDependent dependent].
+ ^super jmpTarget: anAbstractInstruction!
Item was added:
+ ----- Method: CogX64Compiler>>machineCodeAt: (in category 'accessing') -----
+ machineCodeAt: anOffset
+ ^machineCode at: anOffset!
Item was added:
+ ----- Method: CogX64CompilerTests>>Label (in category 'abstract instructions') -----
+ Label
+ ^self gen: Label operand: opcodes size!
Item was added:
+ ----- Method: CogX64CompilerTests>>methodLabel (in category 'accessing') -----
+ methodLabel
+ "There is no methodLabel in test code."
+ ^nil!
Item was changed:
----- Method: CogX64CompilerTests>>testAndCqR (in category 'tests') -----
testAndCqR
"self new testAndCqR"
self concreteCompilerClass registersWithNamesDo:
[:reg :regname|
#(16r1 16r3 16r7 16r555555 16rAAAAAA) do:
[:const| | inst len|
inst := self gen: AndCqR operand: const operand: reg.
len := inst concretizeAt: 0.
self processor
disassembleInstructionAt: 0
In: inst machineCode object
into: [:str :sz| | plainJane herIntended |
"Convert e.g. '00000000: movl %rax, 0x2(%rax) : 48 89 40 02' to 'movl %rax, 0x2(%rax)'"
plainJane := self strip: str.
+ herIntended := 'andq $0x', (const printStringBase: 16 length: 16 padded: true), ', ', regname.
- herIntended := 'andl $0x', (const printStringBase: 16 length: 16 padded: true), ', ', regname.
self assert: (plainJane match: herIntended).
self assert: len = sz]]]!
Item was changed:
----- Method: CogX64CompilerTests>>testArithmeticShiftRightRR (in category 'tests') -----
testArithmeticShiftRightRR
"CogX64CompilerTests new testArithmeticShiftRightRR"
self concreteCompilerClass dataRegistersWithAccessorsDo:
[:sreg :srgetter :srsetter|
self concreteCompilerClass dataRegistersWithAccessorsDo:
[:dreg :drgetter :drsetter| | inst len |
inst := self gen: ArithmeticShiftRightRR operand: sreg operand: dreg.
len := inst concretizeAt: 0.
self assert: len = (srgetter = #rcx
ifTrue: [3]
ifFalse:
[srgetter = #rax
+ ifTrue: [7]
+ ifFalse: [9]])
- ifTrue: [5]
- ifFalse: [7]])
"self processor disassembleFrom: 0 to: inst machineCodeSize in: inst machineCode object on: Transcript"]]!
Item was changed:
----- Method: CogX64CompilerTests>>testTstCqR (in category 'tests') -----
testTstCqR
"self new testTstCqR"
self concreteCompilerClass registersWithNamesDo:
[:reg :theRegname|
#(16r1 16r3 16r7 16r555555 16rAAAAAA) do:
[:const| | op regname inst len constString|
inst := self gen: TstCqR operand: const operand: reg.
len := inst concretizeAt: 0.
+ (inst isQuick: const)
- ((inst isQuick: const) and: [reg < 4])
ifTrue:
[op := 'testb'.
+ regname := reg < 8
+ ifTrue: [#('%al' '%cl' '%dl' '%bl' '%spl' '%bpl' '%sil' '%dil') at: reg + 1]
+ ifFalse: [theRegname, 'b'].
- regname := #('%al' '%cl' '%dl' '%bl') at: reg + 1.
constString := const printStringBase: 16 length: 2 padded: true]
ifFalse:
+ [op := 'testq'.
- [op := 'testl'.
regname := theRegname.
+ constString := const printStringBase: 16 length: 16 padded: true].
- constString := const printStringBase: 16 length: 8 padded: true].
self processor
disassembleInstructionAt: 0
In: inst machineCode object
into: [:str :sz| | plainJane herIntended |
"Convert e.g. '00000000: movl %eax, 0x2(%eax) : 89 40 02' to 'movl %eax, 0x2(%eax)'"
plainJane := self strip: str.
herIntended := op, ' $0x', constString, ', ', regname.
self assert: (plainJane match: herIntended).
self assert: len = sz]]]!
More information about the Vm-dev
mailing list