brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.9 KiB · e1ecd49 Raw
75 lines · plain
1; RUN: llc -O2 -mtriple=hexagon < %s | FileCheck %s2 3; CHECK-DAG: extractu(r{{[0-9]*}},#3,#4)4; CHECK-DAG: extractu(r{{[0-9]*}},#8,#7)5; CHECK-DAG: extractu(r{{[0-9]*}},#8,#16)6 7; C source:8; typedef struct {9;   unsigned x1:3;10;   unsigned x2:7;11;   unsigned x3:8;12;   unsigned x4:12;13;   unsigned x5:2;14; } structx_t;15;16; typedef struct {17;   unsigned y1:4;18;   unsigned y2:3;19;   unsigned y3:9;20;   unsigned y4:8;21;   unsigned y5:8;22; } structy_t;23;24; void foo(structx_t *px, structy_t *py) {25;   px->x1 = py->y1;26;   px->x2 = py->y2;27;   px->x3 = py->y3;28;   px->x4 = py->y4;29;   px->x5 = py->y5;30; }31 32target datalayout = "e-p:32:32:32-i64:64:64-i32:32:32-i16:16:16-i1:32:32-f64:64:64-f32:32:32-v64:64:64-v32:32:32-a0:0-n16:32"33target triple = "hexagon"34 35%struct.structx_t = type { i8, i8, i8, i8 }36%struct.structy_t = type { i8, i8, i8, i8 }37 38define void @foo(ptr nocapture %px, ptr nocapture %py) nounwind {39entry:40  %0 = load i32, ptr %py, align 441  %bf.value = and i32 %0, 742  %1 = load i32, ptr %px, align 443  %2 = and i32 %1, -844  %3 = or i32 %2, %bf.value45  store i32 %3, ptr %px, align 446  %4 = load i32, ptr %py, align 447  %5 = lshr i32 %4, 448  %bf.clear1 = shl nuw nsw i32 %5, 349  %6 = and i32 %bf.clear1, 5650  %7 = and i32 %3, -101751  %8 = or i32 %6, %752  store i32 %8, ptr %px, align 453  %9 = load i32, ptr %py, align 454  %10 = lshr i32 %9, 755  %bf.value4 = shl i32 %10, 1056  %11 = and i32 %bf.value4, 26112057  %12 = and i32 %8, -26208158  %13 = or i32 %12, %1159  store i32 %13, ptr %px, align 460  %14 = load i32, ptr %py, align 461  %15 = lshr i32 %14, 1662  %bf.clear5 = shl i32 %15, 1863  %16 = and i32 %bf.clear5, 6684672064  %17 = and i32 %13, -107348064165  %18 = or i32 %17, %1666  store i32 %18, ptr %px, align 467  %19 = load i32, ptr %py, align 468  %20 = lshr i32 %19, 2469  %21 = shl i32 %20, 3070  %22 = and i32 %18, 6710790371  %23 = or i32 %22, %2172  store i32 %23, ptr %px, align 473  ret void74}75