File: load-store-32.s

package info (click to toggle)
llvm-toolchain-11 1%3A11.0.1-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 995,808 kB
  • sloc: cpp: 4,767,656; ansic: 760,916; asm: 477,436; python: 170,940; objc: 69,804; lisp: 29,914; sh: 23,855; f90: 18,173; pascal: 7,551; perl: 7,471; ml: 5,603; awk: 3,489; makefile: 2,573; xml: 915; cs: 573; fortran: 503; javascript: 452
file content (28 lines) | stat: -rw-r--r-- 1,413 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# RUN: llvm-mc -triple bpfel -filetype=obj -o %t %s
# RUN: llvm-objdump --mattr=+alu32 -d -r %t | FileCheck --check-prefix=CHECK-32 %s
# RUN: llvm-objdump -d -r %t | FileCheck %s

// ======== BPF_LDX Class ========
  w5 = *(u8 *)(r0 + 0)   // BPF_LDX | BPF_B
  w6 = *(u16 *)(r1 + 8)  // BPF_LDX | BPF_H
  w7 = *(u32 *)(r2 + 16) // BPF_LDX | BPF_W
// CHECK-32: 71 05 00 00 00 00 00 00 	w5 = *(u8 *)(r0 + 0)
// CHECK-32: 69 16 08 00 00 00 00 00 	w6 = *(u16 *)(r1 + 8)
// CHECK-32: 61 27 10 00 00 00 00 00 	w7 = *(u32 *)(r2 + 16)
// CHECK: 71 05 00 00 00 00 00 00 	r5 = *(u8 *)(r0 + 0)
// CHECK: 69 16 08 00 00 00 00 00 	r6 = *(u16 *)(r1 + 8)
// CHECK: 61 27 10 00 00 00 00 00 	r7 = *(u32 *)(r2 + 16)

// ======== BPF_STX Class ========
  *(u8 *)(r0 + 0) = w7    // BPF_STX | BPF_B
  *(u16 *)(r1 + 8) = w8   // BPF_STX | BPF_H
  *(u32 *)(r2 + 16) = w9  // BPF_STX | BPF_W
  lock *(u32 *)(r2 + 16) += w9  // BPF_STX | BPF_W | BPF_XADD
// CHECK-32: 73 70 00 00 00 00 00 00 	*(u8 *)(r0 + 0) = w7
// CHECK-32: 6b 81 08 00 00 00 00 00 	*(u16 *)(r1 + 8) = w8
// CHECK-32: 63 92 10 00 00 00 00 00 	*(u32 *)(r2 + 16) = w9
// CHECK-32: c3 92 10 00 00 00 00 00 	lock *(u32 *)(r2 + 16) += w9
// CHECK: 73 70 00 00 00 00 00 00 	*(u8 *)(r0 + 0) = r7
// CHECK: 6b 81 08 00 00 00 00 00 	*(u16 *)(r1 + 8) = r8
// CHECK: 63 92 10 00 00 00 00 00 	*(u32 *)(r2 + 16) = r9
// CHECK: c3 92 10 00 00 00 00 00 	lock *(u32 *)(r2 + 16) += r9