[Vm-dev] VM Maker: VMMaker.oscog-eem.1580.mcz
commits at source.squeak.org
commits at source.squeak.org
Sat Dec 12 07:59:21 UTC 2015
Eliot Miranda uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-eem.1580.mcz
==================== Summary ====================
Name: VMMaker.oscog-eem.1580
Author: eem
Time: 11 December 2015, 11:57:36.639 pm
UUID: 2b856f5e-e0b4-44bb-b23d-07561132f8c8
Ancestors: VMMaker.oscog-eem.1579
x64 Cogit:
Fix some slang translation warnings.
Add a configuration for the Spur Cog 64-bit VM.
Make translateableSubclasses answer only those ISAs for the current wordSize.
Add a Microsoft moniker for ARM to its identifyingPredefinedMacros.
=============== Diff against VMMaker.oscog-eem.1579 ===============
Item was changed:
----- Method: CogARMCompiler class>>identifyingPredefinedMacros (in category 'translation') -----
identifyingPredefinedMacros
+ ^#('__ARM_ARCH__' '__arm__' '__arm32__' 'ARM32' '_M_ARM')!
- ^#('__ARM_ARCH__' '__arm__' '__arm32__' 'ARM32')!
Item was added:
+ ----- Method: CogARMCompiler class>>wordSize (in category 'translation') -----
+ wordSize
+ "This is a 32-bit ISA"
+ ^4!
Item was changed:
----- Method: CogAbstractInstruction class>>translateableSubclasses (in category 'translation') -----
translateableSubclasses
"CogAbstractInstruction translateableSubclasses"
+ ^self subclasses select:
+ [:compilerClass|
+ compilerClass wordSize = Cogit objectMemoryClass wordSize
+ and: [compilerClass identifyingPredefinedMacros notNil]]!
- ^self subclasses select: [:compilerClass| compilerClass identifyingPredefinedMacros notNil]!
Item was added:
+ ----- Method: CogAbstractInstruction class>>wordSize (in category 'translation') -----
+ wordSize
+ "Answer either 4 or 8 depending on the processor's basic architacture."
+ self subclassResponsibility!
Item was added:
+ ----- Method: CogIA32Compiler class>>wordSize (in category 'translation') -----
+ wordSize
+ "This is a 32-bit ISA"
+ ^4!
Item was changed:
----- Method: CogInLineLiteralsX64Compiler>>concretizeArithCwR: (in category 'generate machine code') -----
+ concretizeArithCwR: x64opcode
- concretizeArithCwR: opcode
| value reg |
value := operands at: 0.
reg := self concreteRegister: (operands at: 1).
machineCode
at: 0 put: (self rexR: ConcreteRISCTempReg x: 0 b: ConcreteRISCTempReg);
at: 1 put: 16rB8 + (ConcreteRISCTempReg bitAnd: 7);
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);
at: 6 put: (value >> 32 bitAnd: 16rFF);
at: 7 put: (value >> 40 bitAnd: 16rFF);
at: 8 put: (value >> 48 bitAnd: 16rFF);
at: 9 put: (value >> 56 bitAnd: 16rFF);
+ at: 10 put: (x64opcode = 16r85 "Tst; backwards"
- at: 10 put: (opcode = 16r85 "Tst; backwards"
ifTrue: [self rexR: ConcreteRISCTempReg x: 0 b: reg]
ifFalse: [self rexR: reg x: 0 b: ConcreteRISCTempReg]);
+ at: 11 put: x64opcode;
+ at: 12 put: (x64opcode = 16r85 "Tst; backwards"
- at: 11 put: opcode;
- at: 12 put: (opcode = 16r85 "Tst; backwards"
ifTrue: [self mod: ModReg RM: reg RO: ConcreteRISCTempReg]
ifFalse: [self mod: ModReg RM: ConcreteRISCTempReg RO: reg]).
^machineCodeSize := 13!
Item was added:
+ ----- Method: CogMIPSELCompiler class>>wordSize (in category 'translation') -----
+ wordSize
+ "This is a 32-bit ISA"
+ ^4!
Item was added:
+ ----- Method: CogX64Compiler class>>identifyingPredefinedMacros (in category 'translation') -----
+ identifyingPredefinedMacros
+ ^#('x86_64' '__amd64' '__x86_64' '__amd64__' '__x86_64__' '_M_AMD64' '_M_X64')!
Item was added:
+ ----- Method: CogX64Compiler class>>wordSize (in category 'translation') -----
+ wordSize
+ "This is a 64-bit ISA"
+ ^8!
Item was changed:
----- Method: CogX64Compiler>>concretizeSEE2OpRdRd: (in category 'generate machine code') -----
+ concretizeSEE2OpRdRd: x64opcode
- concretizeSEE2OpRdRd: opCode
"Will get inlined into concretizeAt: switch."
<inline: true>
| regLHS regRHS |
regRHS := self concreteDPFPRegister: (operands at: 0).
regLHS := self concreteDPFPRegister: (operands at: 1).
machineCode
at: 0 put: 16rF2;
at: 1 put: 16r0F;
+ at: 2 put: x64opcode;
- at: 2 put: opCode;
at: 3 put: (self mod: ModReg RM: regRHS RO: regLHS).
^machineCodeSize := 4!
Item was changed:
----- Method: Cogit class>>generateCodeStringForCogitDotC (in category 'translation') -----
generateCodeStringForCogitDotC
+ "Generate a skeletal cogit.c that includes the relevant cogitFOO.c
+ for the appropriate subclasses of CogAbstractInstruction."
- "Generate a skeletal cogit.c that includes the relevant
- cogitFOO.c for each subclass of CogAbstractInstruction."
^String streamContents:
[:s|
s nextPutAll: '/* Automatically generated by\ ' withCRs.
s nextPutAll: (CCodeGenerator monticelloDescriptionFor: self).
s cr; nextPutAll: ' */'.
s cr; cr; nextPut: $#.
+ (CogAbstractInstruction translateableSubclasses sort: [:a :b| a name < b name]) do:
- (CogAbstractInstruction subclasses sort: [:a :b| a name < b name]) do:
[:class |
+ s nextPutAll: 'if '.
+ class identifyingPredefinedMacros
+ do: [:predefinedMacro| s nextPutAll: 'defined('; nextPutAll: predefinedMacro; nextPut: $)]
+ separatedBy: [s nextPutAll: ' || '].
+ s cr; cr; nextPutAll: '# include "'; nextPutAll: class moduleName; nextPutAll: '.c"'.
+ s cr; cr; nextPutAll: '#el'].
- class identifyingPredefinedMacros ifNotNil:
- [:predefinedMacros|
- s nextPutAll: 'if '.
- predefinedMacros
- do: [:predefinedMacro| s nextPutAll: 'defined('; nextPutAll: predefinedMacro; nextPut: $)]
- separatedBy: [s nextPutAll: ' || '].
- s cr; cr; nextPutAll: '# include "'; nextPutAll: class moduleName; nextPutAll: '.c"'.
- s cr; cr; nextPutAll: '#el']].
s nextPutAll: 'se'.
#( 'As yet no Cogit implementation appears to exist for your platform.'
'Consider implementing it, starting by adding a subclass of CogAbstractInstruction.') do:
[:msg| s cr; nextPutAll: '# error '; nextPutAll: msg].
s cr; nextPutAll: '#endif'; cr]!
Item was changed:
----- Method: VMMaker class>>generateAllSpurConfigurations (in category 'configurations') -----
generateAllSpurConfigurations
self generateNewspeakSpurCogVM;
generateNewspeakSpurStackVM;
generateSqueakSpurCogVM;
+ generateSqueakSpurCog64VM;
generateSqueakSpurCogSistaVM;
generateSqueakSpurStackVM;
generateSqueakSpurStack64VM!
Item was changed:
----- Method: VMMaker class>>generateAllSpurConfigurationsUnderVersionControl (in category 'configurations') -----
generateAllSpurConfigurationsUnderVersionControl
self generateNewspeakSpurStackVM;
generateSqueakSpurStackVM;
generateSqueakSpurStack64VM;
generateNewspeakSpurCogVM;
generateSqueakSpurCogVM;
+ generateSqueakSpurCog64VM;
generateSqueakSpurCogSistaVM!
Item was added:
+ ----- Method: VMMaker class>>generateSqueakSpurCog64VM (in category 'configurations') -----
+ generateSqueakSpurCog64VM
+ "No primitives since we can use those for the Cog VM"
+ ^VMMaker
+ generate: CoInterpreter
+ and: StackToRegisterMappingCogit
+ with: #(ObjectMemory Spur64BitCoMemoryManager)
+ to: (FileDirectory default pathFromURI: self sourceTree, '/spur64src')
+ platformDir: (FileDirectory default pathFromURI: self sourceTree, '/platforms')
+ including:#()!
More information about the Vm-dev
mailing list