This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

need some help to translate some ARM asm

Note: This was originally posted on 10th August 2011 at http://forums.arm.com

Hi,

I am a C developper and I am trying to understand how works a function defined as shown below  but I have some
difficulties with floating point function and especially with FMULD and FMACD.
I tried to read the documentation but I don't really understand what a vector is so for now I have this :



struct AffineTransform {
  float a, b, c, d;
  float tx, ty;
};

void __cdecl PathMoveToPoint(MutablePath* path, const AffineTransform *m, float x, float y)
{
  ...
__text:00015514                MOV  R4, R0                  ;R4 = path
__text:00015516           FMSR S12, R2                  ;float S12 = x
__text:0001551A           FMSR S14, R3                  ;float S14 = y
__text:0001551E           CMP  R0, #0                  ;if (!path) return;
__text:00015520           BEQ  loc_155E2              ;if (m != null) goto loc_155E2
...
[size="2"]__text:0001552E           FCVTDS  D3, S12              ;double D3 = (double) x
__text:00015532                FCVTDS  D5, S14              ;double D5 = (double) y
__text:00015536           FLDS S14, [R1]              ;float S14 = m->a
__text:0001553A              FCVTDS  D6, S14                ; double D6 = (double) m->a
__text:0001553E           FLDS S14, [R1,#8]        ;float S14 = m->c
__text:00015542                FCVTDS  D7, S14                ;double D7 = (double) m->c
__text:00015546                FMULD   D7, D7, D5          ; ?? DONT UNDERSTAND
__text:0001554A                FMACD   D7, D6, D3          ;?? DONT UNDERSTAND
__text:0001554E           FLDS S12, [R1,#0x10]  ;float S12 = m->tx
__text:00015552                FCVTDS  D6, S12            ;double D6 = (double) m->tx
__text:00015556                FADDD   D4, D7, D6      ; ?? DONT UNDERSTAND
__text:0001555A           FLDS S14, [R1,#4]
__text:0001555E                FCVTDS  D6, S14
__text:00015562           FLDS S14, [R1,#0xC]
[size="2"]__text:00015566           FCVTDS  D7, S14
__text:0001556A                FMULD   D7, D5, D7
__text:0001556E                FMACD   D7, D3, D6
__text:00015572           FLDS S12, [R1,#0x14]
__text:00015576                FCVTDS  D6, S12
__text:0001557A                FADDD   D7, D7, D6
__text:0001557E                FCVTSD  S18, D4
__text:00015582                FCVTSD  S16, D7[/size][/size]

I suppose it's not that complicated I just need an explanation for a C developper.

Thanks
0