flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > add all values

Author
Thread Post new topic Reply to topic
Roman



Joined: 21 Apr 2012
Posts: 1994
Roman 03 Aug 2025, 14:43
fasmw 1.73
Code:
macro ffa [xm,a,b] {
movss xmm#xm,[initFilter#.#a]
mulss xmm#xm,[filter#.#b]
} 

ffa 2,a,x,3,b,y,4,c,z
    


I want do auto addss all xmm registers.
and get in end
addss xmm2,xmm3
addss xmm2,xmm4

To do this code:
Code:
xmm2 = a0 * x[0] + a1 * x[1] + a2 * x[2]    
Post 03 Aug 2025, 14:43
View user's profile Send private message Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1994
Roman 03 Aug 2025, 16:31
Code:
macro ffa [xm,a,b] { common xorps xmm7,xmm7
forward
@xmregtt equ xm
movss xmm#xm,[initFilter#.#a]
mulss xmm#xm,[filter#.#b]

common irpv v,@xmregtt \{ addss xmm7,xmm\#\v \}
common irpv v,@xmregtt \{ restore @xmregtt \}
}    
Post 03 Aug 2025, 16:31
View user's profile Send private message Reply with quote
macomics



Joined: 26 Jan 2021
Posts: 1181
Location: Russia
macomics 03 Aug 2025, 20:57
Code:
macro ffa [xm,a,b] { common xorps xmm7,xmm7
forward
movss xmm#xm,[initFilter#.#a]
mulss xmm#xm,[filter#.#b]
forward addss xmm7,xmm#xm
}

macro ffa [xm,a,b] { common xorps xmm7,xmm7
forward
movss xmm#xm,[initFilter#.#a]
mulss xmm#xm,[filter#.#b]
addss xmm7,xmm#xm
}    
Post 03 Aug 2025, 20:57
View user's profile Send private message Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1994
Roman 05 Aug 2025, 11:04
next problem.
Code:
macro xmmul [r,a,b] {
if a eqtype 0
movss xmm#r,xmm#a
else
movss xmm#r,[a]
end if
mulss xmm#r,[b]
}

;in code
.a1 dd 2.0
.prevI dd 0
xmmul 3,.a1,.prevI,4,2,.a1

;fasm error movss xmm3,xmm.a1
I expected movss xmm3,[.a1]
    
Post 05 Aug 2025, 11:04
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.