From: Segher Boessenkool <segher@kernel.crashing.org>
To: Anshuman Khandual <khandual@linux.vnet.ibm.com>
Cc: linuxppc-dev@ozlabs.org, linux-kernel@vger.kernel.org, mikey@neuling.org
Subject: Re: [PATCH V2 2/5] powerpc, perf: Add basic assembly code to read BHRB entries on POWER8
Date: Tue, 16 Apr 2013 19:23:19 +0200 [thread overview]
Message-ID: <AAEA07FE-7530-46D3-B2FC-B3FD8EC2C6E2@kernel.crashing.org> (raw)
In-Reply-To: <1366127650-1952-3-git-send-email-khandual@linux.vnet.ibm.com>
> +/* r3 = n (where n = [0-1023])
> + * The maximum number of BHRB entries supported with PPC_MFBHRBE
> instruction
> + * is 1024. We have limited number of table entries here as POWER8
> implements
> + * 32 BHRB entries.
> + */
> +
> +/* .global read_bhrb */
> +_GLOBAL(read_bhrb)
> + cmpldi r3,1023
This should be 31, since that is the last entry in the table below.
> + bgt 1f
> + ld r4,bhrb_table@got(r2)
> + sldi r3,r3,3
> + add r3,r4,r3
> + mtctr r3
> + bctr
> +1: li r3,0
> + blr
> +
> +#define MFBHRB_TABLE1(n) PPC_MFBHRBE(R3,n); blr
> +#define MFBHRB_TABLE2(n) MFBHRB_TABLE1(n); MFBHRB_TABLE1(n+1)
> +#define MFBHRB_TABLE4(n) MFBHRB_TABLE2(n); MFBHRB_TABLE2(n+2)
> +#define MFBHRB_TABLE8(n) MFBHRB_TABLE4(n); MFBHRB_TABLE4(n+4)
> +#define MFBHRB_TABLE16(n) MFBHRB_TABLE8(n); MFBHRB_TABLE8(n+8)
> +#define MFBHRB_TABLE32(n) MFBHRB_TABLE16(n); MFBHRB_TABLE16(n+16)
> +
> +bhrb_table:
> + MFBHRB_TABLE32(0)
Segher
next prev parent reply other threads:[~2013-04-16 17:22 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-16 15:54 [PATCH V2 0/5] powerpc, perf: BHRB based branch stack enablement on POWER8 Anshuman Khandual
2013-04-16 15:54 ` [PATCH V2 1/5] powerpc, perf: Add new BHRB related instructions " Anshuman Khandual
2013-04-16 15:54 ` [PATCH V2 2/5] powerpc, perf: Add basic assembly code to read BHRB entries " Anshuman Khandual
2013-04-16 17:23 ` Segher Boessenkool [this message]
2013-04-17 4:00 ` Anshuman Khandual
2013-04-16 15:54 ` [PATCH V2 3/5] powerpc, perf: Add new BHRB related generic functions, data and flags Anshuman Khandual
2013-04-16 15:54 ` [PATCH V2 4/5] powerpc, perf: Define BHRB generic functions, data and flags for POWER8 Anshuman Khandual
2013-04-16 15:54 ` [PATCH V2 5/5] powerpc, perf: Enable branch stack sampling framework support with BHRB Anshuman Khandual
2013-04-17 7:08 ` Michael Ellerman
2013-04-17 12:07 ` Anshuman Khandual
2013-04-18 2:58 ` Anshuman Khandual
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=AAEA07FE-7530-46D3-B2FC-B3FD8EC2C6E2@kernel.crashing.org \
--to=segher@kernel.crashing.org \
--cc=khandual@linux.vnet.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=mikey@neuling.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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).