[Vm-dev] VM Maker: VMMaker.oscog-tpr.1227.mcz

commits at source.squeak.org commits at source.squeak.org
Mon Apr 20 20:48:44 UTC 2015


tim Rowledge uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-tpr.1227.mcz

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

Name: VMMaker.oscog-tpr.1227
Author: tpr
Time: 20 April 2015, 1:47:15.52 pm
UUID: f22ff47a-427a-4a28-bc45-e929f8dff617
Ancestors: VMMaker.oscog-tpr.1226

make pushCw use pc relative values if it can to avoid long constant fabrication

=============== Diff against VMMaker.oscog-tpr.1226 ===============

Item was changed:
  ----- Method: CogARMCompiler>>concretizePushCw (in category 'generate machine code - concretize') -----
  concretizePushCw
  	"Will get inlined into concretizeAt: switch."
  	<inline: true>
+ 	| word  instrOffset |
+ 	word := (operands at: 0) - (address + 8).
+ 	
+ 	self rotateable8bitImmediate: word
+ 		ifTrue: [ :rot :immediate |
+ 			self machineCodeAt: 0 put: (self add: ConcreteIPReg rn: PC imm: immediate ror: rot).
+ 			instrOffset := 4]
+ 		ifFalse: [self rotateable8bitImmediate: word negated
+ 				ifTrue: [ :rot :immediate |
+ 					self machineCodeAt: 0 put: (self sub: ConcreteIPReg rn: PC imm: immediate ror: rot).
+ 					instrOffset := 4]
+ 				ifFalse: [instrOffset := self at: 0 moveCw: word intoR: ConcreteIPReg]].
+ 		self machineCodeAt: instrOffset put: (self pushR: ConcreteIPReg).
+ 	^machineCodeSize := instrOffset +4!
- 	| word instrOffset|
- 	word := operands at: 0.
- 	instrOffset := self at: 0 moveCw: word intoR: ConcreteIPReg.
- 	self machineCodeAt: instrOffset put: (self pushR: ConcreteIPReg).
- 	^machineCodeSize := instrOffset + 4!

Item was added:
+ ----- Method: CogARMCompiler>>isPCRelativeAddress: (in category 'abstract instructions') -----
+ isPCRelativeAddress: operand
+ 	"Provided the receiver's address has been determined we can
+ 	 answer if operand can be accessed via pc-relative addressing."
+ 
+ 	self assert: address notNil.
+ 	^operand between: address + 8 - (1 << 12 - 1) and: address + 8 + (1 << 12 - 1)!

Item was added:
+ ----- Method: CogARMCompiler>>movePCRelative:into: (in category 'abstract instructions') -----
+ movePCRelative: operand into: reg
+ "Load a pc relative value into the register"
+ 	| offset sign |
+ 	offset := operand - address +8.
+ 	sign := offset > 0 ifTrue:[1] ifFalse:[0].
+ 	self ldr: reg rn: PC plus: sign imm: offset abs!

Item was added:
+ ----- Method: CogARMCompiler>>sub:rn:imm:ror: (in category 'ARM convenience instructions') -----
+ sub: destReg rn: srcReg imm: immediate ror: rot
+ "	Remember the ROR is doubled by the cpu so use 30>>1 etc
+ 	SUB destReg, srcReg, #immediate ROR rot"
+ 
+ 	^self type: 1 op: 2 set: 0 rn: srcReg rd: destReg shifterOperand: ((rot>>1) <<8 bitOr: immediate)!



More information about the Vm-dev mailing list