1 2 3 4 5 6 7 8 9 10 11 | program main vector(integer(8)) v integer(8) i(2) equivalence(v, i) i = [z'0001020304050607', z'08090A0B0C0D0E0F'] print 1, "First vector element:", vec_extract(v, 0) print 1, "Second vector element:", vec_extract(v, 1) 1 format(A, z16.16) end program |
1 2 | First vector element:0001020304050607 Second vector element:08090A0B0C0D0E0F |
1 2 | First vector element:08090A0B0C0D0E0F Second vector element:0001020304050607 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | vector(real(4)) v1, v2, v3, v4 real(4) a(4) v1 = vec_xl(0, [real(4) ::1.0, 2.0, 3.0, 4.0]) call vec_xst(v1, 0, a) print *, 'v1=', a v2 = vec_neg(v1) call vec_xst(v2, 0, a) print *, 'v2=', a !Merge high and low depend on vector element order v3 = vec_mergeh(v1, v2) call vec_xst(v3, 0, a) print *, 'v3=', a v4 = vec_mergel(v1, v2) call vec_xst(v4, 0, a) print *, 'v4=', a end |
1 2 3 4 | v1= 1.000000000 2.000000000 3.000000000 4.000000000 v2= -1.000000000 -2.000000000 -3.000000000 -4.000000000 v3= 1.000000000 -1.000000000 2.000000000 -2.000000000 v4= 3.000000000 -3.000000000 4.000000000 -4.000000000 |
欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) | Powered by Discuz! 7.0.0 |