Click Here
home features news forums classifieds faqs links search
6087 members 
Amiga Q&A /  Free for All /  Emulation /  Gaming / (Latest Posts)
Login

Nickname

Password

Lost Password?

Don't have an account yet?
Register now!

Support Amigaworld.net
Your support is needed and is appreciated as Amigaworld.net is primarily dependent upon the support of its users.
Donate

Menu
Main sections
» Home
» Features
» News
» Forums
» Classifieds
» Links
» Downloads
Extras
» OS4 Zone
» IRC Network
» AmigaWorld Radio
» Newsfeed
» Top Members
» Amiga Dealers
Information
» About Us
» FAQs
» Advertise
» Polls
» Terms of Service
» Search

IRC Channel
Server: irc.amigaworld.net
Ports: 1024,5555, 6665-6669
SSL port: 6697
Channel: #Amigaworld
Channel Policy and Guidelines

Who's Online
25 crawler(s) on-line.
 32 guest(s) on-line.
 3 member(s) on-line.


 Hypex,  pixie,  matthey

You are an anonymous user.
Register Now!
 Hypex:  59 secs ago
 pixie:  1 min ago
 matthey:  4 mins ago
 Karlos:  19 mins ago
 amigakit:  25 mins ago
 kolla:  36 mins ago
 DiscreetFX:  36 mins ago
 deadwood:  1 hr 20 mins ago
 Rob:  1 hr 26 mins ago
 OlafS25:  1 hr 46 mins ago

/  Forum Index
   /  General Technology (No Console Threads)
      /  NEx64T: A New Hope
Register To Post

PosterThread
cdimauro 
NEx64T: A New Hope
Posted on 15-Nov-2023 20:19:51
#1 ]
Elite Member
Joined: 29-Oct-2012
Posts: 3313
From: Germany

The time has now come to show a concrete example of a modern CISC processor, taking as an example a new architecture, NEx64T, which is both a rewrite and an extension of the more emblazoned x86 and x64.

English: https://www.appuntidigitali.it/20820/nex64t-a-new-hope/
Italian: https://www.appuntidigitali.it/20783/nex64t-una-nuova-speranza/

 Status: Offline
Profile     Report this post  
Karlos 
Re: NEx64T: A New Hope
Posted on 15-Nov-2023 20:46:03
#2 ]
Elite Member
Joined: 24-Aug-2003
Posts: 3844
From: As-sassin-aaate! As-sassin-aaate! Ooh! We forgot the ammunition!

@cdimauro

When do we get a simulator?

_________________
Doing stupid things for fun...

 Status: Offline
Profile     Report this post  
cdimauro 
Re: NEx64T: A New Hope
Posted on 16-Nov-2023 5:26:53
#3 ]
Elite Member
Joined: 29-Oct-2012
Posts: 3313
From: Germany

@Karlos

Quote:

Karlos wrote:
@cdimauro

When do we get a simulator?

First I need a compiler, which is the hardest part.

I've took a look at the 68k's LLVM patches (because for many key aspects the structure of my ISA is more similar to our beloved processors family instead of x86/x64), but it's still huge and complex to understand and reuse (more here).

The LLVM Tutorial is very nice and explains a lot of things, showing how to start from the very beginning, but it still requires a lot of time to be "digested" and produce something concrete.

In short: it'll take long to have something usable (my spare time is limited, unfortunately).

 Status: Offline
Profile     Report this post  
Karlos 
Re: NEx64T: A New Hope
Posted on 16-Nov-2023 7:37:31
#4 ]
Elite Member
Joined: 24-Aug-2003
Posts: 3844
From: As-sassin-aaate! As-sassin-aaate! Ooh! We forgot the ammunition!

@cdimauro

Would it not make more sense to start with an assembler? You said it's source compatible with x64, so you could either take an existing one and alter it to emit your object code or alternatively just implement enough of the x64 assembler syntax in python (for simplicity and rapidity) to be able to produce viable object code for execution.

Starting with a compiler and all of its associated complexity is just giving yourself a bigger reason not to.

My MC64K assembler is written in PHP because I didn't fancy spending a month writing it in C++ when I could be writing the interpreter.

Last edited by Karlos on 16-Nov-2023 at 07:39 AM.

_________________
Doing stupid things for fun...

 Status: Offline
Profile     Report this post  
matthey 
Re: NEx64T: A New Hope
Posted on 16-Nov-2023 17:16:50
#5 ]
Super Member
Joined: 14-Mar-2007
Posts: 1852
From: Kansas

@cdimauro
Good introduction. While 68k and x86-64 assembler may look similar and have similar performance potential, encodings are as different as night and day. You just started to scratch the surface of x86-64 encoding hell which may be some of the resistance to change. Anything new should be verified and documented which is an immense task.

https://www.unomaha.edu/college-of-information-science-and-technology/research-labs/_files/enumerating-x86-64-instructions.pdf Quote:

Although the intel/AMD 64-bit instruction set is large, it would seem that there would be a relatively simple / programmatically easy way to generate all of the instructions and from there, or in the process, to determine the number of bytes for each. Come to find out this task is surprisingly difficult. Even as recently as 2016 one could assume that “a formal semantics of the current 64-bit x86 ISA … would be readily available, but one would be wrong. In fact, the only published description of the x86-64 ISA is the Intel manual with over 3,800 pages written in an ad-hoc combination of English and pseudo-code”.

...

Based on the breakout in Table 1, culled from the intel instruction set reference, we add up 822 instruction mnemonics. But Heule et. al. states that the current x86-64 design “contains 981 unique mnemonics and a total of 3,684 instruction variants”. However they do not specify which features are included in their count.


The 68k has a few ways of encoding each instruction while x86-64 has many. The paper above found 923,392,709 possible 6 byte encoding combinations already and an x86-64 instruction can be up to 15 bytes. Figure 1 at the bottom of the paper called "Partial Overview of x86-64 Decoding" gives a nice algorithmic flowchart of the decoding complexity. Then there is different behavior based on different processor state information and modes which is way more complex than it needs to be on x86(-64). It looks like a big mess that grows yet they have managed to keep it working in hardware and don't want to break it despite the growing decoding overhead and deteriorating code density.

 Status: Online!
Profile     Report this post  
cdimauro 
Re: NEx64T: A New Hope
Posted on 17-Nov-2023 6:06:31
#6 ]
Elite Member
Joined: 29-Oct-2012
Posts: 3313
From: Germany

@Karlos

Quote:

Karlos wrote:
@cdimauro

Would it not make more sense to start with an assembler? You said it's source compatible with x64, so you could either take an existing one and alter it to emit your object code or alternatively just implement enough of the x64 assembler syntax in python (for simplicity and rapidity) to be able to produce viable object code for execution.

Starting with a compiler and all of its associated complexity is just giving yourself a bigger reason not to.

My MC64K assembler is written in PHP because I didn't fancy spending a month writing it in C++ when I could be writing the interpreter.

You're right and that was (and still is: I haven't abandoned it) an idea.

The problem is that way I just translate x86/x64 instructions to the NEx64T and... that's it. I use no new features: no new addressing modes (pre/post inc/decrement, no data stride), no new registers (besides two which I've defined to keep compatibility with the "high" 8 bit registers and the more complex addressing modes), no binary/unary instructions using two/one source operand (and the destination), no mem-to-mem instructions.

I could implement a better peophole optimizer (the current one works only on two instructions, essentially) by implementing an assembler, taking a look at blocks of instructions to gain something using at least some new features.

I still have to think about it.


@matthey

Quote:

matthey wrote:
@cdimauro
Good introduction. While 68k and x86-64 assembler may look similar and have similar performance potential, encodings are as different as night and day. You just started to scratch the surface of x86-64 encoding hell which may be some of the resistance to change. Anything new should be verified and documented which is an immense task.

Well, it was already an hard work mapping all x86/x64 instructions to one (or more, in some cases) NEx64T.
Quote:
https://www.unomaha.edu/college-of-information-science-and-technology/research-labs/_files/enumerating-x86-64-instructions.pdf Quote:

Although the intel/AMD 64-bit instruction set is large, it would seem that there would be a relatively simple / programmatically easy way to generate all of the instructions and from there, or in the process, to determine the number of bytes for each. Come to find out this task is surprisingly difficult. Even as recently as 2016 one could assume that “a formal semantics of the current 64-bit x86 ISA … would be readily available, but one would be wrong. In fact, the only published description of the x86-64 ISA is the Intel manual with over 3,800 pages written in an ad-hoc combination of English and pseudo-code”.

...

Based on the breakout in Table 1, culled from the intel instruction set reference, we add up 822 instruction mnemonics. But Heule et. al. states that the current x86-64 design “contains 981 unique mnemonics and a total of 3,684 instruction variants”. However they do not specify which features are included in their count.


The 68k has a few ways of encoding each instruction while x86-64 has many. The paper above found 923,392,709 possible 6 byte encoding combinations already and an x86-64 instruction can be up to 15 bytes. Figure 1 at the bottom of the paper called "Partial Overview of x86-64 Decoding" gives a nice algorithmic flowchart of the decoding complexity. Then there is different behavior based on different processor state information and modes which is way more complex than it needs to be on x86(-64). It looks like a big mess that grows yet they have managed to keep it working in hardware and don't want to break it despite the growing decoding overhead and deteriorating code density.

Great paper, thanks! I think that I'll use as a reference on the next article.

NEx64T doesn't suffer at all of that: it has no prefixes and only some bigger opcodes for extending the functionalities of the base instructions. Plus, instructions are much better grouped / organized.

 Status: Offline
Profile     Report this post  

[ home ][ about us ][ privacy ] [ forums ][ classifieds ] [ links ][ news archive ] [ link to us ][ user account ]
Copyright (C) 2000 - 2019 Amigaworld.net.
Amigaworld.net was originally founded by David Doyle