search for: carry

Displaying 20 results from an estimated 5522 matches for "carry".

2013 Jun 28
3
[LLVMdev] Question regarding the x86 SBB instruction.
Hi, I have the x86 SBB instruction. how should I represent this in LLVM IR. (as part of a decompiler from binary to LLVM IR) Pre-conditions: %eax = 0xffffffff %edx = 0xffffffff %carry = 1 SBB %eax, %edx // %edx is the destination doing %edx = %edx - (%eax + carry) JC jump_destination1 // If the Carry flag is set, jump to jump_destination1 How do I represent this correctly in LLVM IR? In the above case, the carry flag should be set by the SBB because: %eax + carry ==...
2013 Jun 28
0
[LLVMdev] Question regarding the x86 SBB instruction.
...5:51 AM, James Courtier-Dutton <james.dutton at gmail.com> wrote: > Hi, > > I have the x86 SBB instruction. how should I represent this in LLVM > IR. (as part of a decompiler from binary to LLVM IR) > > Pre-conditions: > %eax = 0xffffffff > %edx = 0xffffffff > %carry = 1 > > SBB %eax, %edx // %edx is the destination doing %edx = %edx - > (%eax + carry) > JC jump_destination1 // If the Carry flag is set, jump to jump_destination1 > > How do I represent this correctly in LLVM IR? > In the above case, the carry flag should be set b...
2016 May 03
3
Reasoning about known bits of the absolute value of a signed integer
I'm trying to reason about how to find certain bit positions of the absolute value of a given integer value. Specifically, I want to know the highest possibly set bit and lowest possibly set bit of the absolute value, in order to find the range between the two. Note that I'm specifically trying to be as conservative as possible. This is what I have so far: If the sign bit of the
2007 Nov 21
3
[LLVMdev] Add/sub with carry; widening multiply
I've been playing around with llvm lately and I was wondering something about the bitcode instructions for basic arithmetic. Is there any plan to provide instructions that perform widening multiply, or add with carry? It might be written as: mulw i32 %lhs %rhs -> i64 ; widening multiply addw i32 %lhs %rhs -> i33 ; widening add addc i32 %lhs, i32 %rhs, i1 %c -> i33 ; add with carry Alternatively, would something like following get reduced to a single multiply and two stores on arch's that support...
2020 Jul 05
8
[RFC] carry-less multiplication instruction
<div> </div><div><div><p>Carry-less multiplication[1] instructions exist (at least optionally) on many architectures: armv8, RISC-V, x86_64, POWER, SPARC, C64x, and possibly more.</p><p>This proposal is to add a <code>llvm.clmul</code> instruction. Or if that is contentious, <code>llvm.experimental....
2009 Oct 13
4
OT: pager pay
Hey folks, I'm trying to compare my small company's policy against other companies out there. We pay 10% of your per-hour salary equivalent per every hour you carry it, whether it goes off or not. So for example someone making $55K/year works out to about $27 / hour (I think), so they'd get $2.70 for every hour they carry the pager outside of regular work hours. We are a company of about 25 people. My old employer Nortel still does it this way : - $27....
2010 Jun 13
2
[LLVMdev] Bignum development
I was able to get the loop to increment from -999 to 0 using IR directly. That got rid of the cmpq. The carry i was after was able to be obtained using the intrinsic @llvm.uadd.with.overflow.i64, however there is no way to add with carry and have it realise that the resulting *carry out* cannot exceed 1. It actually writes the carry to a byte, and then uses logical operations on it, which slows things down...
2020 Jul 09
2
[RFC] carry-less multiplication instruction
05.07.2020, 05:22, "Roman Lebedev" <lebedev.ri at gmail.com>: > On Sun, Jul 5, 2020 at 12:18 PM Shawn Landden via llvm-dev > <llvm-dev at lists.llvm.org> wrote: >>  Carry-less multiplication[1] instructions exist (at least optionally) on many architectures: armv8, RISC-V, x86_64, POWER, SPARC, C64x, and possibly more. >> >>  This proposal is to add a llvm.clmul instruction. Or if that is contentious, llvm.experimental.bitmanip.clmul instruction. It takes...
2020 Mar 02
3
TableGen Instruction class Uses and Defs
Hello LLVM-Dev, I understand that Uses and Defs are for implicit registers. Uses is defined as for using non-operand registers and Defs is defined as for modifying non-operand registers. For example, for compare and compare with carry instructions, is my understanding correct that the instructions should be defined as described below? Considering that the carry flag is part of the status register: Compare - The status register is only listed in the Defs register list since it modifies the status register. Compare with carry - Th...
2012 Nov 09
1
[LLVMdev] Loop carried dependence analysis?
Hi, The DependenceAnalysis pass will find loop-carried dependences. However, it is a conservative analysis and will sometimes suggest there may be more dependences than actually exist. In your example, I expect the analysis is confused for some reason and is returning the default confused response. You could test it using the isConfused() method. Note that the DVEntry::ALL direction is always
2010 Jun 13
0
[LLVMdev] Bignum development
Hi Bill- I think, ideally, the backend would be able to match arbitrary-precision arithmetic to add-with-carry or subtract-with-borrow through i65/i33. That would remove the need for the overflow intrinsics entirely. Alistair On 13 Jun 2010, at 02:27, Bill Hart wrote: > I was able to get the loop to increment from -999 to 0 using IR > directly. That got rid of the cmpq. > > The carry i was a...
2004 Dec 16
8
Calculating required bandwidth
I was posed this question: A T1 set up for voice carries 24 conversations on a circuit that is 1.544 megabits/second. Right? Well, if you set that T1 up to carry data and run a link between two IP networks over it, how many SIP conversations could it be expected to carry? How about IAX? How would one extend this calculation to varying bandwidth circuits and various VOIP protocols (MGCP, SCCP and H323 come to mind)? Rather than asking for a full educati...
2007 Aug 14
1
[LLVMdev] Static functions for APInt
...f the input number has no bits set -1U is + /// returned. + static unsigned int tcLSB(const integerPart *, unsigned int); + static unsigned int tcMSB(const integerPart *, unsigned int); + + /// Negate a bignum in-place. + static void tcNegate(integerPart *, unsigned int); + + /// DST += RHS + CARRY where CARRY is zero or one. Returns the + /// carry flag. + static integerPart tcAdd(integerPart *, const integerPart *, + integerPart carry, unsigned); + + /// DST -= RHS + CARRY where CARRY is zero or one. Returns the + /// carry flag. + static integerPart tcSubtract(integerPart *, co...
2020 Jun 25
2
How to implement load/store for vector predicate register
...nv operations. A vr has 512 bits, and a vpr has 128 bits. vr is used for v16i32, v32i16, v64i8. And a scalar register has 32 bits. If we compare or add two v16i32, a element in vpr has 8 bits. If we compare or add two v64i8, then a element in vpr has 2 bits(one bit for compare flag and one bit for carry flag). A element in vpr contains carry flag and compare flag. We have defined registers and a new type(vpr) for vector predicate registers in backend. Although there is no direct instruction to move vpr to vr or to move vr to vpr, there is a method to work around this. And we have load/store inst...
2008 Sep 08
6
[LLVMdev] adde/addc
My target doesn't support 64 bit arithmetic, so I'd like to supply definitions for adde/addc. The problem is I can't seem to figure out the magic. Here's an example of what I need to generate: # two i64s in r5/r6 and r7/r8 # result in r1/r2, carry in r3 # adde add r2, r6, r8 cmpltu r3, r2, r6 # compute carry # addc add r1, r5, r7 add r1, zero, r3 Is this possible given the current code generation stuff? Is there another approach that I should consider? -Rich
2013 Apr 15
2
[LLVMdev] 64-bit add using 2 32-bit operations, guarantee of stuck together?
I really have to force them to stuck together otherwise the carry will just not work. How about wrapping the 2 instructions in a bundle? Would that be a way? http://llvm.org/docs/CodeGenerator.html#machineinstr-bundles On Mon, Apr 15, 2013 at 5:24 PM, Quentin Colombet <qcolombet at apple.com>wrote: > Hi Francois, > > If you model the effect of...
2017 Jun 27
2
Question about ISD::SUBCARRY
Dear all, a couple of new generic DAG nodes ISD::ADCARRY and ISD::SUBCARRY were recently introduced in https://reviews.llvm.org/D29872 These nodes have three inputs and two outputs, the second output being the "carry". I understand that carry is well defined for ADDCARRY but my question is about SUBCARRY. Some architectures set the "car...
2015 Jul 10
0
[LLVMdev] TSFlags
On 7/10/2015 10:23 AM, Sky Flyer wrote: > Many thanks for your prompt reply. > > I mean, imagine you have 3 bits for condition flags in your instruction > (e.g. overflow, zero, carry set, ...) for conditional executions AND > there is no direct access to the Status Register, is it even possible to > implement such scenario? > There doesn't have to be any explicit status register. You can either create separate instructions for each condition, or have the conditi...
2016 Feb 11
2
Question about loading spilled register with fast register allocator
Hi All, I have a problem with loading spilled register. Let's look at the simple example as follows: Machine IR snippet: ... ADD --> it generates carry. ADDC --> it uses carry. ... The fast register allocator is enabled with "-O0" option and it generates load instruction for one of ADDC's operands spilled between ADD and ADDC. When I eliminates the frame index for the load instruction, the real offset of the frame index is bigge...
2015 Jul 10
3
[LLVMdev] TSFlags
Many thanks for your prompt reply. I mean, imagine you have 3 bits for condition flags in your instruction (e.g. overflow, zero, carry set, ...) for conditional executions AND there is no direct access to the Status Register, is it even possible to implement such scenario? On Fri, Jul 10, 2015 at 4:54 PM, Krzysztof Parzyszek < kparzysz at codeaurora.org> wrote: > On 7/10/2015 9:32 AM, Sky Flyer wrote: > >> &gt...