Page MenuHomeFreeBSD

arm64/disassem.c: add disassembly support crc32
AcceptedPublic

Authored by koliagogsadze_gmail.com on Aug 23 2023, 3:12 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Apr 26, 8:07 PM
Unknown Object (File)
Mon, Apr 22, 3:32 PM
Unknown Object (File)
Sun, Mar 31, 6:41 AM
Unknown Object (File)
Mar 3 2024, 8:38 PM
Unknown Object (File)
Jan 18 2024, 4:32 PM
Unknown Object (File)
Jan 18 2024, 4:27 PM
Unknown Object (File)
Jan 18 2024, 4:13 PM
Unknown Object (File)
Jan 9 2024, 7:50 PM
Subscribers

Details

Reviewers
mhorne
andrew
manu
Summary

Add disassembly support for the following crc32
instructions: crc32b, crc32h, crc32w, crc32x,
crc32cb, crc32ch, crc32cw, crc32cx

Test Plan

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 55428
Build 52317: arc lint + arc unit

Event Timeline

mhorne added inline comments.
sys/arm64/arm64/disassem.c
780–789

I don't think it is a bad choice to add a new type, but it seems to me like these definitions would work with TYPE_01, no?

This revision is now accepted and ready to land.Oct 17 2023, 7:39 PM
  • arm64/disassem.c: change TYPE_06 to TYPE_01 for crc32 insts
This revision now requires review to proceed.Jan 13 2024, 9:22 PM
sys/arm64/arm64/disassem.c
780–789

Yes, you are right for instructions crc32b, crc32h, crc32w, crc32cb, crc32ch, crc32cw we can use TYPE_01,
since pattern looks like this:

CRC32CB (sf == 0 && sz == 00)
CRC32CB <Wd>, <Wn>, <Wm>

CRC32CH (sf == 0 && sz == 01)
CRC32CH <Wd>, <Wn>, <Wm>

CRC32CW (sf == 0 && sz == 10)
CRC32CW <Wd>, <Wn>, <Wm>

So, I changed this to TYPE_01, thanks!

However, for crc32x and crc32cx we can't use TYPE_01, since sf==1, it means 64 bit width register, but in destination register and input register we have to print 32 bit width registers and only for source register we print 64 bit width register:

CRC32CX (sf == 1 && sz == 11)
CRC32CX <Wd>, <Wn>, <Xm>

CRC32X (sf == 1 && sz == 11)
CRC32X <Wd>, <Wn>, <Xm>

Therefore I decided to introduce new type TYPE_06

ref:
https://developer.arm.com/documentation/ddi0602/2023-12/Base-Instructions/CRC32B--CRC32H--CRC32W--CRC32X--CRC32-checksum-

https://developer.arm.com/documentation/ddi0602/2023-12/Base-Instructions/CRC32CB--CRC32CH--CRC32CW--CRC32CX--CRC32C-checksum-

This revision is now accepted and ready to land.Feb 2 2024, 6:49 PM