Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

[General]: FCOMI/FUCOMI updates comparison flags on unmasked invalid operation

Đang mở Phù hợp với người mới
#72 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
76/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
xml
Lĩnh vực
compilers

Hướng nghiên cứu

Bắt đầu tại data/instruction/FCOMI-FCOMIP-FUCOMI-FUCOMIP.xml, khoảng dòng 123, và kiểm tra operation có thể thực thi dùng chung, bao gồm nhánh stack rỗng và xử lý Compare. Đọc các trang SDM được trích dẫn cùng với source, sau đó xác minh rằng invalid operation không được mask vẫn giữ nguyên ZF/PF/CF, trong khi việc xóa OF/SF/AF và việc ngăn pop vẫn không thay đổi.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Executable specification issue

Problem

The shared executable operation writes ZF/PF/CF before testing whether invalid operation is unmasked. The PDF says those three flags are updated only when the invalid-operation exception is masked. The source and PDF therefore specify different comparison flags for the same inputs.

Concrete case

With x87 enabled and no pending exception, compare signaling NaN 0x7fff8000000000000001 in ST(0) with 1 in ST(1), using FCOMI, control word 0x037e and incoming ZF=PF=CF=0. The source writes all three flags to 1, then suppresses result/pop effects. The PDF implies that the incoming comparison flags remain zero. The shared empty-stack branch also writes the flags before considering the mask.

Expected behavior and references

References use Intel SDM 325462-093, checked on 2026-10-01. PDF page numbers below refer to the combined manual.

Source

Source checked at Intel SDM repository commit b5218b0f1cf512304d4b3cb364433a08fcee47cb.

Suggested correction

Follow the SDM's comparison-flag rule by preserving ZF/PF/CF when invalid operation is unmasked. In the empty-stack branch, write these flags only when IM=1; after Compare, write them only when IE=0 or IM=1. Retain the clearing of OF/SF/AF and the existing pop suppression.

Evidence

On AMD EPYC-Milan under KVM, the unmasked-invalid comparison sets ZF/PF/CF to 1, matching the executable operation.

AI disclosure

Assisted by Codex

Ngôn ngữ chính
HTML
Star
40
Fork
4
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của intel/SDM

Tất cả issue của intel/SDM

Issue tương tự

Thêm issue về Compilers

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.