This is an archive of the discontinued LLVM Phabricator instance.

[X86] Add PBNDKB instruction.
ClosedPublic

Authored by FreddyYe on Jul 12 2023, 6:56 PM.

Diff Detail

Event Timeline

FreddyYe created this revision.Jul 12 2023, 6:56 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 12 2023, 6:56 PM
FreddyYe requested review of this revision.Jul 12 2023, 6:56 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 12 2023, 6:56 PM

Is it worth adding an error test to (to x86_errors.s or whatever) if PBNDKB gets used on 32-bit?

pengfei added inline comments.Jul 13 2023, 5:20 AM
llvm/lib/Target/X86/X86InstrSystem.td
433

It defs RAX instead of use.

skan added inline comments.Jul 13 2023, 6:33 AM
llvm/lib/Target/X86/X86InstrSystem.td
434

Doesn't this instruction affect EFLAGS?

Is it worth adding an error test to (to x86_errors.s or whatever) if PBNDKB gets used on 32-bit?

It seems to me we never did before, but not a bad idea to do so.

FreddyYe updated this revision to Diff 540237.Jul 13 2023, 5:28 PM
FreddyYe marked 2 inline comments as done.

Address comments and add test in x86_error.s

llvm/lib/Target/X86/X86InstrSystem.td
433

Good catch!

434

Good catch. Added def EFLAGS.

skan added inline comments.Jul 13 2023, 6:15 PM
llvm/test/MC/Disassembler/X86/pbndkb.txt
3

Remove -x86-asm-syntax=intel

skan added inline comments.Jul 13 2023, 6:24 PM
llvm/lib/Target/X86/X86InstrSystem.td
432–433

I don't know if it would make a difference, but according to SPEC, should we change RAX to EAX?

FreddyYe updated this revision to Diff 540843.Jul 16 2023, 6:47 PM
FreddyYe marked 2 inline comments as done.

Address comment.

llvm/lib/Target/X86/X86InstrSystem.td
432–433

This instruction is 64 bit only valid. So I think it's a typo in SPEC's 'Description' section. And I notice that in 'Operation' section, it used RAX instead.

pengfei accepted this revision.Jul 16 2023, 6:58 PM

LGTM.

This revision is now accepted and ready to land.Jul 16 2023, 6:58 PM
skan accepted this revision.Jul 16 2023, 7:04 PM

LGTM

FreddyYe retitled this revision from Add PBNDKB instruction. to [X86] Add PBNDKB instruction..Jul 17 2023, 4:34 AM
This revision was landed with ongoing or failed builds.Jul 19 2023, 1:15 AM
This revision was automatically updated to reflect the committed changes.