[Vm-dev] VM Maker: VMMaker.oscog-eem.1540.mcz

commits at source.squeak.org commits at source.squeak.org
Wed Dec 2 19:41:44 UTC 2015


Eliot Miranda uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-eem.1540.mcz

==================== Summary ====================

Name: VMMaker.oscog-eem.1540
Author: eem
Time: 2 December 2015, 11:35:56.301 am
UUID: 5455d58b-81e7-4a4b-aee0-d4e621ae247a
Ancestors: VMMaker.oscog-eem.1539

Cogit: Fix x64's MoveM64rRd.

Sources: Generate the Squeak3D plugin.

=============== Diff against VMMaker.oscog-eem.1539 ===============

Item was changed:
  ----- Method: CogX64Compiler>>computeMaximumSize (in category 'generate machine code') -----
(excessive size, no diff calculated)

Item was changed:
  ----- Method: CogX64Compiler>>concretizeMoveM64rRd (in category 'generate machine code') -----
  concretizeMoveM64rRd
  	"Will get inlined into concretizeAt: switch."
  	<inline: true>
  	| offset srcReg destReg skip |
  	offset := operands at: 0.
  	srcReg := self concreteRegister: (operands at: 1).
  	destReg := self concreteDPFPRegister: (operands at: 2).
  	machineCode at: 0 put: 16rF3.
  	(srcReg <= 7 and: [destReg <= 7])
  		ifTrue: [skip := 0]
  		ifFalse: [machineCode at: (skip := 1) put: (self rexw: false r: destReg x: 0 b: srcReg)].
  	machineCode
  		at: skip + 1 put: 16r0f;
  		at: skip + 2 put: 16r7e.
  	offset = 0 ifTrue:
  		[(srcReg bitAnd: 6) ~= RSP ifTrue:
  			[machineCode at: skip + 3 put: (self mod: ModRegInd RM: srcReg RO: destReg).
  			 ^machineCodeSize := skip + 4].
  		 (srcReg bitAnd: 7) = RSP ifTrue: "RBP & R13 fall through"
  			[machineCode
  				at: skip + 3 put: (self mod: ModRegInd RM: srcReg RO: destReg);
  				at: skip + 4 put: (self s: SIB1 i: 4 b: srcReg).
  			 ^machineCodeSize := skip + 5]].
  	(self isQuick: offset) ifTrue:
  		[(srcReg bitAnd: 7) ~= RSP ifTrue:
  			[machineCode
  				at: skip + 3 put: (self mod: ModRegRegDisp8 RM: srcReg RO: destReg);
  				at: skip + 4 put: (offset bitAnd: 16rFF).
  			 ^machineCodeSize := skip + 5].
  		 machineCode
  			at: skip + 3 put: (self mod: ModRegRegDisp8 RM: srcReg RO: destReg);
  			at: skip + 4 put: (self s: SIB1 i: 4 b: srcReg);
  			at: skip + 5 put: (offset bitAnd: 16rFF).
  		 ^machineCodeSize := skip + 6].
  	machineCode at: skip + 3 put: (self mod: ModRegRegDisp32 RM: srcReg RO: destReg).
+ 	(srcReg bitAnd: 7) = RSP ifTrue:
- 	(srcReg bitAnd: 6) = RSP ifTrue:
  		[machineCode at: skip + 4 put: (self s: SIB1 i: 4 b: srcReg).
  		 skip := skip + 1].
  	machineCode
  		at: skip + 4 put: (offset bitAnd: 16rFF);
  		at: skip + 5 put: (offset >> 8 bitAnd: 16rFF);
  		at: skip + 6 put: (offset >> 16 bitAnd: 16rFF);
  		at: skip + 7 put: (offset >> 24 bitAnd: 16rFF).
  	^machineCodeSize := skip + 8!

Item was changed:
  ----- Method: CogX64CompilerTests>>testMoveM64rRd (in category 'tests') -----
  testMoveM64rRd
  	"self new testMoveM64rRd"
  	self concreteCompilerClass registersWithNamesDo:
  		[:sreg :srname|
  		self concreteCompilerClass xmmRegistersWithNamesDo:
  			[:dreg :drname|
  			#(0 8 32760) do:
  				[:offset| | inst len |
  				inst := self gen: MoveM64rRd operand: offset operand: sreg operand: dreg.
  				len := inst concretizeAt: 0.
  				self processor
  					disassembleInstructionAt: 0
  					In: inst machineCode object
  					into: [:str :sz| | plainJane herIntended |
  						plainJane := self strip: str.
  						herIntended := 'movq ',
  										(offset = 0
  											ifTrue: ['']
  											ifFalse: ['0x', ((offset printStringBase: 16 length: 16 padded: true) asLowercase)]),
  										'(', srname, '), ', drname.
+ 						"N.B. bochs 2.3.7 gets many cases wrong, e.g.
+ 							movq %ds:(%rax), %xmm8 : F3 44 0F 7E 00
+ 						 is disassembled as
+ 							rep movq %ds:(%rax), %xmm8 : F3 44 0F 7E 00"
+ 						(plainJane beginsWith: 'rep ') ifTrue:
+ 							[plainJane := plainJane allButFirst: 4].
  						self assert: herIntended equals: plainJane.
+ 						self assert: len = sz]]]]
+ 
+ "| them it |
+ them := OrderedCollection new.
+ [(it := CogX64CompilerTests new) testMoveM64rRd]
+ 	on: AssertionFailure, TestResult failure
+ 	do: [:ex| | inst |
+ 		ex class == AssertionFailure
+ 			ifTrue:
+ 				[inst := ex signalerContext receiver.
+ 				it processor
+ 					disassembleInstructionAt: 0
+ 					In: inst machineCode object
+ 					into: [:str :sz| them addLast: (it strip: str)]]
+ 			ifFalse:
+ 				[ResumableTestFailure adoptInstance: ex].
+ 		ex resume].
+ them size"
+ "| them it |
+ them := OrderedCollection new.
+ [(it := CogX64CompilerTests new) testMoveM64rRd]
+ 	on: TestResult failure
+ 	do: [:ex| | ctxt |
+ 		ctxt := ex signalerContext findContextSuchThat: [:c| c selector == #assert:equals:]..
+ 		them addLast: {ctxt tempAt: 1. ctxt tempAt: 2}.
+ 		ResumableTestFailure adoptInstance: ex.
+ 		ex resume].
+ them size"!
- 						self assert: len = sz]]]]!

Item was changed:
  ----- Method: VMMaker class>>generateSqueakCogVMWithInterpreterClass:options: (in category 'confs-support') -----
  generateSqueakCogVMWithInterpreterClass: interpreterClass options: optionsArray
  	^VMMaker
  		generate: interpreterClass
  		and: StackToRegisterMappingCogit
  		with: optionsArray
  		to: (FileDirectory default pathFromURI: self sourceTree, '/src')
  		platformDir: (FileDirectory default pathFromURI: self sourceTree, '/platforms')
  		including:#(	ADPCMCodecPlugin AsynchFilePlugin
+ 					BalloonEnginePlugin B3DAcceleratorPlugin B3DEnginePlugin BMPReadWriterPlugin BitBltSimulation
+ 					BochsIA32Plugin BochsX64Plugin
- 					BalloonEnginePlugin B3DAcceleratorPlugin BMPReadWriterPlugin BitBltSimulation BochsIA32Plugin
  					CameraPlugin CroquetPlugin DSAPlugin DeflatePlugin DropPlugin
  					"FT2Plugin" FFTPlugin FileCopyPlugin FilePlugin FloatArrayPlugin FloatMathPlugin
  					GeniePlugin GdbARMPlugin HostWindowPlugin IA32ABIPlugin ImmX11Plugin InternetConfigPlugin
  					JPEGReadWriter2Plugin JPEGReaderPlugin JoystickTabletPlugin KlattSynthesizerPlugin
  					LargeIntegersPlugin LocalePlugin MIDIPlugin MacMenubarPlugin Matrix2x3Plugin
  					MiscPrimitivePlugin Mpeg3Plugin QuicktimePlugin RePlugin
  					ScratchPlugin SecurityPlugin SerialPlugin SocketPlugin
  					SoundCodecPlugin SoundGenerationPlugin SoundPlugin SqueakSSLPlugin StarSqueakPlugin
  					ThreadedFFIPlugin ThreadedARMFFIPlugin ThreadedIA32FFIPlugin
  					UnicodePlugin UnixAioPlugin UUIDPlugin UnixOSProcessPlugin
  					Win32OSProcessPlugin VMProfileLinuxSupportPlugin VMProfileMacSupportPlugin WeDoPlugin
  					XDisplayControlPlugin)!



More information about the Vm-dev mailing list