30 October 2020, 16:08 | #1 |
Registered User
Join Date: Jul 2015
Location: The Netherlands
Posts: 3,409
|
68020+ scale factor behaviour?
This is an offshoot of the setting a pixel thread. There was a tiny bit of discussion about compilers and how they selected words vs longwords for operations and chb correctly pointed out that the compiler can't always know whether a result will fit in a word or not and thus could in some circumstances decide to use longwords even if the variable was set to being a word to make sure the result was correct.
This all had to do with using a register as an index (something like move.w d0,0(a0,d1.l)). Made me wonder how the 68020 deals with this if you use the built-in scaling facility. In other words, I wonder what would happen if I do this: Code:
move.w #32767,d0 move.w 0(a0,d0.w*2),d1 |
30 October 2020, 16:55 | #2 |
Registered User
Join Date: Jun 2016
Location: europe
Posts: 1,039
|
d0.w is sign-extended to d0.l (000+ behavior), then scaled.
|
30 October 2020, 17:05 | #3 |
Registered User
Join Date: Jul 2015
Location: The Netherlands
Posts: 3,409
|
Thanks!
I had just finished writing a tiny test program to see for myself and that is indeed what it does |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Relations between Factor 5 and Graftgold? | mc68060 | Retrogaming General Discussion | 43 | 19 September 2018 19:25 |
68030 vs 68020 line-f behaviour | jotd | Coders. Asm / Hardware | 7 | 16 July 2017 20:29 |
Factor 5 | hit | News | 40 | 19 March 2017 15:44 |
Factor 5 dates | Predseda | HOL data problems | 2 | 12 January 2016 12:57 |
What Chips Are What Form Factor | Loedown | support.Hardware | 1 | 17 November 2009 13:17 |
|
|