I want to add some assembly code asm to the project. I modified Makefile.am and added source+=xx.asm did not take effect. Do I need to modify configure.ac or other files?
246 views
Skip to first unread message
Dongbo Liu
unread,
May 25, 2023, 11:42:05 PM5/25/23
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to WebP Discussion
I want to add some assembly code asm to the project. I modified Makefile.am and added source+=xx.asm did not take effect. Do I need to modify configure.ac or other files?
James Zern
unread,
May 26, 2023, 3:30:15 PM5/26/23
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
I want to add some assembly code asm to the project. I modified Makefile.am and added source+=xx.asm did not take effect. Do I need to modify configure.ac or other files?
In general for this project we prefer using compiler intrinsics, for local testing you can add AM_PROG_AS to configure.ac and rerun ./autogen.sh. You may need to use .s as the file extension to satisfy the default suffix rules.
Dongbo Liu
unread,
May 28, 2023, 10:59:27 PM5/28/23
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to WebP Discussion, James Zern
I add AM_PROG_AS to configure.ac and rerun ./autogen.sh. but it dosen't work, can you show me full code for this? i use nasm to compile .s,like nasm -f elf64 scan.s
Dongbo Liu
unread,
May 28, 2023, 11:01:46 PM5/28/23
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to WebP Discussion, Dongbo Liu, James Zern
some error
scanLast.s: Assembler messages: scanLast.s:1: Error: no such instruction: `uint16_t scanLast(uint16_t* coeffs)' scanLast.s:2: Error: no such instruction: `global scanLast_test' scanLast.s:3: Error: no such instruction: `global bswap' scanLast.s:4: Error: no such instruction: `global scanLast' scanLast.s:6: Error: invalid char '[' beginning operand 2 `[rdi]' scanLast.s:7: Error: too many memory references for `vpxord' scanLast.s:8: Error: too many memory references for `vpabsw' scanLast.s:9: Error: too many memory references for `vpcmpw' scanLast.s:10: Error: too many memory references for `kmovw' scanLast.s:11: Error: no instruction mnemonic suffix given and no register operands; can't size instruction scanLast.s:14: Error: too many memory references for `mov' scanLast.s:15: Error: operand size mismatch for `bswap'
Dongbo Liu
unread,
May 28, 2023, 11:02:20 PM5/28/23
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to WebP Discussion, Dongbo Liu, James Zern
my .s code
;uint16_t scanLast(uint16_t* coeffs);//return cmp with 0 mask
global scanLast_test
global bswap
global scanLast
scanLast:
vmovdqu ymm0, [rdi]
vpxord ymm1, ymm1
vpabsw ymm3, ymm0
vpcmpw k1, ymm1, ymm3, 01b
kmovw eax, k1
;not eax
ret
bswap:
mov rax, rdi
bswap rax
ret
James Zern
unread,
May 31, 2023, 6:49:28 PM5/31/23
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message