📄 notes
字号:
There seems to be a problem with exp(double) and our emulator. I haven'tbeen able to track it down yet. This does not occur with the emulatorsupplied by Russell King.I also found one oddity in the emulator. I don't think it is serious butwill point it out. The ARM calling conventions require floating pointregisters f4-f7 to be preserved over a function call. The compiler quiteoften uses an stfe instruction to save f4 on the stack upon entry to afunction, and an ldfe instruction to restore it before returning.I was looking at some code, that calculated a double result, stored it in f4then made a function call. Upon return from the function call the number inf4 had been converted to an extended value in the emulator.This is a side effect of the stfe instruction. The double in f4 had to beconverted to extended, then stored. If an lfm/sfm combination had been used,then no conversion would occur. This has performance considerations. Theresult from the function call and f4 were used in a multiplication. If theemulator sees a multiply of a double and extended, it promotes the double toextended, then does the multiply in extended precision.This code will cause this problem:double x, y, z;z = log(x)/log(y);The result of log(x) (a double) will be calculated, returned in f0, thenmoved to f4 to preserve it over the log(y) call. The division will be donein extended precision, due to the stfe instruction used to save f4 in log(y).
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -