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

commits at source.squeak.org commits at source.squeak.org
Sat Jan 16 04:39:54 UTC 2016


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

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

Name: VMMaker.oscog-eem.1640
Author: eem
Time: 16 January 2016, 8:38:12.977363 pm
UUID: 5fd87422-b235-4b98-b023-c3be3586cca5
Ancestors: VMMaker.oscog-eem.1639

Spur64-bit Cogit:
Use the same approach for boxed float ops as for SmallFloat ops.

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

Item was added:
+ ----- Method: CogObjectRepresentationFor64BitSpur>>genDoubleArithmetic:preOpCheck: (in category 'primitive generators') -----
+ genDoubleArithmetic: arithmeticOperator preOpCheck: preOpCheckOrNil
+ 	<inline: true>
+ 	^self genFloatArithmetic: arithmeticOperator preOpCheck: preOpCheckOrNil boxed: true!

Item was added:
+ ----- Method: CogObjectRepresentationFor64BitSpur>>genDoubleComparison:invert: (in category 'primitive generators') -----
+ genDoubleComparison: jumpOpcodeGenerator invert: invertComparison
+ 	<inline: true>
+ 	^self genFloatComparison: jumpOpcodeGenerator invert: invertComparison boxed: true!

Item was added:
+ ----- Method: CogObjectRepresentationFor64BitSpur>>genFloatArithmetic:preOpCheck:boxed: (in category 'primitive generators') -----
+ genFloatArithmetic: arithmeticOperator preOpCheck: preOpCheckOrNil boxed: rcvrBoxed
+ 	<var: #preOpCheckOrNil declareC: 'AbstractInstruction *(*preOpCheckOrNil)(int rcvrReg, int argReg)'>
+ 	<inline: false>
+ 	| jumpFailAlloc jumpFailCheck jumpImmediate jumpNotSmallFloat jumpNotSmallInteger jumpNotBoxedFloat doOp |
+ 	<var: #jumpNotSmallInteger type: #'AbstractInstruction *'>
+ 	<var: #jumpNotBoxedFloat type: #'AbstractInstruction *'>
+ 	<var: #jumpNotSmallFloat type: #'AbstractInstruction *'>
+ 	<var: #jumpImmediate type: #'AbstractInstruction *'>
+ 	<var: #jumpFailCheck type: #'AbstractInstruction *'>
+ 	<var: #jumpFailAlloc type: #'AbstractInstruction *'>
+ 	<var: #doOp type: #'AbstractInstruction *'>
+ 	cogit genLoadArgAtDepth: 0 into: Arg0Reg.
+ 	rcvrBoxed
+ 		ifTrue: [self genGetDoubleValueOf: ReceiverResultReg into: DPFPReg0]
+ 		ifFalse: [self genGetSmallFloatValueOf: ReceiverResultReg scratch: TempReg into: DPFPReg0].
+ 	cogit
+ 		MoveR: Arg0Reg R: ClassReg;
+ 		AndCq: objectMemory tagMask R: ClassReg;
+ 		CmpCq: objectMemory smallFloatTag R: ClassReg.
+ 	jumpNotSmallFloat := cogit JumpNonZero: 0.
+ 	self genGetSmallFloatValueOf: Arg0Reg scratch: TempReg into: DPFPReg1.
+ 	doOp := cogit Label.
+ 	preOpCheckOrNil ifNotNil:
+ 		[jumpFailCheck := cogit perform: preOpCheckOrNil with: DPFPReg0 with: DPFPReg1].
+ 	cogit gen: arithmeticOperator operand: DPFPReg1 operand: DPFPReg0.
+ 	jumpFailAlloc := self genAllocFloatValue: DPFPReg0 into: SendNumArgsReg scratchReg: ClassReg scratchReg: TempReg.
+ 	cogit MoveR: SendNumArgsReg R: ReceiverResultReg.
+ 	cogit genPrimReturn.
+ 	jumpNotSmallFloat jmpTarget:
+ 	(cogit CmpCq: objectMemory smallIntegerTag R: ClassReg).
+ 	jumpNotSmallInteger := cogit JumpNonZero: 0.
+ 	cogit MoveR: Arg0Reg R: Arg1Reg.
+ 	self genConvertSmallIntegerToIntegerInReg: Arg1Reg.
+ 	cogit ConvertR: Arg1Reg Rd: DPFPReg1.
+ 	cogit Jump: doOp.
+ 	jumpNotSmallInteger jmpTarget: (cogit CmpCq: 0 R: ClassReg).
+ 	jumpImmediate := cogit JumpNonZero: 0.
+ 	self genGetCompactClassIndexNonImmOf: Arg0Reg into: SendNumArgsReg.
+ 	self genCmpClassFloatCompactIndexR: SendNumArgsReg.
+ 	jumpNotBoxedFloat := cogit JumpNonZero: 0.
+ 	self genGetDoubleValueOf: Arg0Reg into: DPFPReg1.
+ 	cogit Jump: doOp.
+ 	jumpImmediate jmpTarget:
+ 	(jumpNotBoxedFloat jmpTarget:
+ 	(jumpNotSmallInteger jmpTarget:
+ 	(jumpFailAlloc jmpTarget: cogit Label))).
+ 	preOpCheckOrNil ifNotNil:
+ 		[jumpFailCheck jmpTarget: jumpFailAlloc getJmpTarget].
+ 	^0!

Item was added:
+ ----- Method: CogObjectRepresentationFor64BitSpur>>genFloatComparison:invert:boxed: (in category 'primitive generators') -----
+ genFloatComparison: jumpOpcodeGenerator invert: invertComparison boxed: rcvrBoxed
+ 	<var: #jumpOpcodeGenerator declareC: 'AbstractInstruction *(*jumpOpcodeGenerator)(void *)'>
+ 	<inline: false>
+ 	| jumpImmediate jumpNotSmallFloat jumpNotSmallInteger jumpNotBoxedFloat jumpCond compare |
+ 	<var: #jumpNotSmallInteger type: #'AbstractInstruction *'>
+ 	<var: #jumpNotBoxedFloat type: #'AbstractInstruction *'>
+ 	<var: #jumpNotSmallFloat type: #'AbstractInstruction *'>
+ 	<var: #jumpImmediate type: #'AbstractInstruction *'>
+ 	<var: #jumpCond type: #'AbstractInstruction *'>
+ 	cogit genLoadArgAtDepth: 0 into: Arg0Reg.
+ 	rcvrBoxed
+ 		ifTrue: [self genGetDoubleValueOf: ReceiverResultReg into: DPFPReg0]
+ 		ifFalse: [self genGetSmallFloatValueOf: ReceiverResultReg scratch: TempReg into: DPFPReg0].
+ 	cogit
+ 		MoveR: Arg0Reg R: ClassReg;
+ 		AndCq: objectMemory tagMask R: ClassReg;
+ 		CmpCq: objectMemory smallFloatTag R: ClassReg.
+ 	jumpNotSmallFloat := cogit JumpNonZero: 0.
+ 	self genGetSmallFloatValueOf: Arg0Reg scratch: TempReg into: DPFPReg1.
+ 	compare := invertComparison "May need to invert for NaNs"
+ 					ifTrue: [cogit CmpRd: DPFPReg0 Rd: DPFPReg1]
+ 					ifFalse: [cogit CmpRd: DPFPReg1 Rd: DPFPReg0].
+ 	jumpCond := cogit perform: jumpOpcodeGenerator with: 0. "FP jumps are a little weird"
+ 	cogit genMoveFalseR: ReceiverResultReg.
+ 	cogit genPrimReturn.
+ 	jumpCond jmpTarget: (cogit genMoveTrueR: ReceiverResultReg).
+ 	cogit genPrimReturn.
+ 	jumpNotSmallFloat jmpTarget:
+ 	(cogit CmpCq: objectMemory smallIntegerTag R: ClassReg).
+ 	jumpNotSmallInteger := cogit JumpNonZero: 0.
+ 	self genConvertSmallIntegerToIntegerInReg: Arg0Reg.
+ 	cogit ConvertR: Arg0Reg Rd: DPFPReg1.
+ 	cogit Jump: compare.
+ 	jumpNotSmallInteger jmpTarget: (cogit CmpCq: 0 R: ClassReg).
+ 	jumpImmediate := cogit JumpNonZero: 0.
+ 	self genGetCompactClassIndexNonImmOf: Arg0Reg into: SendNumArgsReg.
+ 	self genCmpClassFloatCompactIndexR: SendNumArgsReg.
+ 	jumpNotBoxedFloat := cogit JumpNonZero: 0.
+ 	self genGetDoubleValueOf: Arg0Reg into: DPFPReg1.
+ 	cogit Jump: compare.
+ 	jumpImmediate jmpTarget:
+ 	(jumpNotBoxedFloat jmpTarget: cogit Label).
+ 	^CompletePrimitive!

Item was changed:
  ----- Method: CogObjectRepresentationFor64BitSpur>>genSmallFloatArithmetic:preOpCheck: (in category 'primitive generators') -----
  genSmallFloatArithmetic: arithmeticOperator preOpCheck: preOpCheckOrNil
+ 	<inline: true>
+ 	^self genFloatArithmetic: arithmeticOperator preOpCheck: preOpCheckOrNil boxed: false!
- 	<var: #preOpCheckOrNil declareC: 'AbstractInstruction *(*preOpCheckOrNil)(int rcvrReg, int argReg)'>
- 	| jumpFailAlloc jumpFailCheck jumpImmediate jumpNotSmallFloat jumpNotSmallInteger jumpNotBoxedFloat doOp |
- 	<var: #jumpNotSmallInteger type: #'AbstractInstruction *'>
- 	<var: #jumpNotBoxedFloat type: #'AbstractInstruction *'>
- 	<var: #jumpNotSmallFloat type: #'AbstractInstruction *'>
- 	<var: #jumpImmediate type: #'AbstractInstruction *'>
- 	<var: #jumpFailCheck type: #'AbstractInstruction *'>
- 	<var: #jumpFailAlloc type: #'AbstractInstruction *'>
- 	<var: #doOp type: #'AbstractInstruction *'>
- 	cogit genLoadArgAtDepth: 0 into: Arg0Reg.
- 	self genGetSmallFloatValueOf: ReceiverResultReg scratch: TempReg into: DPFPReg0.
- 	cogit
- 		MoveR: Arg0Reg R: ClassReg;
- 		AndCq: objectMemory tagMask R: ClassReg;
- 		CmpCq: objectMemory smallFloatTag R: ClassReg.
- 	jumpNotSmallFloat := cogit JumpNonZero: 0.
- 	self genGetSmallFloatValueOf: Arg0Reg scratch: TempReg into: DPFPReg1.
- 	doOp := cogit Label.
- 	preOpCheckOrNil ifNotNil:
- 		[jumpFailCheck := cogit perform: preOpCheckOrNil with: DPFPReg0 with: DPFPReg1].
- 	cogit gen: arithmeticOperator operand: DPFPReg1 operand: DPFPReg0.
- 	jumpFailAlloc := self genAllocFloatValue: DPFPReg0 into: SendNumArgsReg scratchReg: ClassReg scratchReg: TempReg.
- 	cogit MoveR: SendNumArgsReg R: ReceiverResultReg.
- 	cogit genPrimReturn.
- 	jumpNotSmallFloat jmpTarget:
- 	(cogit CmpCq: objectMemory smallIntegerTag R: ClassReg).
- 	jumpNotSmallInteger := cogit JumpNonZero: 0.
- 	cogit MoveR: Arg0Reg R: Arg1Reg.
- 	self genConvertSmallIntegerToIntegerInReg: Arg1Reg.
- 	cogit ConvertR: Arg1Reg Rd: DPFPReg1.
- 	cogit Jump: doOp.
- 	jumpNotSmallInteger jmpTarget: (cogit CmpCq: 0 R: ClassReg).
- 	jumpImmediate := cogit JumpNonZero: 0.
- 	self genGetCompactClassIndexNonImmOf: Arg0Reg into: SendNumArgsReg.
- 	self genCmpClassFloatCompactIndexR: SendNumArgsReg.
- 	jumpNotBoxedFloat := cogit JumpNonZero: 0.
- 	self genGetDoubleValueOf: Arg0Reg into: DPFPReg1.
- 	cogit Jump: doOp.
- 	jumpImmediate jmpTarget:
- 	(jumpNotBoxedFloat jmpTarget:
- 	(jumpNotSmallInteger jmpTarget:
- 	(jumpFailAlloc jmpTarget: cogit Label))).
- 	preOpCheckOrNil ifNotNil:
- 		[jumpFailCheck jmpTarget: jumpFailAlloc getJmpTarget].
- 	^0!

Item was changed:
  ----- Method: CogObjectRepresentationFor64BitSpur>>genSmallFloatComparison:invert: (in category 'primitive generators') -----
  genSmallFloatComparison: jumpOpcodeGenerator invert: invertComparison
+ 	<inline: true>
+ 	^self genFloatComparison: jumpOpcodeGenerator invert: invertComparison boxed: false!
- 	<var: #jumpOpcodeGenerator declareC: 'AbstractInstruction *(*jumpOpcodeGenerator)(void *)'>
- 	| jumpImmediate jumpNotSmallFloat jumpNotSmallInteger jumpNotBoxedFloat jumpCond compare |
- 	<var: #jumpNotSmallInteger type: #'AbstractInstruction *'>
- 	<var: #jumpNotBoxedFloat type: #'AbstractInstruction *'>
- 	<var: #jumpNotSmallFloat type: #'AbstractInstruction *'>
- 	<var: #jumpImmediate type: #'AbstractInstruction *'>
- 	<var: #jumpCond type: #'AbstractInstruction *'>
- 	cogit genLoadArgAtDepth: 0 into: Arg0Reg.
- 	self genGetSmallFloatValueOf: ReceiverResultReg scratch: TempReg into: DPFPReg0.
- 	cogit
- 		MoveR: Arg0Reg R: ClassReg;
- 		AndCq: objectMemory tagMask R: ClassReg;
- 		CmpCq: objectMemory smallFloatTag R: ClassReg.
- 	jumpNotSmallFloat := cogit JumpNonZero: 0.
- 	self genGetSmallFloatValueOf: Arg0Reg scratch: TempReg into: DPFPReg1.
- 	compare := invertComparison "May need to invert for NaNs"
- 					ifTrue: [cogit CmpRd: DPFPReg0 Rd: DPFPReg1]
- 					ifFalse: [cogit CmpRd: DPFPReg1 Rd: DPFPReg0].
- 	jumpCond := cogit perform: jumpOpcodeGenerator with: 0. "FP jumps are a little weird"
- 	cogit genMoveFalseR: ReceiverResultReg.
- 	cogit genPrimReturn.
- 	jumpCond jmpTarget: (cogit genMoveTrueR: ReceiverResultReg).
- 	cogit genPrimReturn.
- 	jumpNotSmallFloat jmpTarget:
- 	(cogit CmpCq: objectMemory smallIntegerTag R: ClassReg).
- 	jumpNotSmallInteger := cogit JumpNonZero: 0.
- 	self genConvertSmallIntegerToIntegerInReg: Arg0Reg.
- 	cogit ConvertR: Arg0Reg Rd: DPFPReg1.
- 	cogit Jump: compare.
- 	jumpNotSmallInteger jmpTarget: (cogit CmpCq: 0 R: ClassReg).
- 	jumpImmediate := cogit JumpNonZero: 0.
- 	self genGetCompactClassIndexNonImmOf: Arg0Reg into: SendNumArgsReg.
- 	self genCmpClassFloatCompactIndexR: SendNumArgsReg.
- 	jumpNotBoxedFloat := cogit JumpNonZero: 0.
- 	self genGetDoubleValueOf: Arg0Reg into: DPFPReg1.
- 	cogit Jump: compare.
- 	jumpImmediate jmpTarget:
- 	(jumpNotBoxedFloat jmpTarget: cogit Label).
- 	^CompletePrimitive!



More information about the Vm-dev mailing list