Make `prefetchit{0/1}` emit an assembler warning if the operand is not rip-rel
authorNoah Goldstein <goldstein.w.n@gmail.com>
Wed, 1 Feb 2023 05:23:29 +0000 (23:23 -0600)
committerNoah Goldstein <goldstein.w.n@gmail.com>
Wed, 1 Feb 2023 07:26:06 +0000 (01:26 -0600)
commit95e49f5a74c9e79778a62cc58b15875613cf9e59
treec64954b487205458a6e7218a1ea0aa08f479a6b3
parentc05ddc9cbc12b1f2038380f57a16c4ca98c614b7
Make `prefetchit{0/1}` emit an assembler warning if the operand is not rip-rel

Without a rip-rel operand, `prefetchit{0/1}` is a nop. This is a
reasonable mistake for someone to make and is almost certainly not
what they are after.

This matches the same warning in `gas`.

Reviewed By: pengfei

Differential Revision: https://reviews.llvm.org/D142797
llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp
llvm/test/MC/X86/prefetchit-non-rip-op.s [new file with mode: 0644]