fgettype() test: Skip useless tests (lea/cmp/cmove) if correct filetype was detected

This commit is contained in:
2025-07-27 15:08:07 +02:00
parent 310c199942
commit 0c5bbde4a4

View File

@@ -1326,25 +1326,32 @@ _start:
lea rsi, [rel ftype_dir]
cmp rax, S_IFDIR
cmove rdx, rsi
je .fgettype_cnt
lea rsi, [rel ftype_char]
cmp rax, S_IFCHR
cmove rdx, rsi
je .fgettype_cnt
lea rsi, [rel ftype_blk]
cmp rax, S_IFBLK
cmove rdx, rsi
je .fgettype_cnt
lea rsi, [rel ftype_reg]
cmp rax, S_IFREG
cmove rdx, rsi
je .fgettype_cnt
lea rsi, [rel ftype_fifo]
cmp rax, S_IFIFO
cmove rdx, rsi
je .fgettype_cnt
lea rsi, [rel ftype_link]
cmp rax, S_IFLNK
cmove rdx, rsi
je .fgettype_cnt
lea rsi, [rel ftype_sock]
cmp rax, S_IFSOCK
cmove rdx, rsi
.fgettype_cnt:
lea rdi, [rel fgettypeStr]
lea rsi, [rel file1]
call printf