Skip to content

Instantly share code, notes, and snippets.

View pftbest's full-sized avatar

Vadzim Dambrouski pftbest

View GitHub Profile
/usr/local/lib/ruby/gems/2.4.0/gems/oga-2.10/lib/oga/xml/element.rb:343:in `split_name': Interrupt
from /usr/local/lib/ruby/gems/2.4.0/gems/oga-2.10/lib/oga/xml/element.rb:70:in `attribute'
from /usr/local/lib/ruby/gems/2.4.0/gems/oga-2.10/lib/oga/xml/element.rb:89:in `get'
from dslite2svd.rb:23:in `block in common_id_prefix'
from /usr/local/lib/ruby/gems/2.4.0/gems/oga-2.10/lib/oga/xml/node_set.rb:56:in `block in each'
from /usr/local/lib/ruby/gems/2.4.0/gems/oga-2.10/lib/oga/xml/node_set.rb:56:in `each'
from /usr/local/lib/ruby/gems/2.4.0/gems/oga-2.10/lib/oga/xml/node_set.rb:56:in `each'
from dslite2svd.rb:22:in `common_id_prefix'
from dslite2svd.rb:120:in `block (4 levels) in <main>'
from /usr/local/lib/ruby/gems/2.4.0/gems/builder-3.2.2/lib/builder/xmlbase.rb:175:in `_nested_structures'
/usr/local/lib/ruby/gems/2.4.0/gems/builder-3.2.2/lib/builder/xchar.rb:111: warning: constant ::Fixnum is deprecated
dslite2svd.rb:160:in `block (10 levels) in <main>': Unexpected non-empty resetval in #<Oga::XML::Element:0x007fbf0f55b790> (RuntimeError)
from /usr/local/lib/ruby/gems/2.4.0/gems/builder-3.2.2/lib/builder/xmlbase.rb:175:in `_nested_structures'
from /usr/local/lib/ruby/gems/2.4.0/gems/builder-3.2.2/lib/builder/xmlbase.rb:68:in `tag!'
from /usr/local/lib/ruby/gems/2.4.0/gems/builder-3.2.2/lib/builder/xmlbase.rb:93:in `method_missing'
from dslite2svd.rb:150:in `block (9 levels) in <main>'
from /usr/local/lib/ruby/gems/2.4.0/gems/oga-2.10/lib/oga/xml/node_set.rb:56:in `block in each'
from /usr/local/lib/ruby/gems/2.4.0/gems/oga-2.10/lib/oga/xml/node_set.rb:56:in `each'
from /usr/local/lib/ruby/gems/2.4.0/gems/oga-2.10/lib/oga/xml/node_set.rb:56:in `each'
from dslite2svd.rb:149:in `block (8 levels) in <main>'
From b239677c8dd4a574ab7407a4a2539d3f15857c91 Mon Sep 17 00:00:00 2001
From: Vadzim Dambrouski <vadzim.dambrouski@promwad.com>
Date: Thu, 18 May 2017 20:51:55 +0300
Subject: [PATCH] [MSP430] Add subtarget features for hardware multiplier.
---
lib/Target/MSP430/MSP430.td | 15 ++++++++++++++-
lib/Target/MSP430/MSP430ISelLowering.cpp | 27 +++------------------------
lib/Target/MSP430/MSP430Subtarget.cpp | 27 ++++++++++++++++++++++++++-
lib/Target/MSP430/MSP430Subtarget.h | 11 +++++++++++
use std::str;
use std::process;
use std::fs::File;
use std::io::{BufRead, BufReader};
use std::collections::HashMap;
fn main() {
let mut args = std::env::args();
if args.len() < 4 {
let prog = args.next().unwrap();
@pftbest
pftbest / ring.c
Created June 24, 2017 15:53
ring_t
#include "ring.h"
int ring_add(ring_t *ring, ring_data_t data)
{
ring_pos_t next_head = (ring->head + 1) % RING_SIZE;
if (next_head != ring->tail) {
ring->data[ring->head] = data;
ring->head = next_head;
return 0;
} else {
extern crate core;
use core::default::Default;
use core::sync::atomic::{AtomicUsize, Ordering};
use core::cell::UnsafeCell;
const RING_SIZE: usize = 32;
pub struct Ring<T: Clone + Copy> {
head: AtomicUsize,
$ ./llvm-build/bin/llc func.ll -debug-only=isel
=== foo
Initial selection DAG: BB#0 'foo:start'
SelectionDAG has 9 nodes:
t2: i16 = Constant<0>
t0: ch = EntryToken
t4: i32,ch = load<LD4[@bar](align=2)(dereferenceable)> t0, GlobalAddress:i16<i32* @bar> 0, undef:i16
//===-- MSP430InstrInfo.td - MSP430 Instruction defs -------*- tablegen -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file describes the MSP430 instructions in TableGen format.
diff --git a/lib/Target/MSP430/MSP430InstrInfo.td b/lib/Target/MSP430/MSP430InstrInfo.td
index cec43040f60..44869e78649 100644
--- a/lib/Target/MSP430/MSP430InstrInfo.td
+++ b/lib/Target/MSP430/MSP430InstrInfo.td
@@ -1178,6 +1178,8 @@ def : Pat<(store (addc (load addr:$dst), GR16:$src), addr:$dst),
(ADD16mr addr:$dst, GR16:$src)>;
def : Pat<(store (addc (load addr:$dst), (i16 (load addr:$src))), addr:$dst),
(ADD16mm addr:$dst, addr:$src)>;
+def : Pat<(store (addc (load addr:$dst), (i16 imm:$src)), addr:$dst),
+ (ADD16mi addr:$dst, imm:$src)>;
target triple = "msp430-none-elf"
@bar = global i32 0, align 2
define void @foo() {
start:
%0 = load i32, i32* @bar, align 2
%1 = add i32 %0, 1
store i32 %1, i32* @bar, align 2
ret void