Libre RISC-V Mailing list Archives (accessible via public-inbox)
 help / color / Atom feed
From: bugzilla-daemon@libre-soc.org
To: libre-riscv-dev@lists.libre-riscv.org
Subject: [libre-riscv-dev] [Bug 319] POWER9 setting carry (and other) XER flags
Date: Wed, 20 May 2020 04:10:19 +0000
Message-ID: <bug-319-13-alLDlwEJas@https.bugs.libre-soc.org/> (raw)
In-Reply-To: <bug-319-13@https.bugs.libre-soc.org/>

https://bugs.libre-soc.org/show_bug.cgi?id=319

--- Comment #5 from Luke Kenneth Casson Leighton <lkcl@lkcl.net> ---
ah.  right.  ok.  in alu/output_stage.py the Data ok for cr0 and the XER fields
do, ov, ov32, need to be set based on  Rc and OE from the instruction.

CR0                     (if Rc=1)
SO OV OV32             (if OE=1)

this code shows that the op.carry_out field from op decode is Rc

and that op.oe is likewise OE.



carry_32 := result(32) xor a_inv(32) xor b_in(32);
carry_64 := result_with_carry(64);
if e_in.insn_type = OP_ADD then
    if e_in.output_carry = '1' then
       set_carry(v.e, carry_32, carry_64);
    end if;
    if e_in.oe = '1' then
        set_ov(v.e,
               calc_ov(a_inv(63), b_in(63), carry_64, result_with_carry(63)),
               calc_ov(a_inv(31), b_in(31), carry_32, result_with_carry(31)));
    end if;

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
libre-riscv-dev mailing list
libre-riscv-dev@lists.libre-riscv.org
http://lists.libre-riscv.org/mailman/listinfo/libre-riscv-dev

  parent reply index

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-18 11:04 [libre-riscv-dev] [Bug 319] New: " bugzilla-daemon
2020-05-18 11:08 ` [libre-riscv-dev] [Bug 319] " bugzilla-daemon
2020-05-18 11:29 ` bugzilla-daemon
2020-05-18 12:00 ` bugzilla-daemon
2020-05-18 16:13 ` bugzilla-daemon
2020-05-20  4:10 ` bugzilla-daemon [this message]
2020-05-20  4:50 ` bugzilla-daemon
2020-05-20 18:59 ` bugzilla-daemon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-319-13-alLDlwEJas@https.bugs.libre-soc.org/ \
    --to=bugzilla-daemon@libre-soc.org \
    --cc=libre-riscv-dev@lists.libre-riscv.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Libre RISC-V Mailing list Archives (accessible via public-inbox)

Archives are clonable: git clone --mirror https://inbox.libre-soc.org/libre-riscv-dev

Example config snippet for mirrors


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git