Class LayoutR5,R2 MOV R6,R3 BL _Z9terminateP2HRP6Salary MOV R1,R5 MOV R0,R4 BL _Z9terminateP2HRP6Hourly MOV R1,R6 MOV R0,R4 POP {R4‐R6,LR} B _Z9terminateP2HRP4Temp R2 MOV R6,R3 BL _ZN2HR9terminateEP6Salary MOV R1,R5 MOV R0,R4 BL _ZN2HR9terminateEP6Hourly MOV R1,R6 MOV R0,R4 POP {R4‐R6,LR} B _ZN2HR9terminateEP4Temp into "this" register LDR R1,[R4, #+0] # get bp‐>vptr LDR R1,[R1, #+0] # get vptr[0] (member function address) MOV LR,PC # set return link BX R1 # call member function0 码力 | 51 页 | 461.37 KB | 6 月前3
C++ Exceptions for Smaller Firmware828c <__cxa_allocate_exception> 8014: 2305 movs r3, #5 8016: 4902 ldr r1, [pc, #8] 8018: 6003 str r3, [r0, #0] 801a: 2200 movs r2, #0 801c: Additional parameters will be passed on the stack if the inputs exceed what can be passed in the registers R1 R2 R3 R4 Preserved Registers: Must be restored before a subroutine returns. On function entry: Needed 0x3FD0 obj[2/3] 0x3FCC obj[3/3] 0x3FC8 bar()+14 0x3FC4 [bar] r4 Virtual ARM CPU Reg Value R0 XXXX R1 XXXX R2 XXXX R3 XXXX R4 ? R5 ? R6 – R7 – R8 – R9 – R10 – R11 – R12 – R13/SP ? R14/LR0 码力 | 237 页 | 6.74 MB | 6 月前3
A Relaxed Guide to memory_order_relaxedlocations. ● r1 and r2 denote (not-address-taken) locals (“registers”). ● All shared locations are presumed to be initially zero, null, or false, unless stated otherwise. ● r1 =rlx x abbreviates r1 = x.l =rlx r1 abbreviates x.store(r1, std::memory_order_relaxed) Notation and conventionsProprietary + Confidential atomicx(0), y(0); Must be allowed // y = x; int r1 =rlx x; y =rlx r1; // 1: Thread 2: 7 r1 = r2 = 42 is fine! reads from reads fromProprietary + Confidential atomic x(0), y(0); OOTA: Should be disallowed // y = x; int r1 =rlx x; y =rlx r1; // x = y; int 0 码力 | 32 页 | 278.53 KB | 6 月前3
Lifetime Safety in C++: Past, Present and FutureType Systems for Memory Safety (borretti.me) let num = 5; let r1 = &num as *const i32; let r2 = # unsafe { println!("r1 is: {}", *r1); println!("r2 is: {}", r2); }Building a safe subset from scratch Type Systems for Memory Safety (borretti.me) let num = 5; let r1 = &num as *const i32; let r2 = # unsafe { println!("r1 is: {}", *r1); println!("r2 is: {}", r2); }Building a safe subset from scratch Type Systems for Memory Safety (borretti.me) let num = 5; let r1 = &num as *const i32; let r2 = # unsafe { println!("r1 is: {}", *r1); println!("r2 is: {}", r2); }Building a safe subset from scratch0 码力 | 124 页 | 2.03 MB | 6 月前3
Thinking Functionally In C++typename R1> using MappingFunction = R1 (*)(const T1&); templateR1> std::vector<R1> Map(const std::vector sourceList, MappingFunction R1> mappingFunc) { std::vector<R1> mappedList; typename R1> using MappingFunction = R1 (*)(const T1&); template R1> std::vector<R1> Map(const std::vector sourceList, MappingFunction R1> mappingFunc) { std::vector<R1> mappedList; typename R1> using MappingFunction = R1 (*)(const T1&); template R1> std::vector<R1> Map(const std::vector sourceList, MappingFunction R1> mappingFunc) { std::vector<R1> mappedList; 0 码力 | 114 页 | 3.14 MB | 6 月前3
Adventures in SIMD Thinking (Part 1 of 2)rf_512 r) { _mm512_mask_storeu_ps(pdst, (__mmask16) 0xFFFFu, r); } r0 r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 r13 r14 r15 r0 r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 r13 r14 r15 r pdst pdstCopyright 0 0 1 1 0 0 1 1 0 0 0 0 1 1 1 1 m0 m1 r2 r3 m4 m5 r6 r7 m8 m9 m10 m11 r12 r13 r14 r15 r mask r0 r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 r13 r14 r15 pdst pdstCopyright © 2020 Bob Steagall K E W B C _mm512_permutexvar_ps(perm, r); } r0 r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 r13 r14 r15 r 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 perm r15 r14 r13 r12 r11 r10 r9 r8 r7 r6 r5 r4 r3 r2 r1 r0Copyright © 2020 Bob Steagall0 码力 | 88 页 | 824.07 KB | 6 月前3
Hidden Overhead of a Function APIv19.40 VS17.10 mov r0, #60 bx lr mov eax, 60 ret mov eax, 60 ret 0 i n t mov r1, #60 str r1, [r0] bx lr mov eax, DWORD PTR [esp+4] mov DWORD PTR [eax], 60 ret 4 mov eax, DWORD v19.40 VS17.10 mov r0, #60 bx lr mov eax, 60 ret mov eax, 60 ret 0 i n t mov r1, #60 str r1, [r0] bx lr mov eax, DWORD PTR [esp+4] mov DWORD PTR [eax], 60 ret 4 mov eax, DWORD VS17.10 mov r0, #60 mov r1, #0 bx lr mov eax, 60 xor edx, edx ret mov eax, 60 xor edx, edx ret 0 i n t mov r1, #0 mov r2, #60 str r2, [r0] str r1, [r0, #4] bx lr mov0 码力 | 158 页 | 2.46 MB | 6 月前3
A Crash Course in Calendars, Dates, Time, and Time Zonesnumber: using r1 = ratio<1, 60>; // Represents 1/60 Retrieve numerator and denominator intmax_t num { r1::num }; intmax_t den { r1::den }; cout << format("r1 = {}/{}", num, den); // r1 = 1/60 It‘s intmax_t d { 60 }; using r1 = ratio; // Error7 Compile-Time Rational Numbers Arithmetic with ratio_add, ratio_subtract, ratio_multiply, and ratio_divide: using r1 = ratio<1, 60>; // 1/60 1/60 using r2 = ratio<1, 30>; // 1/30 using result = ratio_add<r1, r2>::type; cout << format("sum = {}/{}", result::num, result::den);// 1/20 Comparisons with ratio_equal, ratio_not_equal, ratio_less 0 码力 | 43 页 | 551.60 KB | 6 月前3
generic graph librariesn0 | Vdd | R2 nl n2 | Vdd | R0 n2 GND| n2 R1 onut n2_ | Vout | L1 GND| n0 C0 mn2 nl R3 / Structure R0 n2 GND| n2 R1 5 | 2 RO out n2 | Vout | L1 0 15 | R1 GND| n0 C0 n0 | Vdd | R2 工 2 2 nl n2 | Vdd | R0 n2 GND| n2 R1 5 2 3 onut n2_ | Vout | L1 0 15 了 GND| n00 码力 | 76 页 | 6.59 MB | 6 月前3
C++26 Previewviews::iota(0) | views::take_exactly(5); print("{}\n", r0); [0, 1, 2, 3, 4] auto r1 = views::iota(0) | views::drop_exactly(5); print("{}\n", r1 | std::views::take_exactly(5)); [5, 6, 7, 8, 9] 1 2 3 4 5 64still in views::iota(0) | views::take_exactly(5); print("{}\n", r0); [0, 1, 2, 3, 4] auto r1 = views::iota(0) | views::drop_exactly(5); print("{}\n", r1 | std::views::take_exactly(5)); [5, 6, 7, 8, 9] 1 2 3 4 5 auto r0 = views::iota(0) | views::take_exactly(5); print("{}\n", r0); [0, 1, 2, 3, 4] auto r1 = views::iota(0) | views::drop_exactly(5); print("{}\n", r1 | std::views::take_exactly(5)); [5, 6, 7, 8, 9] 1 2 3 4 5 64.1in LEWG0 码力 | 118 页 | 2.02 MB | 6 月前3
共 27 条
- 1
- 2
- 3













