![]() |
![]() |
#21 | ||
Registered User
Join Date: Jan 2019
Location: Germany
Posts: 3,462
|
Quote:
Quote:
I can only speculate how the branch cache operates, if you attempt to decypher what the 68060UM provides then it seems like the processor keeps pairs of (logical address, target address) for each branch taken, and performs instruction prefetch from the "target address" if the prefetch address hits the "logical address" in that cache, otherwise performs prefetching in increasing address order. That would very well explain *why* the instruction prefetch could trigger an access error, and why flushing the branch cache helps (or is recommended). The instruction cache itself is a relatively stupid mechanism that sits "upfront the MMU" at the physical side of the bus and buffers instruction fetches issues by the prefetch pipeline sitting at the other end of the MMU. Since the instruction cache is physically indexed (unlike the branch cache), it does not require flushing on "MMU context changes". The MMULib always flushes the branch cache on MMU Context changes, but that is *not* a task switch - a task switch (typically, at least) stays within the same context. I believe it was this chapter in the 68060UM that inspired me to name such objects "MMUContexts". |
||
![]() |
![]() |
#22 | |||
Moderator
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,755
|
Quote:
Quote:
Some languages had a syntax that could distinguish assignment from comparison with the same operator. A simple example would be BASIC, requiring LET, and some dialects could later remove the LET. Other languages need superfluous parentheses around the simplest comparisons to make the distinction. C added further hacky operators, such as += etc. which also deviated from all other languages. a <- a + b reads perfectly well and can be unambiguously interpreted by any interpreter or compiler. I take the CSci route of <insert famous language developer/mathematician>. I can make a language filled with various hacky shorthand combination symbols that makes any reader of just normal code scratch his head. And then some more. And then some more. But I won't, because all code is an expression of thought. I'd much rather that every single language calling itself one, got close to Pseudocode, which is vetted for expressability and readability of these thoughts. We don't want weird dialects anymore, and it wasn't desirable then. Quote:
Back on topic, every language has a way of making a comparison to set condition flags, because that's the only way to create if-statements as here. Turning down CSci languages is the reason for being forced to write the a=a code that expresses no thought, to try to provoke some optimization of some compiler version, to get this unanalyzable clump of Assembly code out that is far from optimized. And that this true also for innumerable obscure C statements that have no root in how a CPU works or how you should express a thought in code. |
|||
![]() |
![]() |
#23 | ||
Registered User
Join Date: Feb 2017
Location: Denmark
Posts: 1,291
|
Quote:
![]() Quote:
I still don't see how the code could cause issues for the CPU? It will decode instructions based on the state of the prediction, and it will either be right or it will "backtrack" and also do the right thing (and lose a couple of cycles). |
||
![]() |
![]() |
#24 | |
bye
Join Date: Jun 2016
Location: Some / Where
Posts: 690
|
Quote:
That evaluates to true, if b > 2a, false otherwise. Last edited by bebbo; 02 November 2023 at 13:35. |
|
![]() |
![]() |
#25 |
ex. demoscener "Bigmama"
Join Date: Jun 2012
Location: Fyn / Denmark
Posts: 1,659
|
|
![]() |
![]() |
#26 | |
Registered User
Join Date: Mar 2018
Location: Hastings, New Zealand
Posts: 2,850
|
Quote:
I call this the 'skipword' instruction. It's used like this:- Code:
tst.w d2 beq.s .zero moveq #5,d0 skipword .zero: moveq #0,d0 .next: It's a tiny optimization that is often swamped by inefficient code elsewhere, but it does work so... In assembler I would probably do something like this instead:- Code:
moveq #5,d0 tst.w d2 bne.s .next moveq #0,d0 .next: |
|
![]() |
![]() |
#27 |
Moderator
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,755
|
Yes. In Pseudocode, a single left arrow symbol is used as the assignment operator. This was present on the keyboard (as character) on some systems in the 1970s, for those languages.
I tried using the corresponding Unicode character here, but it wasn't displayed correctly. Raw HTML is not allowed, e.g. HTML Code:
← The Pascal family uses inc(a,b) which is "increase a by b" (as opposed to "add them and replace a with the result"), and if an operator is a function, a language can allow it to be overridden (a paradigm used widely today to not have to name functions by their object type, but the same could apply for custom types in languages that support them). In other languages used today, a right-arrow is used for conditional deferred execution (and sometimes a few more dissimilar ideas within the same language, which is not ideal). Using this for every statement, i.e. have the result at the end of a chain of manipulations, would make the language work like a CPU does, and make advanced mathematical expressions a chain, reducing any recursion level of expression complexity to a stack level of 1. ("The opposite of LISP".) Last edited by Photon; 03 November 2023 at 19:28. |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Who can help generating an IPF of Andromeda Mission? | apex | Amiga scene | 5 | 25 December 2021 13:34 |
Generating FFP values at compile time | deimos | Coders. C/C++ | 28 | 13 July 2021 21:19 |
Generating an accurate Paula period table | 8bitbubsy | Coders. General | 55 | 07 September 2020 21:04 |
WinUAELoader: generating single game .uae? | Telegattone | support.WinUAE | 1 | 27 December 2016 12:28 |
Software for generating screenshots and videos | Edi (FZ2D) | Retrogaming General Discussion | 5 | 08 April 2010 23:34 |
|
|