This is an archive of the discontinued LLVM Phabricator instance.

[Clang][LoongArch] Add intrinsic for csrrd, csrwr and csrxchg
ClosedPublic

Authored by gonglingqin on Dec 4 2022, 7:45 PM.

Diff Detail

Event Timeline

gonglingqin created this revision.Dec 4 2022, 7:45 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 4 2022, 7:45 PM
gonglingqin requested review of this revision.Dec 4 2022, 7:45 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptDec 4 2022, 7:45 PM
xen0n edited the summary of this revision. (Show Details)Dec 4 2022, 7:48 PM
xen0n added a comment.Dec 4 2022, 7:52 PM

You'll also need the IOCSR intrinsics too for building Linux. Since they're very similar to some of the CSR intrinsics you added here, do you plan to add support for them later here or in a separate follow-up change?

clang/lib/Headers/larchintrin.h
84

Did you actually test this? ;-)

You'll also need the IOCSR intrinsics too for building Linux. Since they're very similar to some of the CSR intrinsics you added here, do you plan to add support for them later here or in a separate follow-up change?

Thanks for your reminding. The IOCSR intrinsics has been implemented and I will submit it later.

clang/lib/Headers/larchintrin.h
84

Thank you for checking, I will modify it.

Address @xen0n's comments.

SixWeining added inline comments.Dec 4 2022, 8:33 PM
clang/lib/Headers/larchintrin.h
67–98

It's better to add testcases for all these macros.

gonglingqin added inline comments.Dec 4 2022, 8:40 PM
clang/lib/Headers/larchintrin.h
67–98

Thanks, I'll add all the macro test cases later.

Add testcases for macros.

This revision is now accepted and ready to land.Dec 6 2022, 4:51 AM