x86 instruction format which takes a single 64-bit immediate

I am attempting to create an instruction which takes a single 64-bit immediate. This doesn’t seem like a thing that would exist already (because who needs an instruction which just takes an immediate?) How might I implement this easily? Perhaps I could use a format which encodes a register, which is then unused?

Thanks for the help.
Gus

I am attempting to create an instruction which takes a single 64-bit immediate. This doesn't seem like a thing that would exist already (because who needs an instruction which just takes an immediate?) How might I implement this easily? Perhaps I could use a format which encodes a register, which is then unused?

Are you trying to create an instruction that will be emitted by the
code generator or do you just want a pseudo instruction that you
can manipulate during the machine passes and then lower to one
or more real instructions.

-Tom

Copy Ii32 in X86InstrFormats.td rename to Ii64 and change Imm32 to Imm64. Instantiate your instruction inheriting from Ii64. Pass RawFrm to the form parameter.

Initial documentation for the encoding system is attached.

x86format.txt (10.8 KB)

Looks like you can use RIi64_NOREX instead of creating Ii64. It already uses Imm64 and doesn’t force REX.w.

Like movabs?

Joerg