To begin with you'll need Xcode 9.2 as anything higher compiles it in such a way that it'll break Clover Kext Injection. You'll also need the Command Line Tools to match. Both are linked below.
Once you've got those both downloaded and installed you'll need to build the dependancies to be able to compile the XNU.
Download the script below from afrighetto.
Once downloaded I recommend placing it in a folder in the Documents folder so for example Documents/BuildXNU.
Now open up Terminal and follow these commands.
cd Documents/BuildXNU MACOS_VERSION=10.13.3 ./build-xnu.sh
Now the last part may fail which is fine, no need to worry. It just compiles the vanilla XNU.
Now download the 10.13.3 XNU (xnu-4570.41.2) from the link below.
Download my AMD diff from here,
Now back at Terminal you should be in the XNU folder. To apply the diff to the source run this command replacing the diff path with where you've save it.
patch -p1 < /Path/To/Diff
Now the source is AMD ready. Make any changes you wish but pay attention to osfmk/i386/cpuid.c and osfmk/i386/tsc.c as this is where most of the AMD magic happens.
Once you've done making any changes with Terminal once again in the XNU folder run this to compile the kernel,
sudo make SDKROOT=macosx ARCH_CONFIGS=X86_64 KERNEL_CONFIGS=RELEASE
If successful the built kernel will be in BUILD/obj/RELEASE_X86_64/
If you wan't to build the matching System.kext and Frameworks use the build command,
sudo make SDKROOT=macosx ARCH_CONFIGS=X86_64 KERNEL_CONFIGS=RELEASE install
Installed Operating Systems: Catalina 10.15.4 - Windows 10 Pro (Insider)
CPU: Ryzen 5 3600 Motherboard: MSI MPG X570 Gaming Plus RAM: 16GB DDR4 3200MHz Graphics: ASUS ROG Strix RX560
HDD: 960 EVO 500GB - MX500 250GB - 2TB Seagate - 640GB WDC - 500GB WDC LAN: RTL8111 Sound: HDMI
Other: USB Bluetooth - USB Wireless Mouse and Keyboard Bootloader: OpenCore