Eliot Miranda uploaded a new version of Cog to project VM Maker: http://source.squeak.org/VMMaker/Cog-eem.379.mcz ==================== Summary ==================== Name: Cog-eem.379 Author: eem Time: 19 December 2019, 1:49:43.062164 pm UUID: c3f3a00f-a83b-48db-a102-28e5ee93ade9 Ancestors: Cog-eem.378 ProcessorAliens: Add missing cresultRegister for BochsX64Alien. Provide a convenient disassemble-to-string method. Make sure that the basic disassembler doesn't duplicate the address. Have reportPrimitiveFailure print the context (regs & inst) if not being printed. Provide missing reg accessors for the PIMS simulator (so it can execute the CmpRR test, even if it passes it for about half the cases). =============== Diff against Cog-eem.378 =============== Item was added: + ----- Method: BochsX64Alien>>cResultRegister (in category 'accessing-abstract') ----- + cResultRegister + ^self rax! Item was added: + ----- Method: CogProcessorAlien>>disassembleFrom:to:in: (in category 'disassembly') ----- + disassembleFrom: startAddress to: endAddress in: memory + ^String streamContents: + [:aStream| + self disassembleFrom: startAddress to: endAddress in: memory on: aStream]! Item was changed: ----- Method: CogProcessorAlien>>disassembleFrom:to:in:on: (in category 'disassembly') ----- disassembleFrom: startAddress to: endAddress in: memory on: aStream | address | address := startAddress. [address < endAddress] whileTrue: [[:size :string| + (string notEmpty and: [string first isDigit]) ifFalse: + [aStream nextPutAll: (address printStringBase: 16 length: 8 padded: true); nextPut: $:; tab; tab]. + aStream nextPutAll: string; cr; flush. - aStream nextPutAll: (address printStringBase: 16 length: 8 padded: true); nextPut: $:; tab; tab; nextPutAll: string; cr; flush. address := address + size] valueWithArguments: (self primitiveDisassembleAt: address inMemory: memory)]! Item was changed: ----- Method: CogProcessorAlien>>reportPrimitiveFailure (in category 'error handling') ----- reportPrimitiveFailure | errorAndLog | errorAndLog := self primitiveErrorAndLog. + (thisContext findContextSuchThat: + [:ctxt| + (ctxt receiver respondsTo: #processor) + and: [ctxt receiver processor == self]]) ifNotNil: + [:ctxt| ctxt receiver provideContextForCurrentInstruction]. self error: 'Error ', errorAndLog first printString, (errorAndLog last ifNil: [''] ifNotNil: [:log| ': ', log])! Item was added: + ----- Method: MIPSDisassembler>>initialize (in category 'initialization') ----- + initialize + pc := 0! Item was added: + ----- Method: MIPSSimulator>>a0 (in category 'registers') ----- + a0 + ^self unsignedRegister: A0! Item was added: + ----- Method: MIPSSimulator>>a0: (in category 'registers') ----- + a0: anInteger + ^self unsignedRegister: A0 put: anInteger! Item was added: + ----- Method: MIPSSimulator>>a1 (in category 'registers') ----- + a1 + ^self unsignedRegister: A1! Item was added: + ----- Method: MIPSSimulator>>a1: (in category 'registers') ----- + a1: anInteger + ^self unsignedRegister: A1 put: anInteger! Item was added: + ----- Method: MIPSSimulator>>a2 (in category 'registers') ----- + a2 + ^self unsignedRegister: A2! Item was added: + ----- Method: MIPSSimulator>>a2: (in category 'registers') ----- + a2: anInteger + ^self unsignedRegister: A2 put: anInteger! Item was added: + ----- Method: MIPSSimulator>>a3 (in category 'registers') ----- + a3 + ^self unsignedRegister: A3! Item was added: + ----- Method: MIPSSimulator>>a3: (in category 'registers') ----- + a3: anInteger + ^self unsignedRegister: A3 put: anInteger! Item was added: + ----- Method: MIPSSimulator>>cResultRegister (in category 'accessing-abstract') ----- + cResultRegister + ^self ra! Item was changed: + ----- Method: MIPSSimulator>>cResultRegister: (in category 'accessing-abstract') ----- + cResultRegister: aValue + ^self ra: aValue! - ----- Method: MIPSSimulator>>cResultRegister: (in category 'processor api') ----- - cResultRegister: cResult - ^self unsignedRegister: V0 put: cResult! Item was added: + ----- Method: MIPSSimulator>>disassembleInstructionAt:In: (in category 'disassembly') ----- + disassembleInstructionAt: index In: memory + ^String streamContents: + [:aStream| | instruction word | + word := memory unsignedLongAt: index + 1. + word printOn: aStream base: 16 nDigits: 8. + aStream space; space. + instruction := MIPSInstruction new value: word. + aStream nextPutAll: (instruction decodeFor: MIPSDisassembler new)]! Item was added: + ----- Method: MIPSSimulator>>gp (in category 'registers') ----- + gp + ^self unsignedRegister: GP! Item was added: + ----- Method: MIPSSimulator>>gp: (in category 'registers') ----- + gp: anInteger + ^self unsignedRegister: GP put: anInteger! Item was added: + ----- Method: MIPSSimulator>>k0 (in category 'registers') ----- + k0 + ^self unsignedRegister: K0! Item was added: + ----- Method: MIPSSimulator>>k0: (in category 'registers') ----- + k0: anInteger + ^self unsignedRegister: K0 put: anInteger! Item was added: + ----- Method: MIPSSimulator>>k1 (in category 'registers') ----- + k1 + ^self unsignedRegister: K1! Item was added: + ----- Method: MIPSSimulator>>k1: (in category 'registers') ----- + k1: anInteger + ^self unsignedRegister: K1 put: anInteger! Item was added: + ----- Method: MIPSSimulator>>registerStateGetters (in category 'registers') ----- + registerStateGetters + ^#(zr at v0 v1 a0 a1 a2 a3 + t0 t1 t2 t3 t4 t5 t6 t7 + s0 s1 s2 s3 s4 s5 s6 s7 + t8 t9 k0 k1 gp sp fp ra)! Item was added: + ----- Method: MIPSSimulator>>registerStateSetters (in category 'registers') ----- + registerStateSetters + ^#(zr: at: v0: v1: a0: a1: a2: a3: + t0: t1: t2: t3: t4: t5: t6: t7: + s0: s1: s2: s3: s4: s5: s6: s7: + t8: t9: k0: k1: gp: sp: fp: ra:)! Item was added: + ----- Method: MIPSSimulator>>s7 (in category 'registers') ----- + s7 + ^self unsignedRegister: S7! Item was added: + ----- Method: MIPSSimulator>>s7: (in category 'registers') ----- + s7: anInteger + ^self unsignedRegister: S7 put: anInteger! Item was added: + ----- Method: MIPSSimulator>>t0 (in category 'registers') ----- + t0 + ^self unsignedRegister: T0! Item was added: + ----- Method: MIPSSimulator>>t0: (in category 'registers') ----- + t0: anInteger + ^self unsignedRegister: T0 put: anInteger! Item was added: + ----- Method: MIPSSimulator>>t1 (in category 'registers') ----- + t1 + ^self unsignedRegister: T1! Item was added: + ----- Method: MIPSSimulator>>t1: (in category 'registers') ----- + t1: anInteger + ^self unsignedRegister: T1 put: anInteger! Item was added: + ----- Method: MIPSSimulator>>t2 (in category 'registers') ----- + t2 + ^self unsignedRegister: T2! Item was added: + ----- Method: MIPSSimulator>>t2: (in category 'registers') ----- + t2: anInteger + ^self unsignedRegister: T2 put: anInteger! Item was added: + ----- Method: MIPSSimulator>>t3 (in category 'registers') ----- + t3 + ^self unsignedRegister: T3! Item was added: + ----- Method: MIPSSimulator>>t3: (in category 'registers') ----- + t3: anInteger + ^self unsignedRegister: T3 put: anInteger! Item was added: + ----- Method: MIPSSimulator>>t4 (in category 'registers') ----- + t4 + ^self unsignedRegister: T4! Item was added: + ----- Method: MIPSSimulator>>t4: (in category 'registers') ----- + t4: anInteger + ^self unsignedRegister: T4 put: anInteger! Item was added: + ----- Method: MIPSSimulator>>t5 (in category 'registers') ----- + t5 + ^self unsignedRegister: T5! Item was added: + ----- Method: MIPSSimulator>>t5: (in category 'registers') ----- + t5: anInteger + ^self unsignedRegister: T5 put: anInteger! Item was added: + ----- Method: MIPSSimulator>>t6 (in category 'registers') ----- + t6 + ^self unsignedRegister: T6! Item was added: + ----- Method: MIPSSimulator>>t6: (in category 'registers') ----- + t6: anInteger + ^self unsignedRegister: T6 put: anInteger! Item was added: + ----- Method: MIPSSimulator>>t7 (in category 'registers') ----- + t7 + ^self unsignedRegister: T7! Item was added: + ----- Method: MIPSSimulator>>t7: (in category 'registers') ----- + t7: anInteger + ^self unsignedRegister: T7 put: anInteger! Item was added: + ----- Method: MIPSSimulator>>t8 (in category 'registers') ----- + t8 + ^self unsignedRegister: T8! Item was added: + ----- Method: MIPSSimulator>>t8: (in category 'registers') ----- + t8: anInteger + ^self unsignedRegister: T8 put: anInteger! Item was added: + ----- Method: MIPSSimulator>>t9: (in category 'registers') ----- + t9: anInteger + ^self unsignedRegister: T9 put: anInteger! Item was added: + ----- Method: MIPSSimulator>>v0 (in category 'registers') ----- + v0 + ^self unsignedRegister: V0! Item was added: + ----- Method: MIPSSimulator>>v0: (in category 'registers') ----- + v0: anInteger + ^self unsignedRegister: V0 put: anInteger! Item was added: + ----- Method: MIPSSimulator>>v1 (in category 'registers') ----- + v1 + ^self unsignedRegister: V1! Item was added: + ----- Method: MIPSSimulator>>v1: (in category 'registers') ----- + v1: anInteger + ^self unsignedRegister: V1 put: anInteger! |
Free forum by Nabble | Edit this page |