Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

For datatype : int

The result is as follows :

- FORTRAN SUBROUTINE CALLED...


'- SUBROUTINE :: SEND_CSTRUCT_TO_FORTRAN(CSTRUCT)
'- CSTRUCT%N : 5
'- ARRAY_LOCAL : 0 1 3 4 6
- FORTRAN SUBROUTINE FINISHED...

The assembly code generated is as follows for -O2 optimization :

array_local(i) = array_local(i)**2/array_local(i)+0.5*array_local(i)

50: c5 fa 6f 20 vmovdqu xmm4,XMMWORD PTR [rax]


54: c4 e3 5d 38 40 10 01 vinserti128 ymm0,ymm4,XMMWORD PTR [rax+0x10],0x1
5b: 48 83 c0 20 add rax,0x20
5f: c5 fc 5b c8 vcvtdq2ps ymm1,ymm0

63: c5 f4 59 c2 vmulps ymm0,ymm1,ymm2 <- Optimized MAVX2 operations


67: c5 fc 58 c1 vaddps ymm0,ymm0,ymm1 <- Optimized MAVX2 operations
6b: c5 fe 5b c0 vcvttps2dq ymm0,ymm0 <- Optimized MAVX2 operations

6f: c5 f8 11 40 e0 vmovups XMMWORD PTR [rax-0x20],xmm0

For datatype : double


The result is as follows :

- FORTRAN SUBROUTINE CALLED...


'- SUBROUTINE :: SEND_CSTRUCT_TO_FORTRAN(CSTRUCT)
'- CSTRUCT%N : 5
'- ARRAY_LOCAL : NaN 1.5000000000000000 3.0000000000000000
4.5000000000000000 6.0000000000000000
- FORTRAN SUBROUTINE FINISHED...

The assembly code generated is as follows for -O2 optimization :

array_local(i) = array_local(i)**2/array_local(i)+0.5*array_local(i)
50: c5 f9 10 18 vmovupd xmm3,XMMWORD PTR [rax]
54: c4 e3 65 18 40 10 01 vinsertf128 ymm0,ymm3,XMMWORD PTR [rax+0x10],0x1
5b: 48 83 c0 20 add rax,0x20

5f: c5 fd 59 c8 vmulpd ymm1,ymm0,ymm0 <- Optimized MAVX2 operations


63: c5 f5 5e c8 vdivpd ymm1,ymm1,ymm0 <- Optimized MAVX2 operations
67: c5 fd 59 c2 vmulpd ymm0,ymm0,ymm2 <- Optimized MAVX2 operations
6b: c5 f5 58 c0 vaddpd ymm0,ymm1,ymm0 <- Optimized MAVX2 operations

6f: c5 f8 11 40 e0 vmovups XMMWORD PTR [rax-0x20],xmm0

You might also like