本文整理汇总了C++中ld函数的典型用法代码示例。如果您正苦于以下问题:C++ ld函数的具体用法?C++ ld怎么用?C++ ld使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ld函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: uniSp
// Local utility functions
MDOUBLE pairwiseGammaDistance::giveInitialGuessOfDistance(
const sequence& s1,
const sequence& s2,
const vector<MDOUBLE> * weights,
MDOUBLE* score) const {
uniDistribution ud;
stochasticProcess uniSp(&ud,_sp.getPijAccelerator());
likeDist ld(uniSp);
return (ld.giveDistance(s1,s2,weights,score));
}
示例2: setup_io
static void setup_io()
{
#asm
ld a,84h ;
defb 0d3h; ioi ;
ld (24h),a ;
#endasm
}
示例3: ezPrintPattern
void ezPrintPattern(unsigned char pat, unsigned char x, unsigned char y)
{
pat;
x;
y;
_asm
// Work out first byte 40, 48, 50
ld a, 6(ix)
and #24
ld b, #64 //Never changes form #64
add a,b
ld h,a
// **** first byte in h ***
// Third nybble
ld a, 6(ix)
and #7
add a,a
ld b,a
ld a, 5(ix)
//and #16
rrc a
rrc a
rrc a
rrc a
add a,b
rlc a
rlc a
rlc a
rlc a
ld b,a
// answer in b
// Fourth nybble
ld a,5(ix)
and #15
// answer in a
or b
// second byte in a
ld l,a
// *** second byte in l ***
ld b, #8
ld a, 4(ix) // Print pattern
p_loop:
ld (hl),a
inc h
djnz p_loop
_endasm;
}
示例4: assert_different_registers
void C1_MacroAssembler::unlock_object(Register Rmark, Register Roop, Register Rbox, Label& slow_case) {
assert_different_registers(Rmark, Roop, Rbox);
Label slow_int, done;
Address mark_addr(Roop, oopDesc::mark_offset_in_bytes());
assert(mark_addr.disp() == 0, "cas must take a zero displacement");
if (UseBiasedLocking) {
// Load the object out of the BasicObjectLock.
ld(Roop, BasicObjectLock::obj_offset_in_bytes(), Rbox);
verify_oop(Roop);
biased_locking_exit(CCR0, Roop, R0, done);
}
// Test first it it is a fast recursive unlock.
ld(Rmark, BasicLock::displaced_header_offset_in_bytes(), Rbox);
cmpdi(CCR0, Rmark, 0);
beq(CCR0, done);
if (!UseBiasedLocking) {
// Load object.
ld(Roop, BasicObjectLock::obj_offset_in_bytes(), Rbox);
verify_oop(Roop);
}
// Check if it is still a light weight lock, this is is true if we see
// the stack address of the basicLock in the markOop of the object.
cmpxchgd(/*flag=*/CCR0,
/*current_value=*/R0,
/*compare_value=*/Rbox,
/*exchange_value=*/Rmark,
/*where=*/Roop,
MacroAssembler::MemBarRel,
MacroAssembler::cmpxchgx_hint_release_lock(),
noreg,
&slow_int);
b(done);
bind(slow_int);
b(slow_case); // far
// Done
bind(done);
}
示例5: ExchangeRegs
void ExchangeRegs() {
_asm;
push af
ld a,(_ActiveRegBank)
cpl
ld (_ActiveRegBank),a
pop af
exx
ex af,af
_endasm;
}
示例6: assert
void MethodHandles::jump_from_method_handle(MacroAssembler* _masm, Register method, Register target, Register temp,
bool for_compiler_entry) {
Label L_no_such_method;
assert(method == R19_method, "interpreter calling convention");
assert_different_registers(method, target, temp);
if (!for_compiler_entry && JvmtiExport::can_post_interpreter_events()) {
Label run_compiled_code;
// JVMTI events, such as single-stepping, are implemented partly by avoiding running
// compiled code in threads for which the event is enabled. Check here for
// interp_only_mode if these events CAN be enabled.
__ verify_thread();
__ lwz(temp, in_bytes(JavaThread::interp_only_mode_offset()), R16_thread);
__ cmplwi(CCR0, temp, 0);
__ beq(CCR0, run_compiled_code);
// Null method test is replicated below in compiled case,
// it might be able to address across the verify_thread()
__ cmplwi(CCR0, R19_method, 0);
__ beq(CCR0, L_no_such_method);
__ ld(target, in_bytes(Method::interpreter_entry_offset()), R19_method);
__ mtctr(target);
__ bctr();
__ BIND(run_compiled_code);
}
// Compiled case, either static or fall-through from runtime conditional
__ cmplwi(CCR0, R19_method, 0);
__ beq(CCR0, L_no_such_method);
const ByteSize entry_offset = for_compiler_entry ? Method::from_compiled_offset() :
Method::from_interpreted_offset();
__ ld(target, in_bytes(entry_offset), R19_method);
__ mtctr(target);
__ bctr();
__ bind(L_no_such_method);
assert(StubRoutines::throw_AbstractMethodError_entry() != NULL, "not yet generated!");
__ load_const_optimized(target, StubRoutines::throw_AbstractMethodError_entry());
__ mtctr(target);
__ bctr();
}
示例7: ld
//
// Generate field data. We're not solving any real problem here;
// the only purpose of this is to come up with some numbers that couldn't
// happen by accident, so we can check if the hdf5 I/O is working.
//
// New data is a function of prev_checksum (a vector -- one element per
// level).
// Updates curr_checksum.
//
void
EBRestart::fillData( Vector<LevelData<EBCellFAB>* >& a_ebvector,
int a_nlevs,
int a_ncomps,
const EBRestart::CheckSumVect& a_prev_checksums
)
{
static int g_i;
g_i = 0;
for (int lev=0; lev<a_nlevs; ++lev)
{
LevelData<EBCellFAB>& ld( *a_ebvector[lev] );
DataIterator dit = ld.dataIterator();
for ( dit.begin(); dit.ok(); ++dit )
{
EBCellFAB& ebcf( ld[dit] );
//
// Single-valued cells
//
BaseFab<Real>& singFab(ebcf.getSingleValuedFAB());
for ( int i=0; i<singFab.box().numPts()*a_ncomps; ++i )
{
long x = (i+a_prev_checksums[lev].sum)
% (a_prev_checksums[lev].len_irreg+100);
singFab.dataPtr()[i] = x;
// singFab.dataPtr()[i] = g_i++;
}
//
// Multivalued cells
//
Box box( ld.disjointBoxLayout().get(dit) );
box.grow( ld.ghostVect() );
const IntVectSet& irregIVS( ebcf.getEBISBox().boundaryIVS(box) );
const EBGraph& graph( ebcf.getEBISBox().getEBGraph() );
Vector<Real> multidat( a_ncomps );
const IntVectSet& multiIVS( ebcf.getMultiValuedFAB().getIVS() );
for ( VoFIterator it(irregIVS,graph); it.ok(); ++it )
{
if ( multiIVS.contains( it().gridIndex() ) )
{
for ( int c=0;c<a_ncomps;++c )
{
// multidat[c] = 111000 + g_i++;
multidat[c] = 111000 + g_i++ + 10*c + a_prev_checksums[lev].sum%71;
}
ebcf.assign( &multidat[0], it(), Interval(0,a_ncomps-1) );
}
}
}
}
}
示例8: jni_arg
void InterpreterRuntime::SignatureHandlerGenerator::pass_float() {
Argument jni_arg(jni_offset(), false);
#ifdef _LP64
FloatRegister Rtmp = F0;
__ ldf(FloatRegisterImpl::S, Llocals, Interpreter::local_offset_in_bytes(offset()), Rtmp);
__ store_float_argument(Rtmp, jni_arg);
#else
Register Rtmp = O0;
__ ld(Llocals, Interpreter::local_offset_in_bytes(offset()), Rtmp);
__ store_argument(Rtmp, jni_arg);
#endif
}
示例9: thread_manager_start
void thread_manager_start()
{
#asm
push af
push bc
push de
push hl
push ix
ex af,af
exx
push af
push bc
push de
push hl
push iy
ex af,af
exx
; Now setup the thread table - the main thread is always thread 0
.stack_done
ld ix,_threadbase + threads
ld (ix + thread_pid),0 ; Fake number
ld (ix + thread_priority),1 ; Might as well...
ld (ix + thread_nice),0
ld (ix + thread_flags),130 ; System - cannot exit
ld hl,0
add hl,sp
ld (ix + thread_sp),l ; Store the stack
ld (ix + thread_sp+1),h
ld hl,(_threadbase + scheduler) ; Setup task options
inc hl
inc hl
inc hl
ld c,0 ; Nice adjustment
call l_jphl
ld (_threadbase + current),ix
jp thread_manager_first_entry
EXTERN thread_manager_first_entry
#endasm
}
示例10: ezPlot
// ************************************************
// * Plot black pixel *
// * *
// * x: pixel coord - bounds 0 to 255 *
// * y: pixel coord - bounds 0 tp 191 *
// * *
// ************************************************
void ezPlot(unsigned char x, unsigned char y)
{
x;
y;
_asm
ld hl,(#23563)
ld bc, #4
add hl,bc
ld d,4(ix)
ld c, #8
add hl,bc
ld e,5(ix)
ld a,#0xaf
sub e
ret c
ld e,a
and a
rra
scf
rra
and a
rra
xor e
and #0xf8
xor e
ld h,a
ld a,d
rlca
rlca
rlca
xor e
and #0xc7
xor e
rlca
rlca
ld l,a
ld a,d
and #7
ld b,a
inc b
ld a,#0xfe
loopidge: rrca
djnz loopidge
ld b,#0xff
xor b
ld b,a
ld a,(hl)
or b
ld (hl),a
//ret
_endasm;
}
示例11: ld
void modCalcVlsr::slotLocation() {
LocationDialog ld( this );
if ( ld.exec() == QDialog::Accepted ) {
GeoLocation *newGeo = ld.selectedCity();
if ( newGeo ) {
geoPlace = newGeo;
LocationButton->setText( geoPlace->fullName() );
}
}
slotCompute();
}
示例12: io_read
unsigned char io_read(unsigned char addr) {
io_addr = addr;
__asm
push af
push bc
ld bc, (_io_addr)
in a, (c)
ld (_io_val), a
pop bc
pop af
__endasm;
return io_val;
}
示例13: io_read
byte io_read(byte addr) {
io_addr = addr;
__asm
push af
push bc
ld bc, (_io_addr)
in a, (c)
ld (_io_val), a
pop bc
pop af
__endasm;
return io_val;
}
示例14: vtexchange
void vtexchange(void)
{
/* Swap the pointers over: TRS80 video we switch by copying not
flipping hardware pointers */
uint8_t *v = vtbase[0];
vtbase[0] = vtbase[1];
vtbase[1] = v;
/* The cursor x/y for current tty are stale in the save area
so save them */
vt_save(&ttysave[curtty]);
/* Before we flip the memory */
cursor_off();
/* Swap the buffers over */
__asm
ld hl, #0xf800
ld de, #_vtbackbuf
ld bc, #VT_WIDTH*VT_HEIGHT
exchit:
push bc
ld a, (de) ; Could be optimised but its only 2K
ld c, (hl) ; Probably worth doing eventuallly
ex de, hl
ld (hl), c
ld (de), a
inc hl
inc de
pop bc
dec bc
ld a, b
or c
jr nz, exchit
ret
__endasm;
/* Cursor back */
cursor_on(ttysave[inputtty].cursory, ttysave[inputtty].cursorx);
}
示例15: store
bool
store(Application& app, UpdateList const& apply, LedgerDelta* ldPtr,
OperationResult const* resPtr)
{
LedgerHeader lh(app.getLedgerManager().getCurrentLedgerHeader());
LedgerDelta ld(lh, app.getDatabase(), false);
if (ldPtr == nullptr)
{
ldPtr = &ld;
}
for (auto const& toApply : apply)
{
auto& current = std::get<0>(toApply);
auto& previous = std::get<1>(toApply);
if (current && !previous)
{
current->storeAdd(*ldPtr, app.getDatabase());
}
else if (current && previous)
{
ldPtr->recordEntry(*previous);
current->storeChange(*ldPtr, app.getDatabase());
}
else if (!current && previous)
{
ldPtr->recordEntry(*previous);
previous->storeDelete(*ldPtr, app.getDatabase());
}
else
{
abort();
}
}
OperationResult res;
if (resPtr == nullptr)
{
resPtr = &res;
}
try
{
app.getInvariantManager().checkOnOperationApply({}, *resPtr, *ldPtr);
}
catch (InvariantDoesNotHold&)
{
return false;
}
return true;
}